How to Setup and Configure Network Bonding on RHEL 7

How to Setup and Configure Network Bonding on RHEL 7

In this tutorial I will show you, how to setup and configure Network Bonding on RHEL 7.

what and why we need Link aggregation ?

  • Link aggregation is a term used in corporate networks to combine the capabilities of two or more physical or virtual Ethernet network interfaces to function as a single logical network pipe.
  • The resultant aggregate offers three major advantages: better throughput, load balancing across all interfaces, and fault tolerance in the event all but one interface in the aggregate fail.
  • The most optimal way to do link aggregation, would be to use physical ports from different hardware devices (PCI NICs), cross-connected to two swithes that are also configured in some sort of a failover configuration. If done this way, the networking will stay up if either a switch, or PCI card fails.
  • RHEL7 supports two link aggregation methods that are referred to as bonding and teaming.

Interface Bonding

  • Interface bonding provides the ability to bind two or more network interfaces together into a single, logical bonded channel that acts as the master for all slave interfaces that are added to it.
  • An IP address is applied to the bond rather than to individual slaves within the bond.
  • Users and applications will see the bond device as the connection to use rather than the individual interfaces within it.
  • The support for bonding is integrated entirely into the kernel as a loadable module. This module is called bonding.
  • A bonded channel is configured to use one of several modes of operation that dictate its overall behavior:
    • Round-robin: This mode moves network traffic serially starting with the first slave and going to the last, and then back to the first. This mode supports both load balancing and fault tolerance. It is specified as balance-rr.
    • Active-backup: Only one slave is active at a time, and all others are available but in passive mode. In the event that the active slave fails, one of the passive slaves takes over and becomes active. This mode of operation does not provide load balancing; however, it does support fault tolerance. It is specified as active-backup.
    • XOR: This mode uses the source and destination Ethernet addresses to transfer network traffic. This mode provides both load balancing and fault tolerance. It is specified as balance-xor.
    • Broadcast: This mode transmits network traffic on all slaves. This mode provides fault tolerance only. It is specified as broadcast.

Steps to Configure Interface Bonding by Editing Files

Step1. Log on to server and run the ip a command to check the available interfaces.

Step2. Load the bonding driver called “bonding” in the kernel with the modprobecommand if it is not already loaded, and verify with the modinfo command:

Step3. Generate UUIDs for interfaces using the uuidgen command.

Step4. Use the vi editor to create a file called ifcfg-bond0 in the /etc/sysconfig/network-scripts directory for bond0 with the following settings. Use the interface type Bond. This virtual device will serve as the bonding master with round-robin as the load balancing technique.

Step5. Use the vi editor to create ifcfg-eth2 and ifcfg-eth3 files in the /etc/sysconfig/network-scripts directory for eth2 and eth3 interfaces with the following settings. Set the MASTER directive to bond0. Both interfaces will act as slaves with no IP addresses assigned to them.

Step6. Deactivate and reactivate bond0 with the ifdown and ifup commands:

Step7. Check the status of bond0 and the slaves with the ip command. It should also show the assigned IP.

Step8. Restart the system to ensure the configuration survives system reboots:

Enjoyed this video?
How to Setup and Configure Network Bonding on RHEL 7
"No Thanks. Please Close This Box!"