In this lesson, you will learn how to combine multiple physical network interfaces into a single logical "bonded" interface to provide high availability and increased bandwidth.
Why Use Bonding?
In mission-critical environments, a single Ethernet cable or network port is a potential point of failure. Network Interface Bonding (also known as Link Aggregation or NIC Teaming) allows you to group two or more physical network interface cards (NICs) into one virtual interface (usually named bond0). If one physical cable is unplugged or a switch port fails, the traffic seamlessly shifts to the remaining healthy interfaces without dropping your connection.
Core Bonding Modes
Linux supports several bonding modes, but two are most common for production:
- Mode 1 (Active-Backup): Only one slave interface is active at a time. If the active interface fails, another takes over. This is the simplest way to provide redundancy.
- Mode 4 (802.3ad / LACP): This creates aggregation groups that share the same speed and duplex settings. It requires your physical network switch to support 802.3ad, but it allows for simultaneous load balancing and fault tolerance across all bundled links.
How it Works
When you configure a bond, you are essentially telling the kernel to treat multiple devices as a single unit. You define the behavior via the bonding kernel module. Here is a simplified example of how you might define a bond in a configuration file:
# Example configuration for a bond0 interface
DEVICE=bond0
BONDING_OPTS="mode=1 miimon=100 fail_over_mac=1"
BOOTPROTO=none
ONBOOT=yes
In this snippet, miimon=100 tells the kernel to check the link state of the interfaces every 100 milliseconds. If the link goes down, the kernel logic immediately reroutes traffic to the backup member of the bond.
By abstracting the physical hardware away from the IP stack, you gain a resilient network layer that survives hardware malfunctions while maintaining a constant, unified address for your services.
Key Takeaway: Network Interface Bonding increases system reliability and throughput by aggregating multiple physical links into a single logical interface that persists even if individual hardware components fail.