How to Configure systemd-networkd for Bonded Interfaces on Ubuntu

The Need for Network Interface Bonding

In enterprise server environments, a single network interface controller (NIC) represents a single point of failure and a potential bandwidth bottleneck. If the physical switch port dies, the cable fails, or the NIC hardware malfunctions, the server loses connectivity.

Network Interface Bonding (also known as Link Aggregation or NIC Teaming) solves this by combining multiple physical network interfaces into a single logical “bonded” interface. This provides high availability (failover) and, depending on the mode, increased throughput (load balancing).

Historically, Ubuntu administrators used ifenslave and the /etc/network/interfaces file to configure bonding. However, in modern Ubuntu systems, network management has transitioned to netplan and systemd-networkd. This guide explains how to configure a bonded interface natively using systemd-networkd.

Step 1: Identifying the Physical Interfaces

Before configuring the bond, you must identify the physical network interfaces you intend to combine. Use the ip link command to list available interfaces:

ip -brief link show

Assume we have two physical interfaces: eno1 and eno2. Both are currently UP but unconfigured.

Step 2: Creating the Netdev Configuration

In systemd-networkd, virtual network devices (like bonds, bridges, or VLANs) are defined using .netdev files. We need to create a configuration file that tells systemd to create a new virtual bond interface named bond0.

Create the file /etc/systemd/network/10-bond0.netdev:

sudo nano /etc/systemd/network/10-bond0.netdev

Add the following configuration:

[NetDev]
Name=bond0
Kind=bond

[Bond]
Mode=802.3ad
TransmitHashPolicy=layer3+4
MIIMonitorSec=1s
LACPTransmitRate=fast

This configures the bond to use 802.3ad (LACP), which requires dynamic negotiation with the connected physical switch. The MIIMonitorSec=1s setting ensures that link failures are detected within 1 second.

Step 3: Binding the Physical Interfaces to the Bond

Now that the logical bond0 device exists, we must instruct systemd-networkd to enslave the physical interfaces eno1 and eno2 to it. This is done using .network files.

Create a file named /etc/systemd/network/20-bond0-enslave.network:

sudo nano /etc/systemd/network/20-bond0-enslave.network

Add the following configuration to bind both interfaces:

[Match]
Name=eno1 eno2

[Network]
Bond=bond0

This tells the network daemon that whenever it sees an interface matching eno1 or eno2, it should not assign them an IP address directly, but instead attach them to bond0.

Step 4: Configuring the IP Address on the Bond

Finally, we need to assign an IP address, gateway, and DNS servers to the newly created bond0 interface. Create a third file named /etc/systemd/network/30-bond0.network:

sudo nano /etc/systemd/network/30-bond0.network

Add the IP configuration:

[Match]
Name=bond0

[Network]
Address=10.100.50.10/24
Gateway=10.100.50.1
DNS=8.8.8.8 1.1.1.1

Step 5: Applying and Verifying the Configuration

With all three files in place, you must restart the systemd-networkd service to apply the changes.

sudo systemctl restart systemd-networkd

To verify that the bond is active and the physical interfaces are enslaved correctly, use the networkctl command:

networkctl status bond0

Additionally, you can inspect the raw kernel state of the bonding module by reading the proc filesystem:

cat /proc/net/bonding/bond0

This output will confirm the current bonding mode, the status of LACP negotiation, and whether both eno1 and eno2 are actively passing traffic.

Conclusion

Configuring network bonding via systemd-networkd provides a declarative, modern approach to Linux networking. By separating the virtual device creation (.netdev) from the physical interface binding and IP assignment (.network), administrators gain a highly flexible and reliable method for achieving network redundancy on Ubuntu servers.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.