Link Aggregation Control Protocol (LACP) allows you to combine multiple network interfaces into a single logical interface, providing redundancy and increased bandwidth. Netplan, the network configuration utility on Ubuntu, makes it straightforward to set up LACP bonding. This tutorial will guide you through the steps to configure LACP bonding on Netrouting Bare Metal Dedicated Servers using Netplan on Ubuntu.

Prerequisites

Step 1: Pre-Installation Checkup

Identify the network interfaces you want to bond. You can list all available network interfaces using:

ip link show

For this tutorial, we’ll assume eno1 and eno2 are the interfaces to be bonded.

Step 2: Remove Existing Netplan Configurations

Before creating a new Netplan configuration, remove any existing configurations to avoid conflicts.

sudo rm /etc/netplan/*.yaml

Step 2: Create Netplan Configuration File

Netplan configuration files are located in /etc/netplan/. Create a new configuration file or edit an existing one. For this example, we’ll create a file named 17-bonding.yaml.

sudo nano /etc/netplan/17-bonding.yaml

The file numbering is only relevant when you maintain multiple yaml files on the server. Netplan files are executed in alphanumeric order based on their filenames. This means that the configuration files in /etc/netplan/ are applied in the order dictated by their names. Typically, filenames include a numerical prefix to ensure the desired order of execution. For example, a file named 00-netcfg.yaml will be applied before a file named 01-netcfg.yaml. A common use case for wanting to separate your configuration could be with cloud based images where configuration files are dynamically updated via cloud-init. In most cases, you’ll want your custom configuration to be the last file to be applied (highest number).

Step 3: Define the Bonded Interface

Add the following configuration to bond eno1 and eno2 using LACP:

network:
  version: 2
  renderer: networkd
  ethernets:
    eno1:
      dhcp4: no
    eno2:
      dhcp4: no
  bonds:
    bond0:
      interfaces:
        - eno1
        - eno2
      addresses:
        - 192.168.1.100/24
      gateway4: 192.168.1.1
      nameservers:
        addresses: [8.8.8.8, 8.8.4.4]
      parameters:
        mode: 802.3ad
        lacp-rate: fast
        mii-monitor-interval: 100

NOTE: Netplan uses YAML syntax and does not support tabs, indentation is created with use of spaces only and inconsistent indentation will cause errors in your Netplan configuration

Step 4: Test the Configuration

Before applying the Netplan configuration, it’s important to test it to ensure there are no syntax errors.

sudo netplan try

This command will test the configuration and prompt you to accept or revert the changes. If the configuration is correct, you can proceed to apply it.

Step 5: Apply the Configuration

If the configuration test is successful, apply the Netplan configuration to activate the bonded interface.

sudo netplan apply

This command will test the configuration and prompt you to accept or revert the changes. If the configuration is correct, you can proceed to apply it.

Step 6: Verify the Bonding Configuration

After applying the configuration, verify the bonding setup:

ip a show bond0

You should see bond0 with the configured IP address and the bonded interfaces (eno1 and eno2).

Additionally, check the bonding status:

cat /proc/net/bonding/bond0

This command provides detailed information about the bonding interface, including the active interfaces and their statuses.

Best Practices:

For users on Netrouting Service the following is implemented by default:

Conclusion:

By following these steps, you can configure LACP bonding with Netplan on Ubuntu. This setup ensures network redundancy and increased bandwidth, providing a more reliable and faster network connection.

Need help?

Find answers quick, talk to us on live chat.

Start Live Chat
support-chat-bottom
Phone
+31(0)88-045-4600
+1-305-705-6983