Ubuntu 16.04 Bonding Configuration (Without LACP AND LACP)
What is Bonding?
It is the process of joining multiple ethernet interfaces. Network teaming can also be called. In other words, if more than one network card acts as a single network card, if one of the cards is disconnected, it is the process of continuous connection over the other card.
What is LACP?
Ether Channel is performed with two protocols. The first is the cisco protocol PAgP (Port Aggregation Protocol) and the second is the LACP (Link Aggregation Control Protocol) standard protocol with IEEE 802.3ad. Ether Channel is a protocol that allows the switch to detect two or more cables as a single cable when two or more cables are connected between two switches. Ether Channel provides both redundancy, loadbalance, and high bandwidth.
Bonding MODs
mode = 0 >> Round-robin (balance-rr) sends packets to the interfaces, respectively.
mode = 1 >> Active-backup works. Only one interface is active.
mode = 2 >> [(Source MAC address XOR destination MAC address)% interfaces] Sends packets according to the balance-xor algorithm.
mode = 3 >> Broadcast type. It sends all packets from all interfaces.
mode = 4 >> IEEE 802.3ad Dynamic link aggregation (802.3ad), LACP. Active-active works.
mode = 5 >> The total load is shared according to the load of each interface (balance-tlb).
mode = 6 >> Adaptive load balancing mode (balance-alb).
Our example scenario is as follows,

1- Bonding with LACP configuration,
Now configure the inside of the file “/etc/network/interfaces” as follows. You can edit by your own nic card names.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 | auto enp6s0f0 iface enp6s0f0 inet manual bond-master bond0 auto enp7s0f0 iface enp7s0f0 inet manual bond-master bond0 auto enp6s0f1 iface enp6s0f1 inet manual bond-master bond1 auto enp7s0f1 iface enp7s0f1 inet manual bond-master bond1 auto bond0 iface bond0 inet static address 192.168.1.10 netmask 255.255.255.0 gateway 192.168.1.1 dns-nameservers 192.168.1.1 bond-mode 4 bond-miimon 100 bond-lacp-rate fast bond-slaves enp6s0f0 enp7s0f0 bond-downdelay 0 bond-updelay 0 bond-xmit_hash_policy 1 auto bond1 iface bond1 inet static address 192.168.2.20 netmask 255.255.255.0 gateway 192.168.2.1 dns-nameservers 192.168.2.1 bond-mode 4 bond-miimon 100 bond-lacp-rate fast bond-slaves enp6s0f1 enp7s0f1 bond-downdelay 0 bond-updelay 0 bond-xmit_hash_policy 1 |
Then you can restart the network service with the command “systemctl restart networking.service”, you will only need to reboot the OS because Ubuntu network service has not reached the desired level yet. So restart the system directly with the reboot command.
Then you can check the operations with “ip a” command.
You can also get details of Bonding configurations with the command below.
1 2 3 | > more /proc/net/bonding/bond0 > more /proc/net/bonding/bond1 |
NOTE1: In the bonding configuration, bond0 inherits and uses the physical address of the nic that appears as the first slave. This means that the MAC Address status will be as in the example below (you can also confirm it from the screenshot). This applies except for mod5 and mod6. In addition, mod1 also uses the unique MAC Address because of its active-backup operation principle.
1 2 3 | bond0 Link encap:Ethernet HWaddr 50:6B:4B:23:1B:2C enp6s0f0 Link encap:Ethernet HWaddr 50:6B:4B:23:1B:2C enp7s0f0 Link encap:Ethernet HWaddr 50:6B:4B:23:1B:2C |
NOTE2: If you configure Bondings on the OS side as LACP, you must configure the LACP on the corresponding ports on the Switch side. As an example, I share the setting that needs to be done on the Switch side below.
1 2 3 4 5 6 7 | interface Ethernet X channel-group 1 mode active no shutdown interface Po1 switchport mode trunk mlag 1 |
2- Normal Bonding configuration without LACP,
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | auto enp6s0f0 iface enp6s0f0 inet manual bond-master bond0 auto enp7s0f0 iface enp7s0f0 inet manual bond-master bond0 auto bond0 iface bond0 inet static address 192.168.1.10 netmask 255.255.255.0 gateway 192.168.1.1 dns-nameservers 192.168.1.1 bond-mode 1 bond-miimon 100 bond-slaves enp6s0f0 enp7s0f0 bond-downdelay 0 bond-updelay 0 bond-xmit_hash_policy 1 |
3- Rope without nic bonding configuration,
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | auto enp6s0f0 iface enp6s0f0 inet manual bond-master bond0 auto enp7s0f0 iface enp7s0f0 inet manual bond-master bond0 auto bond0 iface bond0 inet manual bond-mode 4 bond-miimon 100 bond-lacp-rate fast bond-slaves none bond-downdelay 200 bond-updelay 200 bond-xmit_hash_policy 1 |
I hope it has been a useful article.