Posted by: kezhong | June 3, 2009

Ethernet Channel Bonding on Fedora 10

Ethernet Channel Bonding  is a facility provided by Linux to provide fault-tolerance and load spreading for NICs. We can use two or more NICs to act as one providing redundancy and increasing the bandwidth. It is called IPMP by Solaris and EtherChannel by AIX. 

Adding a new virtual network adapter

On VMware Workstation 6.5, I installed two virtual machines, Fedora10A and Fedora10B. They have one network adapter respectively. I need to add a new network adapter on Fedora10A. Follow these steps.

1. Be sure the Fedora10A is powered off.
2. Open the virtual machine settings editor (VM > Settings).
3. Click Add.
4. The Add Hardware Wizard starts. Select Network Adapter. Click Next.
5. Select the network type  — Bridged.
6. Click Finish. The new adapter is added.
7. Click OK to save your configuration and close the virtual machine settings editor. 

Creating a bond0 configuration file

# vi /etc/sysconfig/network-scripts/ifcfg-bond0
DEVICE=bond0
IPADDR=192.168.18.9
NETMASK=255.255.255.0
BROADCAST=192.168.18.255
ONBOOT=yes
BOOTPROTO=none

Backup and modify eth0 and eth1 configuration files

Before doing the following steps, we should backup the eth0 and eth1 
configuration files.
 
# vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
BOOTPROTO=none
ONBOOT=yes
MASTER=bond0
SLAVE=yes
 
# vi /etc/sysconfig/network-scripts/ifcfg-eth1
DEVICE=eth1
BOOTPROTO=none
ONBOOT=yes
MASTER=bond0
SLAVE=yes

Load Ethernet Bonding Driver

# vi /etc/modprobe.d/modprobe.conf.dist
 
Append the following two lines:
 
alias bond0 bonding
options bond0 miimon=100 mode=1

Test

Restart the Fedora10A, and list all interfaces.

[kezhong@a ~]$ ifconfig -a
bond0     Link encap:Ethernet  HWaddr 00:00:00:00:00:00 
          BROADCAST MASTER MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)
 
eth0      Link encap:Ethernet  HWaddr 00:0C:29:5C:42:B3 
          inet addr:192.168.18.9  Bcast:192.168.18.255  Mask:255.255.255.0
          inet6 addr: fe80::20c:29ff:fe5c:42b3/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:19 errors:0 dropped:0 overruns:0 frame:0
          TX packets:14 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:4529 (4.4 KiB)  TX bytes:2673 (2.6 KiB)
          Interrupt:19 Base address:0x2000
 
eth1      Link encap:Ethernet  HWaddr 00:0C:29:5C:42:BD 
          inet addr:192.168.18.9  Bcast:192.168.18.255  Mask:255.255.255.0
          inet6 addr: fe80::20c:29ff:fe5c:42bd/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:29 errors:0 dropped:0 overruns:0 frame:0
          TX packets:14 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:7059 (6.8 KiB)  TX bytes:2673 (2.6 KiB)
          Interrupt:19 Base address:0x2080
 
Or use the following command to verify.
 
[kezhong@a ~]$ cat /proc/net/bonding/bond0
Ethernet Channel Bonding Driver: v3.3.0 (June 10, 2008)
 
Bonding Mode: fault-tolerance (active-backup)
Primary Slave: None
Currently Active Slave: None
MII Status: down
MII Polling Interval (ms): 100
Up Delay (ms): 0
Down Delay (ms): 0
 
Finally, you can remove the virtual network adapter you added in 
the first step, check the result again.
 
 

References

http://robertolitrico.blogspot.com/2007/04/nic-teaming-on-fedora-core.html
http://www.cyberciti.biz/tips/linux-bond-or-team-multiple-network-interfaces-nic-into-single-interface.html
http://space.itpub.net/9240380/viewspace-531849


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: