Configure bond0 in CentOS 7
In CentOS 7, you can create bond0 by using Network Manager or manually configuring the network interface.
- Configure using Network Manager:
- Open the terminal and enter the following command to edit the Network Manager configuration file: sudo vi /etc/NetworkManager/system-connections/bond0
- Add the following content in the open file:
[connection]
id=bond0
type=bond
interface-name=bond0 - Save and close the file.
- Restart the Network Manager service: sudo systemctl restart NetworkManager
- Manual configuration:
- Open the terminal and enter the following command to edit the network configuration file: sudo vi /etc/sysconfig/network-scripts/ifcfg-bond0.
- Add the following to the open file: TYPE=Bond DEVICE=bond0 NAME=bond0 BOOTPROTO=none ONBOOT=yes BONDING_OPTS=”mode=1 miimon=100″
- Save and close the file.
- Create two configuration files for physical interfaces bonded with the bond interface in the /etc/sysconfig/network-scripts/ directory, such as ifcfg-eth0 and ifcfg-eth1.
- In these documents, information related to configuring physical interfaces, such as: TYPE=Ethernet, BOOTPROTO=none, DEVICE=eth0, NAME=eth0, ONBOOT=yes, MASTER=bond0, SLAVE=yes.
- Save and close the file.
- Restart the network service: sudo systemctl restart network.
After creating bond0 using any method, you can configure additional network parameters such as IP address, subnet mask, gateway, etc. Make sure the network configuration matches your environment.