CentOS 6.3 NIC Bonding

Posted on by admin

CentOS 6.3 NIC Bonding

NIC Bonding or Channel Bonding enables two or more network interfaces to act as one, simultaneously increasing the bandwidth and providing redundancy. If one physical NIC is down or unplugged, it will automatically move resource to another NIC card in the bond.

Step 1: Creating Bonding Channel

As root, create a new file name, bonding.conf in this example, in the /etc/modprobe.d/ directory. Insert the following line in this new file:

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

For each configured channel bonding interface, there must be a corresponding entry in your new /etc/modprobe.d/bonding.conf file.

Step 2: Creating Channel Bonding Interface

To create a channel bonding interface, create a file in the /etc/sysconfig/network-scripts/ directory called ifcfg-bond0. The following is an example:

#vi /etc/sysconfig/network-scripts/ifcfg-bond0
DEVICE=bond0
IPADDR=192.168.1.8
NETMASK=255.255.255.0
ONBOOT=yes
BOOTPRO=none
USERCTL=no

Step 3: Configuring Channel Bonding Interface

After the channel bonding interface is created, the network interfaces to be bound together must be configured by adding the MASTER and SLAVE directives to their configuration files. The configuration files for each of the channel-bonded interfaces can be nearly identical For example:

eth0

#vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
USERCTL=no
ONBOOT=bond0
SLAVE=yes
BOOTPRO=none

#vi /etc/sysconfig/network-scripts/ifcfg-eth1
DEVICE=eth1
USERCTL=no
ONBOOT=yes
MASTER=bond0
SLAVE=yes
BOOTPRO=none

  • DEVICE: Indicates what is the device name
  • USERCTL: Indicates if user can control this device (in this case, no)
  • ONBOOT: Indicates that at boot time should this device be up (in this case, yes)
  • MASTER: the device master (in this case bond0)
  • SLAVE: Indicates if this device is a slave
  • BOOTPRO: Where to get the IP Address from (in this case since it is set to none, it indicates a static IP)

Step 4: Restarting Network Service

Restart the network service and check the output of ifconfig

#service network restart
#ifconfig

and check to see that bond0 is UP and that eth0 and eth1 (in this case) are UP and running as SLAVE.