UnixServerAdmin

Server Administration & Management

Channel Bonding

Channel bonding (also known as “Ethernet bonding”) is a computer networking arrangement in which two or more network interfaces on a host computer are combined for redundancy or increased throughput.

On Ethernet interfaces, channel bonding requires assistance from both the Ethernet switch and the host computer’s operating system, which must “stripe” the delivery of frames across the network interfaces in the same manner that I/O is striped across disks in a RAID array. For this reason, channel bonding is sometimes also called RAIN, or “redundant array of independent network interfaces”.

Multiple dial-up links over POTS can be channel-bonded together in the same manner and can come closer to achieving their aggregate bandwidth than routing schemes which simply load-balance outgoing network connections over the links. This is known as modem bonding.

The Linux bonding driver provides a method for aggregating multiple network interfaces into a single logical bonded interface. The behavior of the bonded interfaces depends upon the mode; generally speaking, modes provide either hot standby or load balancing services. Additionally, link integrity monitoring may be performed.

RHEL/CentOS allows administrators to bind NICs together into a single channel using the bonding kernel module and a special network interface, called a channel bonding interface. Channel bonding enables two or more network interfaces to act as one, simultaneously increasing the bandwidth and providing redundancy.

Following is the simple process to configure NIC bonding on a linux server:-

1. Create/Edit a file called ifcfg-bond0 in /etc/sysconfig/network-scripts/

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

Append following lines to it:

DEVICE=bond0
IPADDR=192.168.1.10
NETWORK=192.168.1.0
NETMASK=255.255.255.0
BROADCAST=192.168.1.255
GATEWAY=192.168.1.1
USERCTL=no
BOOTPROTO=none
ONBOOT=yes

Replace above IP address with your actual IP address. Save file and exit to shell prompt.

2. Modify eth0 and eth1 config files:

Open both configuration using vi text editor and make sure file read as follows for eth0 interface

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

and Modify/append directive as follows:

DEVICE=eth0
USERCTL=no
ONBOOT=yes
MASTER=bond0
SLAVE=yes
BOOTPROTO=none

Open eth1 configuration file using vi text editor:

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

and Make sure file read as follows for eth1 interface:

DEVICE=eth1
USERCTL=no
ONBOOT=yes
MASTER=bond0
SLAVE=yes
BOOTPROTO=none

Save file and exit to shell prompt.

3. Load bond driver/module

Make sure bonding module is loaded when the channel-bonding interface (bond0) is brought up. You need to modify kernel modules configuration file:

# vi /etc/modprobe.conf  (in RHEL 5)  “OR”
# vi /etc/modprobe.d/modprobe.conf  (in RHEL 6)

Append following two lines:

# vi /etc/modprobe.conf

alias bond0 bonding
options bond0 miimon=100 mode=1

Mode value is used to determine the operational mode of Bond e.g. active-backup or active-active. Different bonding modes are documented in /usr/share/doc/kernel-doc-2.4.21/networking/bonding.txt

There are different modes in network bonding :
mode=0 (Balance-rr) – This mode provides load balancing and fault tolerance.
mode=1 (active-backup) – This mode provides fault tolerance.
mode=2 (balance-xor) – This mode provides load balancing and fault tolerance.
mode=3 (broadcast) – This mode provides fault tolerance.
mode=4 (802.3ad) – This mode provides load balancing and fault tolerance.
mode=5 (balance-tlb) – Prerequisite: Ethtool support in the base drivers for retrieving the speed of each slave.
mode=6 (Balance-alb) – Prerequisite: Ethtool support in the base drivers for retrieving the speed of each slave.

Run following commands to activate bonding; make sure you are connected to console otherwise you will loose your session as network services will be restarted.

# modprobe bonding
# modprobe -r -v bonding
# modeprobe -r -b bonding -o bond0

Restart networking service in order to bring up bond0 interface:

# service network restart

To verify that bond is working; use following commands:

# less /proc/net/bonding/bond0
# ifconfig -a

Advertisements

January 1, 2011 - Posted by | Unix/Linux | ,

3 Comments »

  1. hello, really good article, and a good understand! one for my book marks.

    Comment by Drusilla | January 24, 2011 | Reply

  2. Nice Article

    Comment by Steve | March 26, 2011 | Reply

  3. Continue to publish about this matter. Right now there can be a greater need than you may expect for this sort of knowledge and assistance. Everything you reveal is beneficial to the individual that is looking to get the thoughts that you have put together.

    Comment by amazing water blog | June 16, 2011 | Reply


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

%d bloggers like this: