All articles, Linux server, Web Hosting Tools and Techniques

Debian / Ubuntu bond0 interface config

Debian / Ubuntu bond0 interface config
To set up the proper operation of Bond0 on OS Debian/Ubuntu, you need to perform the following actions.

First, update the packages:

apt-get update

To use the bonding network mechanism, you need to install the kernel module and check it:

modprobe bonding
lsmod | grep bond

Install the access control utility:

apt-get install ifenslave

Next, you need to edit the network interface files and the module file, and then restart the server. Bonding will be successfully configured.
In this example, both network interfaces are named eno1 and eno2.

(/etc/network/interface):
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
#allow-hotplug eno1
auto bond0
iface bond0 inet static
slaves eno1 eno2
#iface eno1 inet static
address 192.168.1.10/25
gateway 192.168.1.1
# dns-* options are implemented by the resolvconf package, if installed
dns-nameservers 8.8.8.8 8.8.4.4
dns-search ugb.ee
bond_mode 802.3ad
bond_miimon 100
bond_downdelay 200
bond_updelay 200
bond-lacp-rate 1
bond-xmit-hash-policy layer2+3

(/etc/modules):
# /etc/modules: kernel modules to load at boot time.
#
# This file contains the names of kernel modules that should be loaded
# at boot time, one per line. Lines beginning with “#” are ignored.

bonding

To check the traffic on a network interface, you can use the “iftop” utility:

apt-get install iftop
iftop -i bond0
iftop -i eno1
iftop -i eno2

You can check the status of all network interfaces on your server using the command:

cat /proc/net/bonding/bond0