- Overview
- Check if Bonding Kernel Module is Installed
- Create the Channel Bonding Interface
- Configure Eth0 for Bond0
- Configure Eth0 for Bond1
- Restart the Network
- Verify Bonding is Working
- Helpful Links
In essense Network Bonding is network level redudancy so that in the event that a nic or swtich dies or that a network cable comes losse or is accidentally removed another nic will step in its pace immediately. Once you have configured the bonding with the help of two NIC cards, then any failure occurs on any one of the NIC cards the kernel will automatically detect the failed of NIC and act to remove it from the bond until it is fixed. Bonding could be also used for the load sharing between the two physical Links.
In this tutorial we will configure network bonding on RHEL 6 with two nics - eth0 & eth1 - to create a bond interface called bond0.
By default the bonding kernel module is not loaded. Failure to load the module may result in your system not enabling the nic bond.
modprobe --first-time bonding
No visual output indicates the module was not running and has now been loaded. This activation will not persist across system restarts.
More info about the bonding module can be obtained by running the following:
modinfo bonding
This can be helpful to determine which features are supported.
vi /etc/sysconfig/network-scripts/ifcfg-bond0
DEVICE=bond0
TYPE=Bond
ONBOOT=yes
BOOTPROTO=static
IPADDR=10.193.0.100
NETMASK=255.255.254.0
GATEWAY=10.193.0.1
USERCTL=no
NM_CONTROLLED=no
BONDING_OPTS="mode=1 miimon=100 updelay=60000 downdelay=0"
Different Modes options are:
- 0 or balance-rr — round-robin mode for fault tolerance and load balancing.
- 1 or active-backup — Sets active-backup mode for fault tolerance.
- 2 or balance-xor — Sets an XOR (exclusive-or) mode for fault tolerance and load balancing.
- 3 or broadcast — Sets a broadcast mode for fault tolerance. All transmissions are sent on all slave interfaces.
- 4 or 802.3ad — Sets an IEEE 802.3ad dynamic link aggregation mode. Creates aggregation groups that share the same speed & duplex settings.
- 5 or 5 — Sets a Transmit Load Balancing (TLB) mode for fault tolerance & load balancing.
- 6 or balance-alb — Sets an Active Load Balancing (ALB) mode for fault tolerance & load balancing.
Media monitoring (miimon) can detect and respond to a failure of either the NIC or the switch it is directly connected to. This approach is robust and simple to configure but cannot detect failures beyond the directly connected switch.
vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
BOOTPROTO=none
ONBOOT=yes
MASTER=bond0
SLAVE=yes
USERCTL=no
NM_CONTROLLED=no
HWADDR=08:00:27:5C:A8:8F
HOTPLUG=no
vi /etc/sysconfig/network-scripts/ifcfg-eth1
DEVICE=eth0
BOOTPROTO=none
ONBOOT=yes
MASTER=bond0
SLAVE=yes
USERCTL=no
NM_CONTROLLED=no
HWADDR=08:00:27:5C:A8:8E
HOTPLUG=no
vi /etc/modeprobe.d/bonding.conf
alias bond0 bonding
service network restart
cat /proc/net/bonding/bond0