Skip to content
Français
Account: not signed in, sync available My learning
Select theme
Français

Aggregate network links: bond and bridge on Linux

By updated

Improve this page

A serious server does not hang on a single cable: bonding aggregates two physical links into a single fault-tolerant interface, and the bridge turns it into a software switch for your virtual machines. This guide configures both on Linux with netplan: a bond in active-backup mode (redundancy), then a bridge on top. You check the aggregation with /proc/net/bonding, and you prove the failover by cutting the active link: traffic carries on over the other one. All outputs come from a real lab (Ubuntu 24.04, two dedicated links). Audience: administrators building a redundant server or a virtualisation host.

Bonding and bridging are LFCS objectives (the Networking domain). This guide puts them into practice end to end.

What you will learn

  • Tell a bond (link aggregation) from a bridge (software switch).
  • Create a bond in active-backup mode with netplan.
  • Put a bridge on top of the bond, to plug VMs into it.
  • Check the state with /proc/net/bonding and ip.
  • Prove fault tolerance with a real failover.

Prerequisites

  • A Linux server with at least three interfaces: one for administration (here eth0, which carries SSH and which you leave alone), and two links to aggregate (here ens19 and ens20).
  • netplan (Ubuntu 18.04+, Debian with netplan). The NetworkManager/nmcli (RHEL) and systemd-networkd equivalents are pointed out.
  • sudo rights.

Bond and bridge: two different building blocks

They are often confused, although they answer two opposite needs:

  • A bond (or bonding, link aggregation) merges several physical links into a single logical interface. Goal: redundancy (if a cable or a switch fails, the other one takes over) or throughput (adding up bandwidth). It acts downwards, on the hardware side.
  • A bridge is a software network switch: it connects several interfaces (physical, VMs, containers) on the same segment. Goal: give network access to virtual machines. It acts upwards, on the machine side.

The two combine: a bond for redundancy underneath, a bridge on the bond to plug the VMs in on top. It is the classic network architecture of a virtualisation host.

Choose the bond mode

The mode determines how the links cooperate. Three are common:

ModeBehaviourWhen
active-backup (mode 1)One active link, the other on standbySimple redundancy, no switch-side setting
802.3ad (mode 4, LACP)Links add up, negotiated through LACPThroughput + redundancy, LACP-capable switch required
balance-rr (mode 0)Packet-by-packet distributionMaximum throughput, but risk of out-of-order packets

This guide uses active-backup: it is the most robust and the only one that needs no configuration on the switch on the other side. Perfect to protect yourself from a switch or cable failure.

Configure the bond with netplan

Create a dedicated netplan file (without touching the cloud-init one that handles administration). It declares the two links, the bond, then the bridge.

/etc/netplan/60-bond.yaml
network:
version: 2
ethernets:
ens19:
dhcp4: false
ens20:
dhcp4: false
bonds:
bond0:
interfaces: [ens19, ens20]
parameters:
mode: active-backup
primary: ens19
mii-monitor-interval: 100
bridges:
br0:
interfaces: [bond0]
addresses: [10.10.0.1/24]

Two parameters deserve a word. primary: ens19 names the preferred link: it takes over again as soon as it comes back. mii-monitor-interval: 100 tells the kernel to monitor the state of the links every 100 ms; it is what allows a fast failover.

Apply the configuration:

Terminal window
sudo netplan apply

Check the aggregation

A look at the interfaces shows the full hierarchy: two slaves, a master, a bridge.

Terminal window
ip -br link show
eth0 UP bc:24:11:1e:d3:37 <BROADCAST,MULTICAST,UP,LOWER_UP>
ens19 UP aa:06:70:cb:79:2d <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP>
ens20 UP aa:06:70:cb:79:2d <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP>
bond0 UP aa:06:70:cb:79:2d <BROADCAST,MULTICAST,MASTER,UP,LOWER_UP>
br0 UP 86:2d:8f:28:10:2b <BROADCAST,MULTICAST,UP,LOWER_UP>

Note that ens19 and ens20 share the same MAC address (aa:06:...), the one of the bond: from the outside, the two links form a single interface. The details live in a kernel file:

Terminal window
cat /proc/net/bonding/bond0
Bonding Mode: fault-tolerance (active-backup)
Primary Slave: ens19 (primary_reselect always)
Currently Active Slave: ens19
MII Status: up
Slave Interface: ens20
MII Status: up
Slave Interface: ens19
MII Status: up

The mode is confirmed (active-backup), the active link is ens19, and both slaves are healthy (MII Status: up). The br0 bridge, for its part, carries the IP address:

Terminal window
ip -br addr show br0
br0 UP 10.10.0.1/24 ...

Prove fault tolerance

This is the test that matters: what happens if a link goes down? Let us simulate the failure of the active link.

Terminal window
sudo ip link set ens19 down

The kernel detects the loss in less than 100 ms and fails over to the standby link:

Terminal window
cat /proc/net/bonding/bond0
Currently Active Slave: ens20
Slave Interface: ens20
MII Status: up
Slave Interface: ens19
MII Status: down

The active link became ens20, ens19 is down, and above all the bond stays UP:

Terminal window
ip -br link show bond0
bond0 UP aa:06:70:cb:79:2d <BROADCAST,MULTICAST,MASTER,UP,LOWER_UP>

No service interruption: the traffic simply moved to the other cable. When ens19 comes back, it takes over again (thanks to primary):

Terminal window
sudo ip link set ens19 up
# Currently Active Slave: ens19

That is the whole value of the bond: a failure of a cable, a switch port or a card becomes invisible to the services.

On RHEL, AlmaLinux and Rocky

The Red Hat family manages the network with NetworkManager. The same aggregation is created with nmcli:

Terminal window
sudo nmcli connection add type bond ifname bond0 con-name bond0 bond.options "mode=active-backup,miimon=100"
sudo nmcli connection add type ethernet ifname ens19 con-name bond0-port1 controller bond0
sudo nmcli connection add type ethernet ifname ens20 con-name bond0-port2 controller bond0
sudo nmcli connection add type bridge ifname br0 con-name br0 ipv4.method manual ipv4.addresses 10.10.0.1/24
sudo nmcli connection modify bond0 controller br0 port-type bridge

The concept is identical: two slaves, a bond, a bridge. Only the configuration tool changes; /proc/net/bonding/bond0 remains the source of truth. The old master and slave-type keywords are still accepted by nmcli 1.56 (AlmaLinux 10) and produce the same profile, but they have disappeared from its help: write controller and port-type. Without con-name, nmcli names the port itself bond-slave-ens19, less readable when troubleshooting.

Security and points of attention

The danger of a bond is not an attack, it is losing access: you change the network configuration of the machine from the network itself. The first two points below protect your access, the last two avoid the silent outage, the one where the redundancy you believe you have has not existed for weeks.

  • Keep an administration interface out of the bond: it saves you if the network configuration goes wrong.
  • Check the mode on the switch side: 802.3ad requires LACP configured on the other side, otherwise the link remains unusable. active-backup has no such constraint.
  • Test the failover before production: a bond that has never failed over is a bond you do not know will fail over.
  • Watch /proc/net/bonding: a slave silently in MII Status: down leaves you without redundancy without knowing it.

Troubleshooting

A bond that does not work is almost always diagnosed in the same place: /proc/net/bonding/bond0, which gives the active mode and the state of each slave. Look at this file before changing the configuration. The table then links the visible symptoms to the most frequent causes, two of which belong to the switch on the other side and not to the server.

SymptomProbable causeSolution
The bond stays DOWNNo slave up, or switch expecting LACPCheck /proc/net/bonding, switch to active-backup
Loss of control after netplan applySSH interface included in the bondStart again from the console, take the admin interface out
No failover when the cable is cutmii-monitor-interval missingAdd mii-monitor-interval: 100
802.3ad unusable, not just without extra throughputLACP not negotiated on the switch side: each port gets its own aggregator (different Aggregator ID) and goes to MII Status: down, while the bond itself shows upConfigure the port-channel on the switch, or switch to active-backup
The bond is up but Currently Active Slave: None after an nmcli con up <bond>Reactivating the controller detaches the portsReactivate each port afterwards; nmcli announces it in its own way with Connection successfully activated (controller waiting for ports)
A freshly created bridge passes nothing for about thirty secondsSTP: the port goes through listening then learning before forwarding, that is twice forward-delay (15 s each)Wait, or disable STP with bridge.stp no if the topology allows it (forwarding reached in 2 s)
The interface enrolled in a bridge lost its IP configurationNetworkManager removes the [ipv4] section from the port keyfileNormal: the address now lives on the bridge. nmcli -f ipv4.method con show <port> returns nothing any more
The bridge does not pass trafficbond0 not a member of the bridgeCheck interfaces: [bond0] under bridges

Put it into practice

A bond that has never failed over before your eyes remains a promise on paper. The lab takes up the scenario on the Red Hat side: you build an active-backup bond under a bridge with nmcli, then you cut the active link and watch the failover in /proc/net/bonding.

Key points

  • A bond aggregates physical links (redundancy/throughput); a bridge is a software switch for VMs. The two combine.
  • active-backup is the most robust mode: redundancy with no switch-side setting.
  • netplan declares everything in one file; /proc/net/bonding/bond0 is the source of truth for the state.
  • The failover is proven by cutting the active link: the standby link takes over, the bond stays UP.
  • primary makes the preferred link take over again; mii-monitor-interval conditions the detection speed.
  • Never put the administration interface in the bond before the configuration is validated.

Knowledge check

Check that the essentials of this guide stuck. The questions cover only what has just been explained here.

Knowledge check

Check what you have learned with this interactive quiz

6 questions
6 min
70% to pass

How it works

  • The timer starts when you click Start
  • Multiple choice, true/false and short answer questions
  • You can move between questions
  • Detailed results are shown at the end

Starts the quiz and the timer

Is this project useful to you?

The guides, courses, quizzes and labs stay free. If you use them regularly, you can contribute to their upkeep and development.

Become a supporting member (new tab) One-time support (new tab) Learn more

Follow the project on LinkedIn