Red Hat Channel Bonding
id : 0u9r2cageo
category : computer
blog : unixlinux
created : 05/05/10 - 17:03:36

Failover mode

  • In this example we'll take two network interfaces, to setup our bonding :
    • eth0.
    • eth1.

  • Edit your eth0 interface configuration file
# cd /etc/sysconfig/network-script/
# vi ifcfg-eth0

  • Remove lines : BOOTPROTO, DHCPCLASS, IP ADDR AND NETWORK, you'll have something like this
  • Add MASTER=bonding interface, and SLAVE=yes lines
# Broadcom Corporation NetXtreme II BCM5709 Gigabit Ethernet
DEVICE=eth0
HWADDR=00:26:55:51:D9:80
ONBOOT=yes

# Bonding
MASTER=bond0
SLAVE=yes


  • Edit your eth1 interface configuration file like your eth0 one
# cd /etc/sysconfig/network-script/
# vi ifcfg-eth1

  • Repeat eth0 actions
# Broadcom Corporation NetXtreme II BCM5709 Gigabit Ethernet
DEVICE=eth1
HWADDR=00:26:55:51:D9:82
ONBOOT=yes

# Bonding
MASTER=bond0
SLAVE=yes


  • Edit yout bond0 interface configuration file
# cd /etc/sysconfig/network-script/
# vi ifcfg-bond0

  • Do not add HWADDR line
DEVICE=bond0
BOOTPROTO=static
IPADDR=<your ip addr>
NETMASK=<your netmaks>
ONBOOT=yes
USERCTL=no


  • Modifiy your /etc/modprobe.conf file
# vim /etc/modprobe.conf

  • Add alias and options lines
...
alias bond0 bonding
options bond0 mode=1 miimon=100


  • Restart your network service
# service network restart


  • Verify all is good
# cat /proc/net/bonding/bond0
Ethernet Channel Bonding Driver: v3.4.0 (October 7, 2008)

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
Link Failure Count: 0
Permanent HW addr: 00:26:55:51:d9:80

Slave Interface: eth1
MII Status: up
Link Failure Count: 0
Permanent HW addr: 00:26:55:51:d9:82


Using bonding with ifenslave
  • Delete eth1 from bond0 :
# ifenslave -d bond0 eth1

  • Add eth2 to bond0 :
# ifenslave bond0 eth1

  • Change active interface to eth1 :
# ifenslave -c bond0 eth1
# cat /proc/net/bonding/bond0 | grep Slave
Primary Slave: None
Currently Active Slave: eth1
Slave Interface: eth0
Slave Interface: eth1

  • Rechange active interface to eth0 :
# ifenslave -c bond0 eth0
# cat /proc/net/bonding/bond0 | grep Slave
Primary Slave: None
Currently Active Slave: eth0
Slave Interface: eth0
Slave Interface: eth1