Linux Foundation Certified System Administrator (LFCS)

Networking

Configure Bridge and Bonding Devices Theory

In this lesson, we explore two essential networking techniques: bridging and bonding. Both approaches allow multiple network devices to be combined into a single virtual device managed by the operating system, yet they serve distinct purposes for network connectivity and performance.

Bridging connects two or more separate networks, enabling devices on different segments to communicate as though they were on the same network. In contrast, bonding aggregates multiple network connections into a single logical interface to enhance throughput, resiliency, or both.

The image illustrates the concepts of "Bridge" and "Bond" in networking, showing how network interfaces connect to networks and servers. The "Bridge" section connects two networks to multiple servers, while the "Bond" section connects a single network to multiple servers.

Below, we provide a detailed explanation of bridging and bonding, supported by diagrams that clarify these fundamental concepts.


Bridging Network Devices

When you bridge two or more network devices, a virtual bridge is created that interconnects them. This virtual bridge allows computers on different physical networks to communicate seamlessly, just as if they were on the same network.

Consider a server with two network interfaces (or network cards) connected via cables to different networks. By adding these interfaces to a bridge, devices on either network can interact without additional routing. In Linux, this virtual device is simply called a bridge, and each network interface attached to the bridge is known as a port.

The image is a diagram explaining a network bridge, showing how a server connects two separate networks (Network 1 and Network 2) through network interfaces.


Bonding Network Devices

Bonding combines multiple physical network devices into one logical interface. This configuration provides several benefits:

  1. Resilience: Maintains connectivity even if one network interface fails.
  2. Increased Throughput: Aggregates multiple network cards to achieve higher data transfer speeds.
  3. Enhanced Reliability: Offloads traffic to available interfaces if one experiences a slowdown.

Imagine a server with two network interfaces connected to the same network. Without bonding, Linux treats these interfaces as separate connections, and an application must select one. If that interface fails, connectivity is lost. With bonding, however, the system presents the two interfaces as a single virtual interface (or bond). Should one connection fail, Linux automatically switches to the other to ensure continuous connectivity.

The image explains a network bond, showing a server with two network interfaces connected to a network to increase throughput.

The image explains a network bond, showing two network interfaces connected to a network, with one interface marked as inactive and the other as active.

From an application's perspective, bonding simplifies configuration by representing multiple physical connections as a single network interface.


Bonding Modes in Linux

Linux supports several bonding modes (Mode 0 through Mode 6). Choosing the correct mode allows you to tailor your bond configuration for optimal performance, load balancing, and redundancy.

  • Mode 0 (Round Robin):
    Data packets are transmitted sequentially across the interfaces.
    The image illustrates a Linux bonding mode setup, specifically Mode 0 (Round-robin), showing a server connected to two network interfaces. It features the Linux mascot and is labeled "Bridge and Bond" by KodeKloud.

  • Mode 1 (Active Backup):
    Only one interface is active while the others act as backups that take over if the active connection fails.
    The image illustrates a network bonding mode (active-backup) with a Linux penguin mascot, showing a server connected to two network interfaces, where one is active and the other is a backup.

  • Mode 2 (XOR):
    Selects the interface based on the source and destination of the data packet, ensuring that identical connections use the same interface.

  • Mode 3 (Broadcast):
    Transmits data packets through all interfaces simultaneously.

    The image illustrates a Linux bonding mode setup, specifically Mode 2 (XOR), showing a server connected to two network interfaces.

  • Mode 4 (IEEE 802.3ad):
    Uses dynamic link aggregation to combine interfaces, improving throughput.

    The image shows a diagram of network bonding modes, specifically Mode 4 (IEEE 802.3ad), with a Linux penguin mascot and icons representing a server and two network interfaces.

  • Mode 5 (Adaptive Transmit Load Balancing):
    Distributes outgoing traffic by selecting the least busy interface.

    The image illustrates a network bonding mode (Mode 5: Adaptive Transmit Load Balancing) with a Linux penguin mascot, showing a server connected to two network interfaces.

  • Mode 6 (Adaptive Load Balancing):
    Balances both incoming and outgoing traffic across the bonded interfaces.

    The image illustrates network bonding modes, specifically Mode 6 (Adaptive Load Balancing), with a Linux penguin mascot and icons representing a server and network interfaces.

Selecting the appropriate bonding mode depends on your network's needs, as each mode balances the tradeoffs between performance, redundancy, and load balancing.

Key Insight

For network deployments, understanding your objectives—whether maximizing throughput or ensuring constant connectivity—will guide your choice between bridging and bonding as well as the specific bonding mode to implement.


Bridging versus Bonding

In summary, bridging and bonding offer different network solutions:

  • Bridging: Connects two or more separate networks to enable seamless communication among devices as if they were on the same network.
  • Bonding: Aggregates multiple network connections into a single logical interface to improve overall performance and reliability.

The image compares "Bridge" and "Bond" network configurations, illustrating how a bridge connects two or more networks, while a bond provides two or more connections to a single network.

These strategies are fundamental tools for network administrators. By implementing bridging and bonding appropriately, you can design networks that are robust, efficient, and adaptable to various operational requirements.

Talented network administrators continually explore these techniques to build resilient and high-performance network infrastructures.


Additional Resources

Watch Video

Watch video content

Previous
Start Stop and Check Status of Network Services