2012年12月6日 星期四

Route setting under multi interfaces

The GATEWAY setting in ifcfg-eth0 will add a default gateway while interface starts, but may be overwrited by next started interface. To avoid this, remove the GATEWAY setting in ifcfg-eth0 and use route-eth0 file
Note. NetworkManager should be stopped

for Example, If there are two interface eth0 and eth1
ifcfg-eth0

DEVICE=eth0
IPADDR=10.3.23.221
NETMASK=255.0.0.0
#GATEWAY=10.3.23.254
ifcfg-eth1
DEVICE=eth0
IPADDR=172.18.101.2
NETMASK=255.255.0.0
#GATEWAY=172.18.254.254
route-eth0
default 10.3.23.254 dev eth0
route-eth1
172.16.0.0/12 via 172.18.254.254 dev eth1

沒有留言:

張貼留言