Same routing table has been duplicated every time when restarting network
Issue
Setup policy based routing tables as follows;
- /etc/iproute2/rt_tables
10 a
20 b
- /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
TYPE=Ethernet
ONBOOT=yes
NM_CONTROLLED=no
BOOTPROTO=none
IPADDR=192.168.122.241
PREFIX=24
GATEWAY=192.168.122.1
DEFROUTE=yes
- /etc/sysconfig/network-scripts/ifcfg-eth0:1
DEVICE=eth0:1
TYPE=Ethernet
ONBOOT=yes
BOOTPROTO=none
IPADDR=192.168.122.244
PREFIX=24
DEFROUTE=yes
GATEWAY=192.168.122.1
- /etc/sysconfig/network-scripts/route-eth0
192.168.122.0/24 dev eth0 src 192.168.122.241 table a
default via 192.168.122.1 table a
- /etc/sysconfig/network-scripts/route-eth0:1
192.168.122.0/24 dev eth0 src 192.168.122.244 table b
default via 192.168.122.1 table b
- /etc/sysconfig/network-scripts/rule-eth0
from 192.168.122.241 table a
- /etc/sysconfig/network-scripts/rule-eth0:1
from 192.168.122.244 table b
1) After Booting
# ip rule
0: from all lookup local
32764: from 192.168.122.241 lookup a
32765: from 192.168.122.244 lookup b
32766: from all lookup main
32767: from all lookup default
2) After running ''service network restart''
# ip rule
0: from all lookup local
32763: from 192.168.122.241 lookup a
32764: from 192.168.122.244 lookup b
32765: from 192.168.122.244 lookup b ---> this line repeat
32766: from all lookup main
32767: from all lookup default
3) Running ''service network restart'' again
# ip rule
0: from all lookup local
32762: from 192.168.122.241 lookup a
32763: from 192.168.122.244 lookup b
32764: from 192.168.122.244 lookup b ---> this line repeat
32765: from 192.168.122.244 lookup b ---> this line repeat again
32766: from all lookup main
32767: from all lookup default
Environment
- Red Hat Enterprise Linux 6.5
- initscripts-9.03.40-2.el6.x86_64
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
