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.
- 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:
Step 5 – find the active network interface
clear && echo $(ip -o -4 route get 184.108.40.206 | 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 220.127.116.11 netmask 255.255.255.01 dns-nameservers 18.104.22.168 22.214.171.124 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:
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:
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”.