How to set up LACP bonding on Ubuntu 18.04 with Netplan

Estimated reading time: 1 min


In this article, we’ll look at how to set up LACP bonding on a server running Ubuntu. LACP bonding uses the Link Aggregation Control Protocol to combine two network interfaces into one logical interface. Today, we’ll use it to combine two ethernet interfaces. This is useful to increase the throughput from each ethernet device and to provide for a way to failover if there’s an error with one of the devices.


  • The network switch your server is connected to must be set up accordingly in for a successful procedure
  • You need to have the SSH login details of your server ready

Step 1 – Login using SSH

You must be logged in via SSH as sudo or root user. Please see this article for instructions if you don’t know how to connect.

Step 2 – Install the ifenslave dependency

sudo apt-get install ifenslave

Step 3: Load bonding kernel module

Before you can configure the network cards you need to ensure that the kernel module called bonding is present and loaded.

sudo lsmod | grep bonding

If the module is not loaded. Use the following command to load it

sudo modprobe bonding

To ensure that the bonding module is loaded during boot time change file the following file

sudo nano /etc/modules

Add the following line


Step 4 – find the active network interface

clear && echo $(ip -o -4 route get | sed -nr 's/.*dev ([^\ ]+).*/\1/p')

Step 5 – Configure the network interface

The output of step 4 is the network interface which is active at the moment. You should use that name for the bond. In our case this is enp2s0 and the second interface enp3s0.

# This file is generated from information provided by
# the datasource.  Changes to it will not persist across an instance.
# To disable cloud-init's network configuration capabilities, write a file
# /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following:
# network: {config: disabled}
  version: 2
        name: enp*
      optional: true
      interfaces: [eports]
      addresses: []
        addresses: [,]
        mode: 802.3ad
        lacp-rate: fast
        mii-monitor-interval: 100

Apply the changes

sudo netplan apply

Step 6 – Reboot


Step 7 – Check bonding interface status

If everything went well, you should have a working bonding interface. You can check this by executing the following command

cat /proc/net/bonding/bond0


Congratulations, you have configured LACP network interface according to IEEE 802.3ad on a Ubuntu server 18.04 with Netplan. If you are interested in other modes which are available check this URL section “Descriptions of bonding modes”.

Was this article helpful?
Dislike 0
Views: 1927

Reader Interactions

Leave a Reply

Your email address will not be published. Required fields are marked *