First, we need to open the kernel to bonding support.
Set the kernel "Make Menuconfig/xconfig/config" and select "Bonding driver Support" in the "Network Device" section, it is recommended to set the driver as a module, This will enable passing parameters to the driver and setting up multiple bonding devices.
Build and install the new kernel and module.
Settings for Bonding
We need to add two lines to the/etc/modules.conf so that we can automatically load the bonding driver when the bond setting is set up and the system starts
Alias Bond0 Bonding
Options Bond0 miimon=100 mode=1
When Mode=1 is the primary standby mode, mode=0 is the load balancing mode.
Also, in the/etc/sysconfig/network-scripts directory, create a file named Ifcfg-bond0.
Device=bond0
ipaddr=192.168.1.1
netmask=255.255.255.0
network=192.168.1.0
broadcast=192.168.1.255
Onboot=yes
Bootproto=none
Userctl=no
In the script for all network adapters in bond, there is a definition of SLAVE and MASTER. For example, if you want eth0 and eth1 to be members of BOND0, their corresponding configuration files (Ifcfg-eth0 and ifcfg-eth1) will be changed in the following context:
Device=eth0
Userctl=no
Onboot=yes
Master=bond0
Slave=yes
Bootproto=none
In the script file ifcfg-eth1, replace the eth0 with eth1, and also add the IP address information as needed. If you need to set up an additional bonding device (for example, BOND1), change the master=bond0 to Bond1 so that the network adapter becomes a secondary device of BOND1.
Make Bond effective
Restart the network subsystem with the command "/etc/rc.d/init.d/network restart", or you can restart the system for BOND0 to take effect.
In this way, Bond's setup is basically over, if you want to know more detailed information, you can refer to "/usr/src/linux-2.4/documentation/networking/bonding.txt"
Linux Dual NIC Bindings