NIC Bonding and Multiple Network Ports

Combine a bare-metal server's multiple NICs into one logical interface for higher bandwidth or stronger redundancy.

A bare-metal (dedicated) server usually ships with two or more physical network ports. Left alone, each acts on its own, so a single failed cable or a saturated card takes your service down with it. NIC bonding (also called link aggregation or teaming) merges several NICs into one logical interface, bond0. Applications see a single card, while the kernel underneath either stacks the bandwidth or fails traffic over transparently.

Why bond at all

Bonding almost always serves one of two goals:

  • Redundancy (high availability): when a cable, a switch port, or a NIC dies, traffic shifts to the surviving link and the service keeps running.
  • Bandwidth aggregation: multiple links forward in parallel, turning two 1G ports into close to 2G of throughput — ideal for backups, storage replication, and other bulk transfers.

Common bonding modes

  • active-backup (mode=1, redundancy): only one NIC is active at a time; the other stands by. It needs no special switch configuration, which makes it the safest and most widely used HA option.
  • 802.3ad / LACP (mode=4, aggregation): true bandwidth aggregation, but it requires the switch to support and enable LACP, with both ends in the same aggregation group. This gives the fullest use of your links.
  • balance-alb (mode=6, aggregation): adaptive load balancing across both send and receive, with no switch cooperation required — a solid middle ground when you want aggregation but can't touch the switch.

Configuring with netplan (Ubuntu/Debian)

Recent Ubuntu releases use netplan. Edit /etc/netplan/01-bond.yaml; here is an active-backup example:

network:
  version: 2
  ethernets:
    eth0:
      dhcp4: no
    eth1:
      dhcp4: no
  bonds:
    bond0:
      interfaces: [eth0, eth1]
      addresses: [192.168.1.10/24]
      routes:
        - to: default
          via: 192.168.1.1
      parameters:
        mode: active-backup
        primary: eth0
        mii-monitor-interval: 100

For LACP, change mode to 802.3ad and add lacp-rate: fast (and confirm the switch side has its aggregation group set up). Apply the config:

sudo netplan apply

On the older /etc/network/interfaces stack you instead apt install ifenslave, add bond-mode and bond-slaves eth0 eth1 under the bond0 stanza, then run ifup bond0.

Verifying the bond

Once it's up, always check what the kernel actually thinks:

cat /proc/net/bonding/bond0
ip -br link show bond0

Focus on Bonding Mode (is it the mode you intended?), each Slave Interface reporting MII Status: up, and, for active-backup, the Currently Active Slave. Pull one cable and re-read the file to watch traffic fail over — that's how you prove redundancy really works.

Summary

The choice is straightforward: use active-backup when you only need uptime and can't touch the switch; reach for 802.3ad LACP when you want real bandwidth and control the switch; pick balance-alb for the middle ground. The setup is a handful of YAML lines in netplan, and /proc/net/bonding/bond0 is the single source of truth for whether it's actually live — always read it after applying, and for any redundancy setup, pull a cable once to rehearse the failover for real.