Network bonding combines multiple physical ethernet ports so they function as a single interface. This is particularly useful for systems with Network Interface Cards (NICs) featuring multiple ports.
Why Use Network Bonding?
The primary benefits are increased throughput and fault tolerance. Some bonding modes distribute identical data across interfaces or designate backup interfaces for failover scenarios. Others aggregate multiple interfaces to boost throughput — combining two 1 Gbps cables theoretically yields 2 Gbps capacity.
Practical Use Cases
Common implementations include LAN configurations. A typical setup might involve a virtualization server and Network Attached Storage (NAS) system, each with two bonds: one connecting directly between devices for high-speed data transfer, and another linking through a network switch for broader connectivity.
Bonding Modes
Netplan supports seven bonding modes:
| Mode | Description |
|---|---|
balance-rr |
Round-robin: transmit packets in order from the first available interface to the last. Provides load balancing and fault tolerance. |
active-backup |
Only one interface in the bond is active at a time; another becomes active only if the current one fails. Provides fault tolerance. |
balance-xor |
Transmission based on a source/destination hashing algorithm. Provides load balancing and fault tolerance. |
broadcast |
Transmits all packets across every interface simultaneously. Provides fault tolerance. |
802.3ad |
Dynamic link aggregation per IEEE 802.3ad standards. Requires Ethtool support and a compatible switch. |
balance-tlb |
Adaptive transmit load balancing. Does not require special switch support, but requires Ethtool. |
balance-alb |
Adaptive load balancing — combines transmit and receive load balancing. No special switch requirements. |
Example Configuration
The following Netplan configuration bonds four ethernet interfaces into a single bond0 interface using balance-alb mode:
network:
version: 2
ethernets:
eno1:
dhcp4: no
optional: true
eno2:
dhcp4: no
optional: true
eno3:
dhcp4: no
optional: true
eno4:
dhcp4: no
optional: true
bonds:
bond0:
interfaces: [eno1, eno2, eno3, eno4]
addresses: [192.168.0.21/24]
gateway4: 192.168.0.1
nameservers:
addresses: [8.8.8.8, 8.8.4.4]
parameters:
mode: balance-alb
After writing your Netplan config to /etc/netplan/, apply it with:
sudo netplan apply
Reference: Netplan documentation