Note: the Medusa cluster does not currently use channel bonding.
This document details setting up and testing a simple channel bonded network. It assumes the following: two machines running some form of Linux with a kernel version 2.2.17 or later, two similar network cards per machine with working drivers, two switches (or possibly one switch capable of dealing with channel bonding), and adequate cable to connect the switches and machines. Two methods of bonding are documented: an automated method using RedHat 5.0 or later, or a simpler method possible with any distribution.
If you need to use two switches, you'll need to set up the network in a specific fashion. Each machine must be connected to both switches - i.e., one cable running from one ethernet card to one switch, and one cable running from the other ethernet card to the other switch.
Any kernel 2.2.17 or above has the required bonding device/module available. The option for adding the bonding device is in the network devices section during kernel configuration. (Note: Earlier kernels may have the bonding device as well, but there have been reports of the bonding device in these kernels causing kernel panics).
Add the line alias bond0 bonding to /etc/conf.modules.
Change to the /etc/sysconfig/network-scripts directory. Copy ifcfg-eth0 to ifcfg-bond0. Edit ifcfg-bond0 to appear as the following, replacing the XXX's with appropriate values for your network:
DEVICE=bond0 USERCTL=no ONBOOT=yes BOOTPROTO=none BROADCAST=XXX.XXX.XXX.255 NETWORK=XXX.XXX.XXX.0 NETMASK=255.255.255.0 IPADDR=XXX.XXX.XXX.XXX
Edit ifcfg-eth0 and ifcfg-eth1 to appear as the following (replacing X with the appropriate device number):
DEVICE=ethX USERCTL=no ONBOOT=yes MASTER=bond0 SLAVE=yes BOOTPROTO=none
Upon reboot, the network should come up bonded together.
If you are not using RedHat 5.0 or later, or don't wish to use RedHat's scripting method, the following commands should bring up a bonded network.
/sbin/ifconfig bond0 address netmask XXX.XXX.XXX.XXX
broadcast XXX.XXX.XXX.XXX up
/sbin/ifenslave bond0 eth0
/sbin/ifenslave bond0 eth1
When the network is properly configured and bonded, the output of ifconfig should look similar to this:
bond0 Link encap:Ethernet HWaddr 00:C0:F0:1F:37:B4 inet addr:XXX.XXX.XXX.YYY Bcast:XXX.XXX.XXX.255 Mask:255.255.252.0 UP BROADCAST RUNNING MASTER MULTICAST MTU:1500 Metric:1 RX packets:7224794 errors:0 dropped:0 overruns:0 frame:0 TX packets:3286647 errors:1 dropped:0 overruns:1 carrier:0 collisions:0 txqueuelen:0 eth0 Link encap:Ethernet HWaddr 00:C0:F0:1F:37:B4 inet addr:XXX.XXX.XXX.YYY Bcast:XXX.XXX.XXX.255 Mask:255.255.252.0 UP BROADCAST RUNNING SLAVE MULTICAST MTU:1500 Metric:1 RX packets:3573025 errors:0 dropped:0 overruns:0 frame:0 TX packets:1643167 errors:1 dropped:0 overruns:1 carrier:0 collisions:0 txqueuelen:100 Interrupt:10 Base address:0x1080 eth1 Link encap:Ethernet HWaddr 00:C0:F0:1F:37:B4 inet addr:XXX.XXX.XXX.YYY Bcast:XXX.XXX.XXX.255 Mask:255.255.252.0 UP BROADCAST RUNNING SLAVE MULTICAST MTU:1500 Metric:1 RX packets:3651769 errors:0 dropped:0 overruns:0 frame:0 TX packets:1643480 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:100 Interrupt:9 Base address:0x1400