Bonding Interfaces

Network interface bonding (also called teaming or link aggregation) combines two or more physical NICs into a single logical interface. The goals are either redundancy (failover if one NIC fails) or load balancing (use both NICs simultaneously). The correct bonding mode depends on whether your switch supports LACP — getting this wrong results in the interface appearing to work but failing silently under certain conditions.

Why bond network interfaces?

  • Redundancy: If one NIC or cable fails, traffic continues on the other
  • Load balancing: Distribute traffic across multiple NICs for higher total throughput
  • Bandwidth aggregation: Two 1Gbps NICs can provide up to 2Gbps combined

Bonding modes explained

ModeNameSwitch supportDescription
0balance-rrStandard (not recommended)Round-robin: alternates between NICs. Can cause out-of-order packets.
1active-backupAny switchOne NIC active, other standby. Fails over if active NIC loses link. Simplest, most reliable.
2balance-xorStandardXOR-based load distribution. Same NIC for each destination.
4802.3ad (LACP)REQUIRES LACP on switchLink Aggregation Control Protocol. Best performance + redundancy. Needs switch config.
5balance-tlbAny switchAdaptive transmit load balancing. Outbound distributed, inbound on one NIC.
6balance-albAny switchAdaptive load balancing. Both inbound and outbound distributed. No switch support needed.

📝 NOTE: For servers in production: use active-backup for simple redundancy without switch config changes. Use 802.3ad (LACP) for maximum performance when your switch administrator can configure a LAG/port-channel. Never use balance-rr (mode 0) without switch-side configuration — it causes out-of-order packets that break TCP sessions.

Configuring a bond in Netplan

sudo nano /etc/netplan/00-bond.yaml

active-backup bond configuration

network:
  version: 2
  ethernets:
    ens3:
      dhcp4: false
    ens4:
      dhcp4: false
  bonds:
    bond0:
      interfaces: [ens3, ens4]
      dhcp4: false
      addresses: [192.168.1.10/24]
      routes:
        - to: default
          via: 192.168.1.1
      nameservers:
        addresses: [8.8.8.8, 1.1.1.1]
      parameters:
        mode: active-backup
        primary: ens3           # Preferred active NIC
        mii-monitor-interval: 100  # Check link every 100ms

LACP (802.3ad) bond configuration

    bond0:
      interfaces: [ens3, ens4]
      parameters:
        mode: 802.3ad
        lacp-rate: fast         # fast=every 1s, slow=every 30s
        mii-monitor-interval: 100
        transmit-hash-policy: layer3+4   # Hash by IP+port for better distribution
sudo netplan try    # Test before applying
sudo netplan apply

Verifying bond status

# Check bond status
cat /proc/net/bonding/bond0

Healthy active-backup bond

Bonding Mode: fault-tolerance (active-backup)
Primary Slave: ens3 (primary_reselect failure)
Currently Active Slave: ens3
MII Status: up
MII Polling Interval (ms): 100

Slave Interface: ens3
MII Status: up
Link Failure Count: 0
Permanent HW addr: 52:54:00:12:34:56

Slave Interface: ens4
MII Status: up
Link Failure Count: 0
Permanent HW addr: 52:54:00:ab:cd:ef
# Check via ip tool
ip addr show bond0
ip link show bond0

Common bonding issues

ProblemCauseFix
Bond is up but LACP not negotiatingSwitch LACP not configuredConfigure switch port-channel or use active-backup instead
Traffic only uses one NICExpected for active-backup; for 802.3ad check hash policyUse balance-alb for outbound distribution without switch config
Failover not happeningmii-monitor-interval too slow or not configuredSet mii-monitor-interval: 100

Conclusion

For most server deployments, active-backup mode is the right choice: it requires no switch configuration, provides full redundancy, and is easy to troubleshoot. Use 802.3ad LACP when you want both bandwidth aggregation and redundancy and can configure the switch. After configuring, verify with cat /proc/net/bonding/bond0 — both slave interfaces should show "MII Status: up" and the correct active slave should be shown. Test failover by disabling one NIC and confirming traffic continues uninterrupted.

FAQ

Is Bonding Interfaces important for Ubuntu administrators?+

Yes. It supports practical Ubuntu administration because it connects directly to server reliability, security, troubleshooting, or daily operations.

Should I practice this on a live server?+

Use a lab VM first. After you understand the command output and rollback path, apply the workflow carefully on real systems.

What should I do after reading this article?+

Run the practice commands, write down what each one shows, and continue to the next article in the Ubuntu roadmap.

Need help with Ubuntu administration?

Work directly with Muhammad Irfan Aslam for Ubuntu Server, Linux, cloud, Docker, DevOps, CI/CD, or infrastructure troubleshooting support.

Hire Me for Support