Page 1 of 1

Ignored instructions in /etc/sysconfig/network-scripts/route-eth1

Posted: 2018/07/15 11:32:40
by BMan54
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

Code: Select all

default via 10.140.0.1 dev eth1 table rt1
when I check ip route show tab rt1 nothing shows up. :(
If subsequently run:

Code: Select all

ip route add default via 10.140.0.1 dev eth1 table rt1
The eth1 connection starts working (can ping external IP addresses) and running ip route show tab rt1 now shows

Code: Select all

default via 10.140.0.1 dev eth1
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

Code: Select all

ExecStartPre=/bin/sleep 30
Any suggestions or tips on how to troubleshoot this problem are appreciated.

Re: Ignored instructions in /etc/sysconfig/network-scripts/route-eth1

Posted: 2018/07/18 17:54:01
by aks
At a guess, perhaps the route is applied before the table has been setup, in which case the route says apply to (a currently non existent) table? Try and simplify what you are doing.

Re: Ignored instructions in /etc/sysconfig/network-scripts/route-eth1

Posted: 2018/07/25 22:30:58
by BMan54
What I am doing is actually pretty simple, I put what appear to be the correct commands into /etc/sysconfig/network-scripts/rule-eth1

I only run a script because the command mentioned does not load. In fact, I want to do away with the script. The question is really does anyone know why the rule isn't sticking?

Re: Ignored instructions in /etc/sysconfig/network-scripts/route-eth1

Posted: 2018/08/27 17:46:30
by aks
No it's not.

You're sometimes doing layer 2 and sometimes doing layer 3.