Channel bonding (NIC Teaming) in CentOS 6.x

Posted on 14th April 2014

Channel bonding (also known as NIC Teaming) enables multiple network interfaces to be joined together to form a single channel that gives higher bandwidth and redundancy. Channel bonding in CentOS is provided by the bonding kernel module and it supports different policies for load balancing and fault tolerance.

This article explains how to create a channel bond interface named bond0 with two network interfaces eth0 and eth1. The two interfaces will operate in an active-backup configuration for fault tolerance.

Step 1: Configure bonding kernel module

Create a file named bond.conf in the /etc/modprobe.d/ directory and add the contents as below

# vi /etc/modprobe.d/bond.conf
alias bond0 bonding

The config file /etc/modprobe.conf used in earlier versions of CentOS is deprecated in CentOS 6. The config file should now reside in the /etc/modprobe.d/ directory. The file name can be anything with a .conf extension

Step 2: Create channel bonding interface bond0

Create a file named ifcfg-bond0 in /etc/sysconfig/network-scripts/ directory

Set an appropriate IP address, netmask and gateway for your environment.The BONDING_OPTS directive specifies the parameters for the bonding driver.-mode parameter is used to set the bonding policy, in this case it is set to 1 for an active-backup policy.-primary parameter sets the primary network interface as eth0-miimon parameter sets the link check interval to 100 milliseconds

For a complete list of bonding module parameters run:

# modinfo bonding

Bonding parameters can be set also on the .conf file in /etc/modprobe.d/ directory which will then be applied to all channel bonds in the system.

If you create multiple bonds in your system, specifying the bonding module parameters in the bond interface configuration file gives you the flexibility to have different bonding policies and configuration for each bond.

The above output shows bond0 is running in active-backup mode with two slaves eth0 and eth1. Only one of the interfaces will be active at a time, in this case it is eth0. To display the status of the bond0 interface run