Skip to main content

LFCS Certification Course

Chapter #34: Configure Bonding and Bridge Devices

In this chapter, learn how to configure network bonding and bridge devices on Ubuntu for redundancy, load balancing, and failover.

Network Bonding combines multiple LAN or Ethernet interfaces into a single logical interface known as a network bond.

The goal of network bonding is to provide fault tolerance and network redundancy. It also enhances capacity and improves network throughput depending on the type of bond created.

Network Bridging involves the creation of a logical interface known as a bridge between two interfaces. This allows traffic to pass through them and is especially helpful in sharing an internet connection between your system and others.

In this lesson, we will first look at Network Bonding and how you can configure a network bond. Later, we will shift our attention to Network Bridging.

Network Bonding

Also referred to as link aggregation, Network Interface Card (NIC) bonding, or simply network bonding, is the joining together of two physical network interfaces into a single logical interface.

This is done for redundancy and failover. In case one interface develops a problem or goes down, the remaining interface will still provide the connection required.

Types of Network Bonds

There are 7 types of network bonds, each denoted using a mode number, i.e., mode=0, mode=1 all the way to mode=6.

  • mode=0 (Round Robin Policy): This is the default mode and is based on the Round-robin policy. Data packets are transmitted in sequential order from the first available slave interface to the last. This mode provides load balancing and fault tolerance.
  • mode=1 (Active-backup): This is based on the Active-backup policy. As the name infers, only one slave is active. The other one is activated when the current slave fails. The mode provides fault tolerance and redundancy.
  • mode=2 (Balance-XOR): The mode sets an Exclusive OR (XOR) of the source address with the destination MAC address.
  • mode=3 (Broadcast): In this policy, all packets are transmitted on all slave interfaces.
  • mode=4 (802.3ad): This is also referred to as the Dynamic Link Aggregation mode. It creates aggregation groups with the same speed. Works on network switches that support the IEEE 802.3ad dynamic link standard.
  • mode=5 (Balance-tlb): This is also known as Adaptive Transmit Load Balancing. Here, outgoing traffic is transmitted based on the current load on each slave interface, while incoming traffic is received by the current active slave.
  • mode=6 (Balance-alb): This is also known as Adaptive Load Balancing. Load balancing is done using ARP (Address Resolution Protocol) negotiation.

Configuring Network Bonding on Ubuntu

Having looked at the network bond types, let’s now switch gears and explore how to configure a network bond on Ubuntu.

1. Ensure the Bonding Module is Installed

Before anything else, the first step is to ensure that the β€˜bonding’ module is installed and loaded. In most cases, the module comes pre-installed in modern Linux distributions but may not be loaded.

To check if the module is loaded, use the lsmod command:

lsmod | grep bond

If the module is not loaded, the output will be blank. To load the module, run the modprobe command:

sudo modprobe bonding

Once again, confirm that the module is loaded:

lsmod | grep bond

This time around, some output will be printed on your terminal confirming that the module has been loaded.

Check Bonding Module in Ubuntu

If the module is not installed, install it using the command:

sudo apt install ifenslave -y

2. Configure a Temporary Network Bonding Interface