Hello,
The default gateway keeps changing to eth0 from bond0 on reboot. Can anyone help identify the problem?
Route output (after reboot):
Destination Gateway Genmask Flags Metric Ref Use Iface
10.10.0.0 * 255.255.0.0 U 0 0 0 bond0
10.10.0.0 * 255.255.0.0 U 1 0 0 eth1
10.10.0.0 * 255.255.0.0 U 1 0 0 eth2
10.10.0.0 * 255.255.0.0 U 1 0 0 eth0
link-local * 255.255.0.0 U 1005 0 0 bond0
default 10.10.1.254 0.0.0.0 UG 0 0 0 eth0
I've tried adding/removing settings from '/etc/sysconfig/network-scripts/ifcfg-bond0' and '/etc/sysconfig/network' with no success. Below is what I've currently got:
/etc/sysconfig/network
NETWORKING=yes
HOSTNAME=centos01.domain.local
GATEWAYDEV=bond0
GATEWAY=10.10.1.254
NTPSERVERARGS=iburst
/etc/sysconfig/network-scripts/ifcfg-bond0
DEVICE=bond0
BOOTPROTO=none
ONBOOT=yes
IPADDR=10.10.1.16
NETWORK=10.10.0.0
NETMASK=255.255.0.0
GATEWAY=10.10.1.254
USERCTL=no
BONDING_OPTS="mode=6 miimon=100"
TYPE=Ethernet
PREFIX=16
DNS1=10.10.1.11
DOMAIN=domain.local
DEFROUTE=yes
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
NAME="System bond0"
UUID=ad33d8b0-1f7b-cab9-9447-ba07f855b143
LAST_CONNECT=1420665973
/etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
MASTER=bond0
SLAVE=yes
USERCTL=no
ONBOOT=yes
BOOTPROTO=none
/etc/sysconfig/network-scripts/ifcfg-eth1
DEVICE=eth1
MASTER=bond0
SLAVE=yes
USERCTL=no
ONBOOT=yes
BOOTPROTO=none
/etc/sysconfig/network-scripts/ifcfg-eth2
DEVICE=eth2
MASTER=bond0
SLAVE=yes
USERCTL=no
ONBOOT=yes
BOOTPROTO=none
When rebooting, I get 2-3 ping responses from a remote network address mid boot. Interestingly (maybe)... service network restart completely drops the server from the network and I have to reboot to restore the connection.
Any help greatly appreciated!
[RESOLVED] Default Gateway chgs to eth0 from bond0 on reboot
[RESOLVED] Default Gateway chgs to eth0 from bond0 on reboot
Last edited by i am yeti on 2015/02/17 23:33:56, edited 1 time in total.
Re: Default Gateway changes to eth0 from bond0 on reboot
/etc/sysconfig/network-scripts/ifcfg-xxx:
NM_CONTROLLED=no
NM_CONTROLLED=no
Re: Default Gateway changes to eth0 from bond0 on reboot
Thanks for the reply
I've added NM_CONTROLLED to all ifcfg-xxx files. Unfortunately, the gateway is still changing to eth0 after a reboot... but 'service network restart' now works and sets the gateway correctly.
route after reboot:
Destination Gateway Genmask Flags Metric Ref Use Iface
10.10.0.0 * 255.255.0.0 U 0 0 0 bond0
10.10.0.0 * 255.255.0.0 U 1 0 0 eth1
10.10.0.0 * 255.255.0.0 U 1 0 0 eth2
10.10.0.0 * 255.255.0.0 U 1 0 0 eth0
link-local * 255.255.0.0 U 1005 0 0 bond0
default 10.10.1.254 0.0.0.0 UG 0 0 0 eth0
route after service network restart
Destination Gateway Genmask Flags Metric Ref Use Iface
10.10.0.0 * 255.255.0.0 U 0 0 0 bond0
link-local * 255.255.0.0 U 1005 0 0 bond0
default 10.10.1.254 0.0.0.0 UG 0 0 0 bond0
I've added NM_CONTROLLED to all ifcfg-xxx files. Unfortunately, the gateway is still changing to eth0 after a reboot... but 'service network restart' now works and sets the gateway correctly.
route after reboot:
Destination Gateway Genmask Flags Metric Ref Use Iface
10.10.0.0 * 255.255.0.0 U 0 0 0 bond0
10.10.0.0 * 255.255.0.0 U 1 0 0 eth1
10.10.0.0 * 255.255.0.0 U 1 0 0 eth2
10.10.0.0 * 255.255.0.0 U 1 0 0 eth0
link-local * 255.255.0.0 U 1005 0 0 bond0
default 10.10.1.254 0.0.0.0 UG 0 0 0 eth0
route after service network restart
Destination Gateway Genmask Flags Metric Ref Use Iface
10.10.0.0 * 255.255.0.0 U 0 0 0 bond0
link-local * 255.255.0.0 U 1005 0 0 bond0
default 10.10.1.254 0.0.0.0 UG 0 0 0 bond0
Re: Default Gateway changes to eth0 from bond0 on reboot
I suggest:
1) Taking all the GATEWAY entries out of /etc/sysconfig/network
2) Taking the GATEWAY=10.10.1.254 and DEFROUTE=yes out of /etc/sysconfig/network-scripts/ifcfg-bond0
3) Changing NAME="System bond0" to NAME="bond0" in /etc/sysconfig/network-scripts/ifcfg-bond0
4) Adding /etc/sysconfig/network-scripts/route-bond0 with an entry like default via 10.10.1.254 dev bond0
Also if you get something like "RTNETLINK answers: File exists" or 'Error: either "to" is a duplicate, or "X.X.X.X" is a garbage.' you've probably got a duplicate gateway entry.
1) Taking all the GATEWAY entries out of /etc/sysconfig/network
2) Taking the GATEWAY=10.10.1.254 and DEFROUTE=yes out of /etc/sysconfig/network-scripts/ifcfg-bond0
3) Changing NAME="System bond0" to NAME="bond0" in /etc/sysconfig/network-scripts/ifcfg-bond0
4) Adding /etc/sysconfig/network-scripts/route-bond0 with an entry like default via 10.10.1.254 dev bond0
Also if you get something like "RTNETLINK answers: File exists" or 'Error: either "to" is a duplicate, or "X.X.X.X" is a garbage.' you've probably got a duplicate gateway entry.
Re: Default Gateway changes to eth0 from bond0 on reboot
Right, we're up and running
Followed the advice from aks and did get 'Error: either "to" is a duplicate, or "X.X.X.X" is a garbage.'. So I removed the route-bond0 file and added GATEWAY=10.10.1.254 back into etc/sysconfig/network. Looks to have done the trick.
Thanks for the help.
Followed the advice from aks and did get 'Error: either "to" is a duplicate, or "X.X.X.X" is a garbage.'. So I removed the route-bond0 file and added GATEWAY=10.10.1.254 back into etc/sysconfig/network. Looks to have done the trick.
Thanks for the help.