Bonding Configuration in Linux

1. Create ifcfg-bond0 file as given below.

#vi /etc/sysconfig/network-scripts/ifcfg-bond0

DEVICE=bond0 
IPADDR=192.168.59.130
NETMASK=255.255.255.0 
GATEWAY=192.168.59.1
NETWORK=192.168.0.0
USERCTL=no 
BOOTPROTO=none 
ONBOOT=yes

2. Append below lines in ifcfg-eth0 and ifcfg-eth1

#vi /etc/sysconfig/network-scripts/ifcfg-eth0

DEVICE=eth0 
BOOTPROTO=none 
ONBOOT=yes

############# Bond Configuration Parameter #########

MASTER=bond0 
SLAVE=yes

#vi /etc/sysconfig/network-scripts/ifcfg-eth1




DEVICE=eth1 
BOOTPROTO=none  
ONBOOT=yes 
USERCTL=no 

############ Bond Configuration Parameter ########

MASTER=bond0 
SLAVE=yes

3. Append the following three lines into /etc/modprobe.conf

#vi /etc/modprobe.conf

#### Bonding Configuration ####
alias bond0 bonding 
options bond0 mode=1 miimon=100


Possible option for mode:

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)

4. Load the bond driver module with below command

#modprobe bonding

5. Restart the network services or restart OS

#service network restart or  #reboot 

6. Check bonding status once machine comes up.

#cat /proc/net/bonding/bond0 

Ethernet Channel Bonding Driver: v3.0.2 (March 23, 2006)

Bonding Mode: adaptive load balancing 
Primary Slave: None 
Currently Active Slave: eth2 
MII Status: up 
MII Polling Interval (ms): 100 
Up Delay (ms): 0 
Down Delay (ms): 0

Slave Interface: eth2 
MII Status: up 
Link Failure Count: 0 
Permanent HW addr: 00:0B:29:0D:7A:5E 

No comments:

Post a Comment