Operating system: CentOS Linux release 7.1.1503 (Core)
NIC Adapter: Eno1, Eno2
Bonding type: mode=1 (active-backup), Master-backup policy
NIC binding mode A total of seven kinds, each mode, have their own use, the author because in the work of the mode=1 (active-backup) mode
In this author will work in the use of NIC binding bonding technology mode=1 (active-backup) mode configuration implementation process is recorded 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-time Bonding//--first-time Fail If module already inserted or removed
2, create the BOND0 configuration file, create the Www.2.qixoo.com/etc/sysconfig/network-scripts/ifcfg-bond0 file, add the following content
Device=bond0
Name=bond0
Type=bond
Bonding_master=yes
ipaddr=10.101.230.30
Prefix=27
gateway=10.101.230.1
Onboot=yes
Bootproto=none
bonding_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=ethernet
Bootproto=none #默认为dhcp, Modified here to none, can also be modified to static
Defroute=yes
Peerdns=yes
Peerroutes=yes
Ipv4_failure_fatal=no
Ipv6init=yes
Ipv6_autoconf=yes
Ipv6_defroute=yes
Ipv6_peerdns=yes
Ipv6_peerroutes=yes
Ipv6_failure_fatal=no
Name=eno1
uuid=26ea0bd1-0837-4b1a-9039-f147abd19632
Device=eno1
Onboot=yes #默认为no, change this to Yes
#以下两项为新增配置选项
Master=bond0
Slave=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//make Network 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.
Technology sharing
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.
Network host-backup strategy in Linux system NIC bonding technology