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

Issues related to configuring your network
Post Reply
BMan54
Posts: 2
Joined: 2018/07/15 11:21:27

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

Post by BMan54 » 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

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.

aks
Posts: 2529
Joined: 2014/09/20 11:22:14

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

Post by aks » 2018/07/18 17:54:01

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.

BMan54
Posts: 2
Joined: 2018/07/15 11:21:27

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

Post by BMan54 » 2018/07/25 22:30:58

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?

Post Reply