Ignored instructions in /etc/sysconfig/network-scripts/route-eth1
Posted: 2018/07/15 11:32:40
I'm running Google compute engine virtual maching(Centos 7). To make eth1 active, Google suggests using ip route and rule add commands, which are not persistent. I created a script that works on reboot, but not when the network is restarted.
To make this persistent, I've placed rules in /etc/sysconfig/network-scripts/rule-eth1 and they appear to be working properly based on ip rule show tab rt1. For routes, I've placed the following in /etc/sysconfig/network-scripts/route-eth1
when I check ip route show tab rt1 nothing shows up.
If subsequently run:
The eth1 connection starts working (can ping external IP addresses) and running ip route show tab rt1 now shows
So rules work properly and routes fail in /etc/sysconfig/network-scripts/. One thing that I noticed is my ip route add script wouldn't work until I used
Any suggestions or tips on how to troubleshoot this problem are appreciated.
To make this persistent, I've placed rules in /etc/sysconfig/network-scripts/rule-eth1 and they appear to be working properly based on ip rule show tab rt1. For routes, I've placed the following in /etc/sysconfig/network-scripts/route-eth1
Code: Select all
default via 10.140.0.1 dev eth1 table rt1
If subsequently run:
Code: Select all
ip route add default via 10.140.0.1 dev eth1 table rt1
Code: Select all
default via 10.140.0.1 dev eth1
Code: Select all
ExecStartPre=/bin/sleep 30