Bonding configuration is ‘ specific
I was configuring a bonding interface on one of the machines here, but i couldn’t connect to the host after a reboot or network restart.
The bond0 interface was up and running but no eth interfaces where marked as slave for that bond interface.
If I manually ran ifup eth0 the eth0 comes up and is marked as slave of bond0 and the connection to the outside can be established.
I started to debug the /etc/init.d/network script and also the ifup script. In that ifup script i noticed following lines of code:
if [ "${TYPE}" = "Bonding" ] || ethtool -i $DEVICE 2>/dev/null| grep -q "driver: bonding" ; then for device in `LANG=C grep -l "^[[:space:]]*MASTER=${DEVICE}" /etc/sysconfig/network-scripts/ifcfg-*` ; do
/sbin/ifup ${device##*/}
done
fi
So it will grep for MASTER=bond0 and not for MASTER=’bond0′ (note the quotes around bond0).
When i removed the quotes from bond0 in the ifcfg-eth0 file the network started correctly.
For reference, here is my config:
ifcfg-bond0
DEVICE='bond0'
BOOTPROTO='static'
IPADDR='10.0.10.2'
NETWORK='10.0.10.0'
NETMASK='255.255.255.0'
BROADCAST='10.0.10.255'
STARTMODE='onboot'
ifcfg-eth0
DEVICE='eth0'
BOOTPROTO='none'
ONBOOT='yes'
SLAVE='yes'
MASTER=bond0
ifcfg-eth1
DEVICE='eth1'
BOOTPROTO='none'
ONBOOT='yes'
SLAVE='yes'
MASTER=bond0