Course contentsShow
← Linux
Lesson 1110 of 1,81910. Network Administration and Kernel StacksFree lesson

Bonding Modes for High Availability

Select the appropriate link aggregation protocol based on switch capabilities.

In this lesson, you will learn how to choose the correct Linux bonding mode based on the configuration capabilities of your physical network switches.

When implementing High Availability (HA) for network interfaces, you aren’t just bundling cables; you are negotiating how the Linux kernel distributes traffic across those links. The "mode" you select dictates whether you need special switch cooperation or if the Linux host can handle the redundancy independently.

Mode 1: Active-Backup (mode=1)

This is the "fail-safe" baseline. In this mode, one interface is active while the other remains in standby. If the active link fails, the kernel triggers a failover to the backup.

  • Switch Requirements: None. This is transparent to the switch, as only one MAC address is seen on one port at a time. Use this when your switch is "dumb" or unmanaged.

Mode 6: Adaptive Load Balancing (mode=6)

If you want to achieve redundancy and increased throughput without switch configuration, mode=6 is the standard choice. It balances outgoing traffic based on current load and handles incoming traffic by intercepting ARP replies and rewriting the source MAC address to trick the switch into distributing incoming frames.

  • Switch Requirements: None. This is an excellent "plug-and-play" HA solution.

Mode 4: 802.3ad Link Aggregation (mode=4)

This is the industry standard for enterprise environments. It uses the LACP (Link Aggregation Control Protocol) to negotiate a single logical pipe.

  • Switch Requirements: Strict. You must configure the switch ports as an LACP EtherChannel or Port-Channel. If the switch isn't configured, the links will flap or fail entirely.

Choosing Your Strategy

To configure these, you modify your interface settings (typically in /etc/netplan/ or via ip link commands):

# Example snippet for setting Active-Backup
modprobe bonding mode=1 miimon=100
ip link add bond0 type bond mode active-backup
ip link set eth0 master bond0
ip link set eth1 master bond0

If you have full control over the data center switch, Mode 4 provides the most robust, standards-compliant load balancing. If you are in a virtualized or unmanaged environment where you cannot touch switch configs, Mode 1 offers the highest stability, while Mode 6 offers the best performance.

Key Takeaway: Always match your bonding mode to your switch's LACP capabilities; if the switch is unmanaged, use Mode 1 or Mode 6 to avoid network instability.