Thursday, February 17, 2011

Bonding on RedHat 5 / CentOS 5

In the modprobe.conf file add the following:

alias bond0 bonding
options bond0 miimon=100 mode=1
Be sure to add this before any of the network aliases modes:

mode=0 (Balance Round Robin)
mode=1 (Active backup)
mode=2 (Balance XOR)
mode=3 (Broadcast)
mode=4 (802.3ad)
mode=5 (Balance TLB)
mode=6 (Balance ALB)
In the /etc/sysconfig/network-scripts/ directory create ifcfg-bond0

DEVICE=bond0
IPADDR=
NETMASK=
NETWORK=
BROADCAST=
GATEWAY=
ONBOOT=yes
BOOTPROTO=none
USERCTL=no
Change the ifcfg-eth0 to:

DEVICE=eth0
ONBOOT=yes
BOOTPROTO=none
USERCTL=no
MASTER=bond0
SLAVE=yes
Change the ifcfg-eth1 to:

DEVICE=eth1
ONBOOT=yes
BOOTPROTO=none
USERCTL=no
MASTER=bond0
SLAVE=yes
Check the status of the bond.  
cat /proc/net/bonding/bond0
You can use multiple bond interface but for that you must load the bonding module as many as you need. Presuming that you want two bond interface you must configure the /etc/modprobe.conf as follow:

 alias bond0 bonding
 alias bond1 bonding
 options bonding max_bonds=2

Also add in /etc/sysconfig/network-script/ifcfg-bond0 & bond1 below line

BONDING_OPTS="miimon=100 mode=1"

No comments :

Post a Comment