This article transferred from the Internet, the copyright belongs to the original author, the original address: https://www.cnblogs.com/5201351/p/4898342.html
Operating system: CentOS Linux release 7.1.1503 (Core)
NIC Adapter: Eno1, Eno2
Bonding type:mode=1 (active-backup), master-backup policy
The configuration implementation process for mode=1 (active-backup) mode is documented as follows:
1, in CentOS 7, we can use the modinfo bonding command to view the bonding module information, by default bonding module is not loaded
We can log in as root, enter the following command to open the load bonding module
Modprobe--first-timebonding //--first-time Fail If module already inserted or removed
2, create the BOND0 configuration file, create the/etc/sysconfig/network-scripts/ifcfg-bond0 file, add the following content
device=bond0name=bond0type=bondbonding_master=yesipaddr=10.101. 230.30prefix=gateway=10.101. 230.1onboot=yesbootproto=nonebonding_opts="mode=1 miimon=100"
where bonding_opts Specifies the bonding mode, where 10.101.230.30/27 will be the IP address of the bond0
3, configure the Eno1 and ENO2 network card configuration file, the file is located in the/etc/sysconfig/network-scripts/directory, respectively, Ifcfg-eno1,ifcfg-eno2. Here, first modify the Ifcfg-eno1
Type=ethernetbootproto=None #默认为dhcp, Modified here to none, can also be modified to staticdevice=eno1onboot=Yes # The default is no, here is modified to yes# the following two items for the new configuration option master=bond0slave=yes
4, in the same way, modify the Ifcfg-eno2 configuration file, after the completion of the modification, we use the following command to let the network configuration production, and then restart the Network.service service
Nmcli con Reload //MakeNetwork Manager aware the changes.systemctl restart Network.service // Restart Network Service
5, finally we can use the following command to detect whether the Bond0 interface has been started and working.
6, test, the author used the test method, for the disconnection of one of the network cable card, and then access the server, normal is the success.
How Bond is operated