GenerationIP

Just for you

  • Increase font size
  • Default font size
  • Decrease font size
Home Documentation System Documentation Bonding or Teaming for redhat Server

Bonding or Teaming for redhat Server

E-mail Print PDF
User Rating: / 16
PoorBest 

Type : System
Operating System
: Redhat,Fedora,Centos

This Howto explain how to install the Bonding or the Teaming solution on a RedHat distribution. One of the goal of the teaming and bonding solution is to use all networks interfaces for backup or round robin solution.

The bonding need to work with a minimum of 2 NIC to have real goal.

The concept of NIC Bonding (or sometimes called NIC Teaming) is that you have two NICs bonded together to create only one physical device.

 

Bonding schema and switch topology :

 


|                                            |
|port3                                  port3|
+-----+----+                                 +-----+-----+
|          |port2                      port2 |           |
| switch A +---------------------------------+ switch B  |
|          |                                 |           |
+-----+----+                                 +-----+-----+
|port1                                  port1|
|                 +-------+                  |
+-----------------+ host1 +------------------+
eth0 +-------+ eth1

 

Before attempting to bond two NICs, i recommended to verify the integrity and functionality of each NIC. Please check your interface status with ethtool:

#ethtool eth0
Settings for eth0:
Supported ports: [ TP MII ]
Supported link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
Supports auto-negotiation: Yes
Advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
Advertised auto-negotiation: Yes
Speed: 100Mb/s
Duplex: Full
Port: MII
PHYAD: 1
Transceiver: internal
Auto-negotiation: on
Supports Wake-on: g
Wake-on: g
Current message level: 0x00000007 (7)
Link detected: yes

#ethtool eth1
Settings for eth1:
Supported ports: [ TP MII ]
Supported link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
Supports auto-negotiation: Yes
Advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
Advertised auto-negotiation: Yes
Speed: 100Mb/s
Duplex: Full
Port: MII
PHYAD: 1
Transceiver: internal
Auto-negotiation: on
Supports Wake-on: g
Wake-on: g
Current message level: 0x00000007 (7)
Link detected: yes

Now the Interface seems to be good for the configuration, we have to ckeck if you have all kernel modules.

#modprobe --list | grep bonding

/lib/modules/2.6.*/kernel/drivers/net/bonding/bonding.ko

#modprobe --list | grep mii

/lib/modules/2.6.*/kernel/drivers/net/mii.ko

Your server seems to be ready fot the configuration of the module for a backup connection:

#vi /etc/modprobe.conf

alias bond0 bonding
options bond0 miimon=80 mode=1

To have more information about the bonding module you have to do this command line.

In bold font you have the main status for the bonding function.

#modinfo bonding
author: Thomas Davis, This e-mail address is being protected from spambots. You need JavaScript enabled to view it and many others
description: Ethernet Channel Bonding Driver, v3.1.2
version: 3.1.2
license: GPL
srcversion: 6CD19765D6431C07199456E
depends:
vermagic: 2.6.18-53.1.4.el5xen SMP mod_unload gcc-4.1
parm: max_bonds:Max number of bonded devices (int)
parm: miimon:Link check interval in milliseconds (int)
parm: updelay:Delay before considering link up, in milliseconds (int)
parm: downdelay:Delay before considering link down, in milliseconds (int)
parm: use_carrier:Use netif_carrier_ok (vs MII ioctls) in miimon; 0 for off, 1 for on (default) (int)
parm: mode:Mode of operation : 0 for balance-rr, 1 for active-backup, 2 for balance-xor, 3 for broadcast, 4 for 802.3ad, 5 for balance-tlb, 6 for balance-alb (charp)
parm: primary:Primary network device to use (charp)
parm: lacp_rate:LACPDU tx rate to request from 802.3ad partner (slow/fast) (charp)
parm: xmit_hash_policy:XOR hashing method: 0 for layer 2 (default), 1 for layer 3+4 (charp)
parm: arp_interval:arp interval in milliseconds (int)
parm: arp_ip_target:arp targets in n.n.n.n form (array of charp)
parm: arp_validate:validate src/dst of ARP probes: none (default), active, backup or all (charp)
module_sig: 883f350474fb1b5bf23bf4d191725311298f009e2cbe4ce27b13fd747fc988615153453d50a29aff0a08158d98a7570129eb3197be02aebeaf52d9aebe

miimon is use for the monitoring of each ethX each 80 milliseconds, but you can use also a arp_ip_target like this other configuration for this module.

#vi /etc/modprobe.conf

alias bond0 bonding
options bond0 mode=1 arp_ip_target=192.168.1.1 arp_interval=200 primary=eth0

This configuration use arp resquest on the primary interface each 200ms

Now the kernel module is configure and we have to load thoses modules :

#modprobe bonding

#modprobe mii

All modules are loaded and ready for the configuration of each NIC

Configuration of eth0:

#vi /etc/sysconfig/network-script/ifcfg-eth0

DEVICE=eth0
BOOTPROTO=none
ONBOOT=yes
MASTER=bond0
SLAVE=yes
USERCTL=no

Configuration of eth1

#vi /etc/sysconfig/network-script/ifcfg-eth1

DEVICE=eth1
BOOTPROTO=none
ONBOOT=yes
MASTER=bond0
SLAVE=yes
USERCTL=no

Configuration of bond0

#vi /etc/sysconfig/network-script/ifcfg-bond0

DEVICE=bond0
BOOTPROTO=none
ONBOOT=yes
NETMASK=255.255.255.0
IPADDR=192.168.1.5
USERCTL=no

Now to finish the installation we have to applied the network parameters.

#/etc/init.d/network restart

Your bonding is now operational.

We have to test the bonding interface :

# cat /proc/net/bonding/bond0

Ethernet Channel Bonding Driver: v3.1.2 (January 20, 2007)

Bonding Mode: fault-tolerance (active-backup)
Primary Slave: None
Currently Active Slave: eth0
MII Status: up
MII Polling Interval (ms): 80
Up Delay (ms): 0
Down Delay (ms): 0

Slave Interface: eth0
MII Status: up
Link Failure Count: 0
Permanent HW addr: 00:XX:XX:XX:XX:c2

Slave Interface: eth1
MII Status: up
Link Failure Count: 0
Permanent HW addr: 00:XX:XX:XX:XX:c4

RELATED ARTICLES

Howto create promisc or promiscuous interface on redhat, fedora, centos

Advanced Configuration for bonding and teaming with vlans


 

Last Updated on Saturday, 30 January 2010 22:44  

Share this article:

Add to: Mr. Wong Add to: Webnews Add to: Icio Add to: Oneview Add to: Kledy.de Social Bookmarking Add to:  FAV!T Social Bookmarking Add to: Favoriten.de Add to: Seekxl Add to: Social Bookmark Portal Add to: BoniTrust Add to: Power-Oldie Add to: Bookmarks.cc Add to: Newskick Add to: Newsider Add to: Linksilo Add to: Readster Add to: Yigg Add to: Linkarena Add to: Digg Add to: Del.icoi.us Add to: Reddit Add to: Jumptags Add to: Upchuckr Add to: Simpy Add to: StumbleUpon Add to: Slashdot Add to: Netscape Add to: Furl Add to: Yahoo Add to: Blogmarks Add to: Diigo Add to: Technorati Add to: Newsvine Add to: Blinkbits Add to: Ma.Gnolia Add to: Smarking Add to: Netvouz Add to: Folkd Add to: Spurl Add to: Google Add to: Blinklist Information

Newsflash

New Mac IPAD and hardware specification

The IPAD is now revelate by apple. It looks simple, powerful, cool, green and mobile.

SPEC :

9.7-inch 1,024 by 768-pixel
1 GHz A4 CPU from Apple
SSD 16, 32, or 64 GB
Bluetooth 2.1 and 802.11a/b/gn Wi-Fi
The 3G iPads will use GSM micro SIMs
speaker and microphone, integrated compass, and accelerometer
10 hours of battery