How to set up LACP bonding on Ubuntu 16.04

Estimated reading time: 1 min

Introduction

This guide will help you set up the LACP bonding using the IEEE 802.3ad specification. LACP which stands for “Link Aggregation Control Protocol”, is used to combine several physical network connections with the aim of the increasing the speed and reliability of a network. By the end of this tutorial, you will have a bonded network of two network interfaces.

Prerequisites

  • The network switch your server is connected to must be set up accordingly in for a successful procedure

Step 1 – Login using SSH

You need to log in as root or a user with root privileges. You can check this article for instructions on how to log in using SSH.

Step 2 – Install the ifenslave dependency

sudo apt-get install ifenslave

Step 3 – Ensure presence of the “bonding” module

sudo modprobe bonding

Step 4 РLoad bonding  modules during boot

sudo nano /etc/modules

Append the following lines:

bonding

Step 5 – find the active network interface

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

Step 6 – 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

sudo nano /etc/network/interfaces

auto enp6s0
iface enp6s0 inet manual
bond-master bond0

auto enp7s0
iface enp7s0 inet manual
bond-master bond0

auto bond0
iface bond0 inet static
        address 89.207.134.XXX
        gateway 89.207.134.1
        netmask 255.255.255.01
        dns-nameservers 89.207.128.252 89.207.130.252
        slaves enp6s0 enp7s0
        bond-mode 4
        bond-miimon 100
        bond-lacp-rate 1
        bond-slaves none

Step 7 – Restart the server

Now that editing is done, double check that all the steps have been executed properly and reboot your machine by running the reboot command:

reboot

Step 8 – 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

Conclusion

Congratulations, you have configured LACP network interface according to IEEE 802.3ad on a Ubuntu server. 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: 1041

Reader Interactions

Leave a Reply

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