Linux network bonding

On this page 7

Linux network bonding is the kernel feature that combines two or more physical network interfaces into a single logical interface, usually named bond0, to provide link redundancy, load distribution or both. In Linux networking, the bonding driver presents one MAC address and one IP configuration to the system while it decides, frame by frame or flow by flow, which member interface carries the traffic.

Bonding is a core tool for servers, hypervisors and storage nodes that must survive a cable, port or switch failure without losing connectivity. It is configured with the ip command, NetworkManager, Netplan or systemd-networkd, and it often works together with a Linux bridge when virtual machines need the same resilient uplink.

How the bonding driver works

The bonding driver works as a virtual master device that enslaves physical interfaces, often called ports or slaves in older documentation. Outgoing packets enter the bond, and a transmit policy chooses the member interface; incoming packets arrive on any member and are delivered to the stack as if they came from the bond itself.

Failure detection relies on link monitoring. The MII monitor (miimon) polls the carrier state of each interface, typically every 100 milliseconds, while the ARP monitor sends ARP probes to one or more target addresses and marks an interface down when replies stop. ARP monitoring catches failures beyond the local switch port, but it adds traffic and requires reachable targets.

The following table lists the key bonding parameters and what each one controls.

ParameterTypical valueEffect
modeactive-backup or 802.3adSelects the bonding policy
miimon100 msInterval for carrier checks
updelay and downdelay0 to several thousand msWaits before using or dropping a link
xmit_hash_policylayer2, layer3+4 or encap3+4Chooses which header fields spread flows
lacp_rateslow (30 s) or fast (1 s)Sets how often LACP frames are exchanged
primaryName of the preferred interfaceChooses the active link in active-backup mode
Important bonding driver parameters

The seven bonding modes

Linux supports seven bonding modes, numbered 0 to 6, and the choice decides whether the bond offers failover only, aggregate throughput or both. Some modes need cooperating switches, while others work with any switch because they manipulate MAC addresses or ARP replies instead.

ModeNamePurposeSwitch requirement
0balance-rrRound-robin across all linksStatic link aggregation group
1active-backupOne active link, others on standbyNone
2balance-xorHash-based distributionStatic link aggregation group
3broadcastSends every frame on every linkSpecial designs only
4802.3adDynamic aggregation with LACPLACP-capable switch ports
5balance-tlbAdaptive transmit load balancingNone
6balance-albAdaptive transmit and receive balancingNone, but changes ARP behavior
Bonding modes and their requirements

In practice, active-backup and 802.3ad cover most deployments. Round-robin mode can raise single-stream throughput, but it frequently causes out-of-order TCP segments, which reduce real performance, so it is rarely recommended outside narrow lab cases.

Bonding is one of several ways to make Linux connectivity resilient, and it differs from neighbors in where the logic lives and what problem it solves. A Linux bridge forwards frames between interfaces, whereas a bond merges interfaces into one uplink; the two are often stacked, with the bond as the bridge port.

TechnologyMain goalKey difference
Bonding driverRedundancy and aggregationMature, broad mode support, configured through sysfs or netlink
Team driver (teamd)Redundancy and aggregationUser-space control daemon, now deprecated in RHEL 9
Linux bridgeLayer 2 switching between portsForwards frames instead of merging links
Equal-cost multipath routingLayer 3 load sharingWorks per route across different subnets
Multipath TCPPer-connection multi-link useRequires support at both endpoints
Bonding and neighboring technologies

Teaming once promised a more modular design, but Red Hat deprecated it, so new deployments should prefer bonding. Routing-based approaches suit data centers that run BGP to every host, while bonding remains the simplest answer for layer 2 uplinks.

Configuring a bond in practice

A bond is configured by creating the bond device, adding member interfaces and assigning the address to the bond, never to the members. With iproute2, the sequence is ip link add bond0 type bond mode 802.3ad, followed by setting each member down and running ip link set eth0 master bond0; persistent setups belong in NetworkManager, Netplan or systemd-networkd files.

The decision table below helps choose a mode for common situations.

SituationRecommended modeReason
Two unmanaged switchesactive-backupNeeds no switch support and survives a switch loss
Managed switch or MLAG pair802.3ad with layer3+4 hashingUses all links and detects misconfiguration through LACP
Hypervisor uplink with many guests802.3ad or balance-tlbMany flows spread evenly across links
Storage traffic with iSCSINo bond, use multipathingStorage multipath handles failover per path
Choosing a bonding mode

The bond state is visible in /proc/net/bonding/bond0, which shows the active member, link failure counts and LACP partner details. Checking this file after every change is the fastest way to confirm that the bond behaves as intended.

Common mistakes and failure modes

Most bonding problems come from a mismatch between host and switch configuration or from wrong expectations about bandwidth. The following points cover the errors that appear most often in production.

  • Expecting double speed for one transfer: hash-based modes keep each flow on one link, so a single TCP stream never exceeds one member’s speed.
  • Running 802.3ad without LACP on the switch: links come up but stay in separate aggregators, and traffic may drop or loop.
  • Using static modes 0 or 2 on unconfigured switches: MAC flapping and broadcast storms follow.
  • Skipping link monitoring: without miimon or ARP targets, the bond never notices a dead link.
  • Placing IP addresses on member interfaces: addresses must live on the bond, or routing behaves unpredictably.

Testing failover before production is essential. Unplugging each cable in turn while a continuous ping runs shows real convergence time, which is usually well under one second with miimon=100 in active-backup mode.

Stripped to the essentials

Network bonding lets a Linux computer use several network cables as if they were one. If one cable or port breaks, the others keep the connection alive, so nobody notices the fault.

Think of it like a road with several lanes. If one lane closes, cars move to the others, and on busy days more lanes carry more cars at once. The key takeaway is that bonding gives reliability first and extra capacity second.

Where it is applied

A small hosting company runs a virtualization cluster of six servers, each with two 25 Gb/s ports connected to a pair of switches that support multi-chassis link aggregation. The administrator builds bond0 in 802.3ad mode with layer3+4 hashing and places a Linux bridge on top, so every virtual machine shares the resilient uplink.

During a planned firmware upgrade, one switch reboots for about four minutes. All servers continue serving traffic on their remaining link, monitoring shows no dropped customer sessions, and the bonds rejoin both links automatically when the switch returns. On normal days, traffic from hundreds of virtual machines spreads across both ports, giving close to 50 Gb/s of aggregate capacity per host.