Post date: 22-Apr-2010 11:49:10
http://outhereinthefield.wordpress.com/2008/05/01/interface-bonding-teaming-on-red-hat-el/
OR
http://kbase.redhat.com/faq/docs/DOC-7944
OR
http://www.onlinehowto.net/Tutorials/Linux-Networking/Bonding-Ethernet-interfaces-in-RHEL4/899
OR
https://www.redhat.com/archives/redhat-install-list/2005-May/msg00222.html
Interface or NIC bonding or also called teaming, is to use two or more NIC in conjunction using round robin scheduler. The machine will only recognize one interface, while packet are sent from two slave interface.
To do this, make sure you have all the appropriate modules installed. On terminal, type:
#modprobe –list | grep mii
make sure the output is similar to this:
/lib/modules/2.6.9-67.0.1.ELsmp/kernel/drivers/net/mii.ko
and
#modprobe –list | grep bonding
make sure the output is similar to this:
/lib/modules/2.6.9-67.0.1.ELsmp/kernel/drivers/net/bonding/bonding.ko
If all is well, the next step is to create the interface configuration files. Let’s assume that we’ll be bonding eth0 and eth1 together.
First create the bonding interface, open a terminal and type:
#cd /etc/sysconfig/network-script/
#vi ifcfg-bond0
This is how my ifcfg-bond0 looks
DEVICE=bond0
IPADDR=192.168.1.211
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
IPV6INIT=no
BONDING_MODULE_OPTS=”miimon=100″
After that, proceed to edit both ifcfg-eth0 and ifcfg-eth1
#cd /etc/sysconfig/network-script/
#vi ifcfg-eth0
this is how my eth0 config looks:
DEVICE=eth0
ONBOOT=yes
BOOTPROTO=none
USERCTL=no
MASTER=bond0
TYPE=ethernet
SLAVE=yes
IPV6INIT=no
ETHTOOL_OPTS=”speed 100 duplex full autoneg off”
and the eth1..
DEVICE=eth1
ONBOOT=yes
BOOTPROTO=none
USERCTL=no
MASTER=bond0
TYPE=ethernet
SLAVE=yes
IPV6INIT=no
ETHTOOL_OPTS=”speed 100 duplex full autoneg off”
The next step is to add some line to /etc/modprobe file. On terminal type:
#vi /etc/modprobe
make sure this line exist on the modprobe file:
alias bond0 bonding
options bond0 miimon=100
options speed=100,100 duplex=2,2
Next, load all the necessary modules
#modprobe bonding
#modprobe mii
Then, restart the network service
#service network restart
Make sure the bond0 interface is up and has an IP, by typing:
#ifconfig
The output should be similar to this:
bond0 Link encap:Ethernet HWaddr 00:1E:0B:60:45:02
inet addr:172.16.2.31 Bcast:172.16.2.255 Mask:255.255.255.0
inet6 addr: fe80::200:ff:fe00:0/64 Scope:Link
UP BROADCAST RUNNING MASTER MULTICAST MTU:1500 Metric:1
RX packets:2257630 errors:0 dropped:0 overruns:0 frame:0
TX packets:2096727 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:514557469 (490.7 MiB) TX bytes:1021886305 (974.5 MiB)
eth0 Link encap:Ethernet HWaddr 00:1E:0B:60:45:02
inet6 addr: fe80::21e:bff:fe60:4502/64 Scope:Link
UP BROADCAST RUNNING SLAVE MULTICAST MTU:1500 Metric:1
RX packets:1175451 errors:0 dropped:0 overruns:0 frame:0
TX packets:1048363 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:268999481 (256.5 MiB) TX bytes:510954410 (487.2 MiB)
Interrupt:169 Memory:f6000000-f6012100
eth1 Link encap:Ethernet HWaddr 00:1E:0B:60:45:02
inet6 addr: fe80::21e:bff:fe60:4502/64 Scope:Link
UP BROADCAST RUNNING SLAVE MULTICAST MTU:1500 Metric:1
RX packets:1082179 errors:0 dropped:0 overruns:0 frame:0
TX packets:1048364 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:245557988 (234.1 MiB) TX bytes:510931895 (487.2 MiB)
Interrupt:169 Memory:fa000000-fa012100
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:11111287 errors:0 dropped:0 overruns:0 frame:0
TX packets:11111287 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:4187765593 (3.9 GiB) TX bytes:4187765593 (3.9 GiB)
NOTE : Problem in Configuring bond1
Creating and Destroying Bonds
-----------------------------
To add a new bond foo:
# echo +foo > /sys/class/net/bonding_masters
To remove an existing bond bar:
# echo -bar > /sys/class/net/bonding_masters
To show all existing bonds:
# cat /sys/class/net/bonding_masters
It turns out that in /sys/class/net/bonding_masters, you *need* to have bond1 listed. If not then a manual bond will fail (and of course so will an automatic bond).
So:
root@host# echo +bond1 > /sys/class/net/bonding_masters
root@host# ifconfig bond1 <IP> netmask <MASK>
root@host# ifenslave bond1 eth1