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.
| Parameter | Typical value | Effect |
|---|---|---|
| mode | active-backup or 802.3ad | Selects the bonding policy |
| miimon | 100 ms | Interval for carrier checks |
| updelay and downdelay | 0 to several thousand ms | Waits before using or dropping a link |
| xmit_hash_policy | layer2, layer3+4 or encap3+4 | Chooses which header fields spread flows |
| lacp_rate | slow (30 s) or fast (1 s) | Sets how often LACP frames are exchanged |
| primary | Name of the preferred interface | Chooses the active link in active-backup mode |
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.
| Mode | Name | Purpose | Switch requirement |
|---|---|---|---|
| 0 | balance-rr | Round-robin across all links | Static link aggregation group |
| 1 | active-backup | One active link, others on standby | None |
| 2 | balance-xor | Hash-based distribution | Static link aggregation group |
| 3 | broadcast | Sends every frame on every link | Special designs only |
| 4 | 802.3ad | Dynamic aggregation with LACP | LACP-capable switch ports |
| 5 | balance-tlb | Adaptive transmit load balancing | None |
| 6 | balance-alb | Adaptive transmit and receive balancing | None, but changes ARP behavior |
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 compared with related techniques
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.
| Technology | Main goal | Key difference |
|---|---|---|
| Bonding driver | Redundancy and aggregation | Mature, broad mode support, configured through sysfs or netlink |
| Team driver (teamd) | Redundancy and aggregation | User-space control daemon, now deprecated in RHEL 9 |
| Linux bridge | Layer 2 switching between ports | Forwards frames instead of merging links |
| Equal-cost multipath routing | Layer 3 load sharing | Works per route across different subnets |
| Multipath TCP | Per-connection multi-link use | Requires support at both endpoints |
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.
| Situation | Recommended mode | Reason |
|---|---|---|
| Two unmanaged switches | active-backup | Needs no switch support and survives a switch loss |
| Managed switch or MLAG pair | 802.3ad with layer3+4 hashing | Uses all links and detects misconfiguration through LACP |
| Hypervisor uplink with many guests | 802.3ad or balance-tlb | Many flows spread evenly across links |
| Storage traffic with iSCSI | No bond, use multipathing | Storage multipath handles failover per path |
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
miimonor 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.