How to Create NIC Teaming or Bonding in CentOS 6 or RHEL 6

by Jay

NIC teaming and bonding are techniques used to combine multiple network interface controllers (NICs) into a single logical interface in order to provide increased network bandwidth, redundancy, and/or load balancing.

NIC teaming, also known as NIC aggregation or link aggregation, involves combining two or more physical NICs into a single logical interface, typically through the use of specialized software or hardware. This allows the network traffic to be distributed across multiple NICs, which can help to increase network bandwidth, improve network reliability and provide redundancy in case of a NIC failure.

NIC Teaming

Bonding, on the other hand, involves creating a virtual network interface by aggregating two or more NICs at the data link layer. Unlike NIC teaming, bonding is typically implemented at the operating system level and doesn’t require any specialized hardware. Bonding can be used for load balancing and fault tolerance, and it supports a variety of bonding modes such as round-robin, active-backup, and adaptive load balancing.

Both NIC teaming and bonding are useful techniques for improving network performance, reliability, and availability. However, they require careful planning and configuration in order to ensure that they are set up correctly and functioning as intended.

Bonding or Teaming or Bridging:

The collection of multiple NIC cards and making them as single connection (virtual) NIC cards is called bonding. It is nothing but backup of NIC cards.

In RHEL – 6 it is called as Bonding or Bridging.

In RHEL – 7, 8, 9 it is called as Teaming or Link aggregation.

There are 3 types of backup in Bonding or Teaming.

(a) Mode 0 —–> Round Robbin

(b) Mode 1 —–> Active Backup

(c) Mode 3 —–> Broadcasting

Mode 0:

  • It provides load balancing and fault tolerance.
  • Data will be shared by both NIC cards in round robbin.
  • If one NIC card failed then another NIC card will be activated to communicate with the server
  • So, there is a load balancing and fault tolerance features.

Mode 1:

  • Activebackup means only one NIC card is activated at a time and another one is in down state.
  • So, there is no load balancing.
  • But if one NIC card is failed then another NIC card will be activated automatically.

Mode 3:

  • In this mode broadcasting is done.
  • In this the same data will be transferred through two NIC cards.
  • So there is no load balancing.
  • But if one NIC card is failed then second NIC card will be activated automatically.

So, all the 3 modes are supports only fault tolerance, but round robbin is the only one mode that provides load balancing.

Requirements to configure:

(i) Minimum two NIC cards.

(ii) One IP address.

(iii)Connection type is bond (in RHEL – 6) and team (in RHEL – 7) not the ethernet type.

Here no need to assign the IP addresses for two NIC cards and we are giving only one IP address to bond or team.

Bonding configuration: (in RHEL – 6)

(i)

# vim /etc/sysconfig/network-scripts/ifcfg-bond0

      DEVICE=bond0
      IP ADDR=<IP address> 
      TYPE=ethernet
      NETMASK=255.225.225.0 or <IP address class netmask> 
      ONBOOT=yes
      BOOTPROTO=none 
      USERCTL=no 
      MASTER=yes
      BONDING_OPTS="mode0 or mode1 or mode3 miimon=50"

(Save and exit this file)

(ii)

vim /etc/sysconfig/network-scripts/ifcfg-eth1

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

(Save and exit this file)

(iii)

vim /etc/sysconfig/network-scripts/ifcfg-eth2

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

(Save and exit this file)

(iv) To add virtual NIC cards eth1 and eth2:

# setup —–> Networking —–> Device configuration —–> New Device —–> eth1

Name : eth1

Device : eth1 (save and exit this setup)

# setup —–> Networking —–> Device configuration —–> New Device —–> eth2

Name : eth2

Device : eth2 (save and exit this setup)

(v)  Adding bond0 connection:

# setup —–> Networking —–> Device configuration —–> New Device —–> bond0

Name : bond0

Device : bond0

IP address : <IP address> Netmask : 255.255.255.0

Default gateway : <gateway IP address> (save and exit this setup)

# ifdown bond0
# ifdown eth1
# ifdown eth2
# ifup bond0
# service NetworkManager stop
# service network restart
# chkconfig network on
# service NetworkManager restart

To check the bonding information

# cat /proc/net/bonding/bond0 

To check the bonding information for every 1 minute

# watch -n 1 cat /proc/net/bonding/bond0 

To put the eth1 NIC in active state

# echo "eth1" > /sys/devices/virtual/net/bond0/bonding/active_slave

What is the difference between TCP and UDP protocol?

TCP is a connection oriented protocol and contain the information of sender as well as receiver.

Example: HTTP, FTP, Telnet

  • TCP is slower than UDP due to its error checking mechanism
  • UDP protocols are connection less packets have no information to where they are going. These type of ports are generally used for broadcasting.

For example: DNS, DHCP

  • UDP are faster

    Was this article of use to you? Post your insightful thoughts or recommendations in the comments section if you don’t find this article to be helpful or if you see any outdated information, a problem, or a typo to help this article better.

Related Posts

Leave a Comment

* By using this form you agree with the storage and handling of your data by this website.