CentOS 7 Network Bonding Configuration Guide
Overview
Setting up network bonding on CentOS 7 enhances redundancy and increases bandwidth by combining multiple network interfaces into a single logicall interface. This guide walks through the steps to configure a bonded interface using two physical NICs in mode 0 (balance-rr).
1. Verify System Support
Check if the system supports bonding by running:
modinfo bonding
If module information is displayed, the system is compatible with bonding.
2. Enstall Required Packages
Ensure that the bonding module and ifenslave utility are installed:
sudo yum install -y bonding ifenslave
3. Load Bonding Module
Create a configuration file at /etc/modprobe.d/bonding.conf and add:
alias bond0 bonding
options bonding mode=0 miimon=100
This sets the bonding mode to round-robin with a link monitoring interval of 100 milliseconds.
4. Configure Bond Interface
Create a configuration file for the bonded interface at /etc/sysconfig/network-scripts/ifcfg-bond0:
DEVICE=bond0
TYPE=Bond
NAME=bond0
BONDING_MASTER=yes
BOOTPROTO=none
ONBOOT=yes
BONDING_OPTS="mode=0 miimon=100"
5. Update Physical Interfaces
Edit the configuration files for each physical NIC (e.g., /etc/sysconfig/network-scripts/ifcfg-eth0 and /etc/sysconfig/network-scripts/ifcfg-eth1):
DEVICE=eth0
BOOTPROTO=none
ONBOOT=yes
MASTER=bond0
SLAVE=yes
Repeat the same for eth1 or adjust the name accordingly.
6. Restart Networking Service
Apply the changes by restarting the network service:
sudo systemctl restart network
7. Verify Configuration
Check the status of the bond using:
cat /proc/net/bonding/bond0
Ensure both interfaces are listed as active and the mode matches the configuration.