I configured network bonding on two machine with centos 5.5. Bonding works well, but the problem is default gateway: it is not configured!
I follow this tutorial. I added GATEWAY in both (and either) /etc/sysconfig/network and /etc/sysconfig/network-scripts/ifcfg-bond0. But, when I restart network (or server) there is no default gateway (route command).
This is ip route ls
output after network restart:
10.0.0.0/16 dev bond0 proto kernel scope link src 10.0.0.88
Where is my mistake?
/etc/sysconfig/network
NETWORKING=yes
NETWORKING_IPV6=no
IPV6INIT=no
HOSTNAME=mysql2
NOZEROCONF=yes
GATEWAY=10.0.1.10
/etc/sysconfig/network-scripts/ifcfg-bond0
DEVICE=bond0
IPADDR=10.0.0.88
NETMASK=255.255.0.0
NETWORK=10.0.0.0/16
BROADCAST=10.0.255.255
GATEWAY=10.0.1.10
ONBOOT=yes
BOOTPROTO=none
USERCTL=no
TYPE=Ethernet
/etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
ONBOOT=yes
BOOTPROTO=none
USERCTL=no
MASTER=bond0
SLAVE=yes
/etc/sysconfig/network-scripts/ifcfg-eth1
DEVICE=eth1
ONBOOT=yes
BOOTPROTO=none
USERCTL=no
MASTER=bond0
SLAVE=yes
I don't think this is specified correctly. It should be just
or try leaving it out entirely its redundant information
TrevorH (a linux sysadmin) solved my problem (I post my question also into centos forum).
Removing NETWORK and BROADCAST lines from ifcfg-bond0, the default gateway is configured.
The correct place for the default gateway is /etc/sysconfig/network - remove it from your bond scripts. Also ensure that your route defined as
GATEWAY=x.x.x.x
What does
ip route ls
show afterservice network restart
You cannot use booth like that, or you set network=10.0.0.0/16 without netmask or you set network=10.0.0.0 and netmask=255.255.0.0.
Regards.