2012年5月16日 星期三

NIC Bonding on RHEL 6

0. Stop the Network Manager 

If you have install Network Manager package.
Please stop it first.

# chkconfig NetworkManager off
# /etc/init.d/NetworkManager stop

1. Create bonding.conf


# vim /etc/modprobe.d/bonding.conf
alias bond0 bonding

2. Create 3 file under /etc/sysconfig/network-scripts/

===File: ifcfg-eth0===
DEVICE=eth0
BOOTPROTO=none
ONBOOT=yes
MASTER=bond0
SLAVE=yes
USERCTL=no

===File: ifcfg-eth1===
DEVICE=eth1
BOOTPROTO=none
ONBOOT=yes
MASTER=bond0
SLAVE=yes
USERCTL=no

===File: ifcfg-bond0===
DEVICE=bond0
IPADDR=192.168.0.126
NETMASK=255.255.255.0
ONBOOT=yes
BOOTPROTO=none
USERCTL=no
BONDING_OPTS="miimon=1000 mode=active-backup"

3. Make sure you specify all required parameters

It is essential that both arp_interval and arp_ip_target parameters are specified, or, alternatively, the miimon parameter is specified. Failure to do so can cause degradation of network performance in the event that a link fails.

* arp_interval
 If using this setting while in mode 0 or 2 (the two load-balancing modes), the network switch must be configured to distribute packets evenly across the NICs. For more information on how to accomplish this, refer to  /usr/share/doc/kernel-doc-/Documentation/networking/ bonding.txt

* arp_ip_target
 Specifies the target IP address of ARP requests when the arp_interval parameter is enabled. Up to 16 IP addresses can be specified in a comma separated list

4. Mode Value

mode= 
Allows you to specify the bonding policy. The can be one of:

*balance-rr or 0
 Sets a round-robin policy for fault tolerance and load balancing. Transmissions are received and sent out sequentially on each bonded slave interface beginning with the first one available.

*active-backup or 1
 Sets an active-backup policy for fault tolerance. Transmissions are received and sent out via the first available bonded slave interface. Another bonded slave interface is only used if the active bonded slave interface fails.

*balance-xor or 2
Sets an XOR (exclusive-or) policy for fault tolerance and load balancing. Using this method, the interface matches up the incoming request's MAC address with the MAC address for one of the slave NICs. Once this link is established, transmissions are sent out sequentially beginning with the first available interface.

*broadcast or 3
Sets a broadcast policy for fault tolerance. All transmissions are sent on all slave interfaces.

*802.3ad or 4
Sets an IEEE 802.3ad dynamic link aggregation policy. Creates aggregation groups that share the same speed and duplex settings. Transmits and receives on all slaves in the active aggregator. Requires a switch that is 802.3ad compliant.

*balance-tlb or 5
Sets a Transmit Load Balancing (TLB) policy for fault tolerance and load balancing. The outgoing traffic is distributed according to the current load on each slave interface. Incoming traffic is received by the current slave. If the receiving slave fails, another slave takes over the MAC address of the failed slave.

*balance-alb or 6
Sets an Active Load Balancing (ALB) policy for fault tolerance and load balancing. Includes transmit and receive load balancing for IPV4 traffic. Receive load balancing is achieved through ARP negotiation.

reference : RHEL 6 : 24.7.2. Using Channel Bonding

沒有留言: