Welcome to my site. Please CLICK HERE to give your opinions regarding this new look of "PCTipsbyAnu". Thanks for visiting.

Sunday, September 12, 2010

Browse » Home » , , , , , » How to bond multiple ETH in LINUX?

How to bond multiple ETH in LINUX?


Tonight, while i use my RHEL-9 and Fedora Core (newly downloaded) via VM-Player, i feel that my network speed is very-very slow. So i think that Whats the reason behind this? n How to gain my previous speed (increase the speed)?
After some time, i finally decided that i must implement bonding technique on my RHEL-9.
Bonding is creation of single bonded interface by combining 2 or more ethernetinterfaces. This helps in high availability and performance improvement.

Steps for bonding in Fedora Core and Redhat Linux

Step 1

Create the file ifcfg-bond0 with the IP address, netmask and gateway. 
Shown below is my test bonding config file.

$ cat /etc/sysconfig/network-scripts/ifcfg-bond0
DEVICE=bond0
IPADDR=192.168.10.100
NETMASK=255. 255.255.0
GATEWAY=192.168.10.1
USERCTL=no
BOOTPROTO=none
ONBOOT=yes
Step 2

Modifyeth0, eth1 and eth2 configuration as shown below. Comment out, orremove the ip address, netmask, gateway and hardware address from eachone of these files, since settings should only come from theifcfg-bond0 file above.

$ cat /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
BOOTPROTO=none
ONBOOT=yes
MASTER=bond0
SLAVE=yes
$ cat /etc/sysconfig/network-scripts/ifcfg-eth1
DEVICE=eth1
BOOTPROTO=none
ONBOOT=yes
USERCTL=no
MASTER=bond0
SLAVE=yes
$ cat /etc/sysconfig/network-scripts/ifcfg-eth2
DEVICE=eth2
BOOTPROTO=none
ONBOOT=yes
MASTER=bond0
SLAVE=yes

 
Step 3
Set the parameters for bond0 bonding kernel module. Add the following lines to /etc/modprobe. conf
# bonding commands
alias bond0 bonding
options bond0 mode=balance-alb miimon=100

Note:
Here we configured the bonding mode as "balance-alb". All the availablemodes are given at the end and you should choose appropriate modespecific to your requirement.

 
Step 4
Load the bond driver module from the command prompt.
$ modprobe bonding


Step 5
Restart the network, or restart the computer.
$ service network restart
OR restart the computer 

When the machine boots up check the proc settings.
$ cat /proc/net/bonding/bond0
Ethernet Channel Bonding Driver: v3.0.2 (March 23, 2006)

Bonding Mode: adaptive load balancing
Primary Slave: None
Currently Active Slave: eth2
MII Status: up
MII Polling Interval (ms): 100
Up Delay (ms): 0
Down Delay (ms): 0

Slave Interface: eth2
MII Status: up
Link Failure Count: 0
Permanent HW addr: 00:13:72:80: 62:f0
Look at ifconfig -a and check that your bond0 interface is active. You are done!

RHELbonding supports 7 possible "modes" for bonded interfaces. These modesdetermine the way in which traffic sent out of the bonded interface isactually dispersed over the real interfaces. Modes 0, 1, and 2 are byfar the most commonly used among them. 
Mode 0 (balance-rr)
This mode transmits packets in a sequential order from the firstavailable slave through the last. If two real interfaces are slaves inthe bond and two packets arrive destined out of the bonded interfacethe first will be transmitted on the first slave and the second framewill be transmitted on the second slave. The third packet will be senton the first and so on. This provides load balancing and faulttolerance.
 
Mode 1 (active-backup)
This mode places oneof the interfaces into a backup state and will only make it active ifthe link is lost by the active interface. Only one slave in the bond isactive at an instance of time. A different slave becomes active onlywhen the active slave fails. This mode provides fault tolerance.

Mode 2 (balance-xor)
Transmits based on XOR formula. (Source MAC address is XOR'd withdestination MAC address) modula slave count. This selects the sameslave for each destination MAC address and provides load balancing andfault tolerance.

Mode 3 (broadcast)
This modetransmits everything on all slave interfaces. This mode is least used(only for specific purpose) and provides only fault tolerance.

Mode 4 (802.3ad)
This mode is known as Dynamic Link Aggregation mode. It createsaggregation groups that share the same speed and duplex settings. Thismode requires a switch that supports IEEE 802.3ad Dynamic link.

Mode 5 (balance-tlb)
This is called as Adaptive transmit load balancing. The outgoingtraffic is distributed according to the current load and queue on eachslave interface. Incoming traffic is received by the current slave.

Mode 6 (balance-alb)
This is Adaptive load balancing mode. This includes balance-tlb +receive load balancing (rlb) for IPV4 traffic. The receive loadbalancing is achieved by ARP negotiation. The bonding driver interceptsthe ARP Replies sent by the server on their way out and overwrites thesrc hw address with the unique hw address of one of the slaves in thebond such that different clients use different hw addresses for theserver.
You can leave a response, or trackback from your own site.

About 'Anu': My name is 'Anu' also Known as 'ANU 007 TIGER' .I'm administrator of 'PC Tips by Anu' blog .This blog was opened for sharing contents about hacking n cracking.
Thanks YAHOO OR GMAIL

0 comments:

Post a Comment

 
Back to Top