NIC Bonding/Teaming in RHEL6


NIC [network interface card] bonding is a term used to describe a way to increase available bandwidth. 

Bonding is nothing but Linux kernel feature[aka BONDING] that allows to aggregate multiple like interfaces (such as eth0, eth1, eth2 etc) into a single virtual link.

This is done to get higher data rates and as well as link failover. NIC bonding may also be called as NIC Teaming.

Here we will create a bond called bond0, number of ether-net's used are two [eth0 and eth1].

Step 1:
  • Create a bond0 file==> # vim /etc/sysconfig/network-scripts/ifcfg-bond0
  • Append the file with below information and save the file==>
DEVICE=bond0
IPADDR=192.168.57.150
NETMASK=255.255.255.0
USERCTL=no
BOOTPROTO=none
ONBOOT=yes
Note: IP and Netmask needs to be replaced as per your network configuration.

Step 2: 
  • Edit ifcfg-eth0 ==> # vim /etc/sysconfig/network-scripts/ifcfg-eth0 
  • Append the details as follows ==> 
DEVICE=eth0
ONBOOT=yes
USERCTL=no
MASTER=bond0
SLAVE=yes
BOOTPROTO=none

Step 3:
  • Edit ifcfg-eth1 ==> # vim /etc/sysconfig/network-scripts/ifcfg-eth1
  • Append the details as follows ==> 
DEVICE=eth1
ONBOOT=yes
USERCTL=no
MASTER=bond0
SLAVE=yes
BOOTPROTO=none

Step 4: 
  • Load bond driver module.
  • Edit/Create a file as bonding.conf ==> # vim /etc/modprobe.d/bonding.conf 
  • Append the following information ==> 
alias bond0 bonding
options bond0 mode=balance-rr miimon=100
  • For more information about the modes, Click Here and open the first link.
  • Default is balance-rr aka round robin.
Step 5: 
  • Load the bonding module ==> # modprobe bonding
  • Restart the service ==> # service network restart
Step 6:
  • Check the output of ifconfig ==> # ifconfig 
  • Output is as follows ==>
bond0     Link encap:Ethernet  HWaddr 00:0C:29:C2:98:96  
          inet addr:192.168.57.150  Bcast:192.168.57.255  Mask:255.255.255.0
          inet6 addr: fe80::20c:29ff:fec2:9896/64 Scope:Link
          UP BROADCAST RUNNING MASTER MULTICAST  MTU:1500  Metric:1
          RX packets:2473 errors:0 dropped:0 overruns:0 frame:0
          TX packets:14065 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:232980 (227.5 KiB)  TX bytes:850812 (830.8 KiB)

eth0      Link encap:Ethernet  HWaddr 00:0C:29:C2:98:96  
          inet addr:192.168.57.150  Bcast:192.168.57.255  Mask:255.255.255.0
          UP BROADCAST RUNNING SLAVE MULTICAST  MTU:1500  Metric:1
          RX packets:1237 errors:0 dropped:0 overruns:0 frame:0
          TX packets:7035 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:117922 (115.1 KiB)  TX bytes:424290 (414.3 KiB)

eth1      Link encap:Ethernet  HWaddr 00:0C:29:C2:98:A0  
          inet addr:192.168.57.150  Bcast:192.168.57.255  Mask:255.255.255.0
          UP BROADCAST RUNNING SLAVE MULTICAST  MTU:1500  Metric:1
          RX packets:1236 errors:0 dropped:0 overruns:0 frame:0
          TX packets:7030 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:115058 (112.3 KiB)  TX bytes:426522 (416.5 KiB)

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:16 errors:0 dropped:0 overruns:0 frame:0
          TX packets:16 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:960 (960.0 b)  TX bytes:960 (960.0 b)

Point to note is bond0 will show "UP BROADCAST RUNNING MASTER MULTICAST".
eth0 and eth1 will show SLAVE instead of MASTER i.e. "UP BROADCAST RUNNING SLAVE MULTICAST".

Note: # cat /proc/net/bonding/bond0  will show information/current status about bond0, eth0 and eth1.

Comments

Popular posts from this blog

Installing Tomcat8 on RHEL6

Manage existing resources via Helm

Configuration and setting-up of AIDE on RHEL6