Follow the 4 steps below to configure the bonding interface in CentOS/RHEL 5.
1. configure bonding driver.
# grep bond0 /etc/modprobe.conf alias bond0 bonding
2. configure under-layer interfaces
# cat /etc/sysconfig/network-scripts/ifcfg-eth1 DEVICE=eth1 BOOTPROTO=none ONBOOT=yes MASTER=bond0 SLAVE=yes
# cat /etc/sysconfig/network-scripts/ifcfg-eth2 DEVICE=eth2 BOOTPROTO=none ONBOOT=yes MASTER=bond0 SLAVE=yes
3. configure bonding interface with bonding parameters:
# cat /etc/sysconfig/network-scripts/ifcfg-bond0 DEVICE=bond0 BOOTPROTO=dhcp ONBOOT=yes BONDING_OPTS="mode=4 miimon=100 lacp_rate=1"
4. activate bonding interface
# ifup bond0
CenntOS/RHEL 5 enhances the bonding interface configuration. It’s recommended to configure bonding parameters in ifcfg-bondX instead of /etc/modprobe.conf. The benefit is that those parameters could be changed per bonding interface during the interface initialization process, rather than the bonding driver initialization process. That is to say, parameter change does not require the bonding driver to be reloaded anymore. This helps to reduce the system-wide network outage while doing some tiny change on the bonding interfaces.
Please be noted that the bonding parameter configuration in /etc/modprobe.conf is still supported. It’s just not recommended.