Posted by: Mangesh_Linux_Administrator | July 16, 2011

Ethernet Bonding on RHEL or CentOS


How-To configure Ethernet Bonding on RHEL or CentOS

This simple post will show how to configure Ethernet Bonding on two (or more) network interfaces on RHEL 5 or CentOS 5.
I’ve tested this configuration on a CentOS 5.6 with kernel 2.6.18-238.12.1.el5 as you could see below :

uname -a

Linux server11.testing.com 2.6.18-238.12.1.el5 #1 SMP Tue May 31 13:23:01 EDT 2011 x86_64 x86_64 x86_64 GNU/Linux


If you want to create a bonding on two interface (i.e. eth0 and eth1) you should do the following :
Edit /etc/sysconfig/network-scripts/ifcfg-eth0
# Bonding eth0 to bond0
DEVICE=eth0
BOOTPROTO=none
ONBOOT=yes
MASTER=bond0
SLAVE=yes
USERCTL=NO

Edit /etc/sysconfig/network-scripts/ifcfg-eth1
# Bonding eth1 to bond0
BOOTPROTO=none
ONBOOT=yes
MASTER=bond0
SLAVE=yes
USERCTL=NO

Copy /etc/sysconfig/network-scripts/ifcfg-eth1 to /etc/sysconfig/network-scripts/ifcfg-bond0 to keep the same file permission by executing the following commands :
cd /etc/sysconfig/network-scripts
copy ifcfg-eth1 ifcfg-bond0
Edit /etc/sysconfig/network-scripts/ifcfg-bond0
ifcfg-bond0
DEVICE=bond0
BOOTPROTO=none
ONBOOT=yes
NETWORK=192.168.100.0
NETMASK=255.255.255.252
IPADDR=192.168.100.1
USERCTL=NO
Edit /etc/modprobe.conf adding the following line :
alias bond0 bonding

Reboot your system to let modules be loaded or load it manually with the following command :
insmod bond0 bonding
If you haven’t rebooted your system, restart your network with the following command :
/etc/init.d/network restart
You should check if bonding is working you should look at /proc/net/bonding/bond0 with the following command :
cat /proc/net/bonding/bond0
and you should see something similar to the following :
Ethernet Channel Bonding Driver: v3.2.4 (January 8, 2010)

Bonding Mode: load balancing (round-robin)
MII Status: up
MII Polling Interval (ms): 0
Up Delay (ms): 0
Down Delay (ms): 0

Slave Interface: eth0
MII Status: up
Link Failure Count: 0
Permanent HW addr: 00:15:17:88:5a:3c

Slave Interface: eth1
MII Status: up
Link Failure Count: 0
Permanent HW addr: 00:15:17:88:5a:3d
DONE

Originally posted by Riccardo,  thanks Riccardo for such useful information.

http://www.riccardoriva.com/archives/686

Advertisements

Responses

  1. Thanks Riccardo for sharing.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Categories

%d bloggers like this: