Configure Bonding in Redhat or CentOS

1. Create ifcfg-bond0 File

All the network configuration scripts are located under /etc/sysconfig/network-scripts in RHEL. Verify the link status of the interfaces using the command “ethtool ”

Create a file ifcfg-bond0 with the below values and replace with correct IP, NETMASK and the appropriate bonding mode ( mode 0, 1 ,2 …) like the below.

# cd /etc/sysconfig/network-scripts

# vi ifcfg-bond0
DEVICE=bond0
IPADDR=192.168.1.3
NETMASK=255.255.255.0
ONBOOT=yes
BOOTPROTO=none
USERCTL=no
BONDING_OPTS="mode=1 miimon=100"

2. Modify ifcfg-eth0 and ifcfg-eth1 Files

Edit the network interface files for eth0 & eth1 to reflect entries similar to the following. Make sure you have MASTER and SLAVE parameters defined as shown below.

# cat ifcfg-eth0
DEVICE=eth0
HWADDR=00:44:56:67:0C:10
MASTER=bond0
SLAVE=yes
ONBOOT=yes
USERCTL=no
BOOTPROTO=none

# cat ifcfg-eth1
DEVICE=eth1
HWADDR=00:50:56:10:0C:2A
MASTER=bond0
SLAVE=yes
ONBOOT=yes
USERCTL=no
BOOTPROTO=none

3. Create bonding.conf File

Create the bonding.conf file with the following content.

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

4. Restart Network Service and Verify Bonding

Restart the network services:

service network restart

Verify the bonding status as shown below.

The following indicates that the current bonding mode is fault-tolerance.

# cat /proc/net/bonding/bond0
Ethernet Channel Bonding Driver: v3.6.0 (September 26, 2009)

Bonding Mode: fault-tolerance (active-backup)
Primary Slave: None
Currently Active Slave: eth0
MII Status: up
MII Polling Interval (ms): 100
Up Delay (ms): 0
Down Delay (ms): 0

Slave Interface: eth0
MII Status: up
Speed: 10000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 00:50:56:8e:0c:10
Slave queue ID: 0

Slave Interface: eth1
MII Status: up
Speed: 10000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 00:50:56:8e:0c:2a
Slave queue ID: 0

You can perform the test by bringing down one interface, seeing that other interface will be active one and vice-versa.

LEAVE A REPLY

Please enter your comment!
Please enter your name here