This article shows what files to add if you want to add a bonding interface under CentOS 8 without invoking the Network manager command utility.
Our goal is to use one boding group with the name bond0 in LACP (aka 802.3ad) mode (but it could be any of the other types) with two networks 10Gbps interfaces. The setup resented here uses NetworkManager, which handles the loading of bonding module properly.
In fact, the network-scripts are now deprecated and they are missing from the system (but they still exist in the additional package – “network-scripts”, who knows till when? do not rely on them!).
The configuration files are with the same syntax as under CentOS 7, but this time the network manager parses them. The ifup and ifdown still exist and they just call the Network manager when executed (unless the “network-scripts” package is installed). If you need to enable bonding without any configuration files (for emergency situations) you may still use – How to enable Linux bonding without ifenslave
What do you need:
- Ensure you have installed: “iputils” and “NetworkManager” packages
dnf install -y NetworkManager iputils
- Ensure the NetworkManager service is running
systemctl enable NetworkManager systemctl start NetworkManager
STEP 1) Configure the bonding device
The boding interface’s name will be bond0 and the configuration will be located in /etc/sysconfig/network-scripts/ifcfg-bond0
BONDING_OPTS="mode=4 miimon=100" TYPE=Bond BONDING_MASTER=yes BOOTPROTO=none IPADDR0=192.168.0.100 PREFIX0=24 GATEWAY0=192.168.0.1 DNS1=22.214.171.124 DNS2=126.96.36.199 IPV4_FAILURE_FATAL=no NAME=bond0 UUID=e19e2059-2e31-4143-915a-cdc11d19c9d6 DEVICE=bond0 ONBOOT=yes