1. first add ifcfg-bond0DEVICE = bond0BOOTPROTO = noneONBOOT = yesTYPE = EthernetIPADDR = 192.168.0.10NETMASK = 255.255.255.0NETWORK = 192.168.0.1 under/etc/sysconfig/network-scripts
1. first add ifcfg-bond0 under/etc/sysconfig/network-scripts
DEVICE = bond0
BOOTPROTO = none
ONBOOT = yes
TYPE = Ethernet
IPADDR = 192.168.0.10
NETMASK = 255.255.255.0
NETWORK = 192.168.0.1
2, ifcfg-eth0/eth1 configuration other similar:
DEVICE = eth0
BOOTPROTO = none
ONBOOT = yes
MASTER = bond0
SLAVE = yes
3. modify the/etc/modprobe. conf file, back up the file, and add two lines.
Alias bond0 bonding
Options bond0 miimon = 100 mode = 1 [max_bonds = 2]
Note:
(1) miimon indicates that the interval between link monitoring is Millisecond. miimon = 100 means that the link connection status is monitored every 100 ms, if one line fails, it will be transferred to another line.
(2) mode = 0 indicates the server load balancer mode. both NICs work and must be supported by vswitches.
Mode = 1 indicates the redundancy mode. only one network adapter works. if one problem occurs, another one is enabled.
Mode = 6 indicates the server load balancer mode. both NICs work and do not require support from vswitches.
Note: the current 0-mode test is a problem. if there is no relevant configuration on the switch, packet loss will be very serious, in addition, the "0" mode is only a transmission mode in turn, rather than increasing the network bandwidth, in this way, the packet is sent in turn, which leads to a decrease in the network speed (because you have to choose the network adapter). Currently, the 1-mode redundancy mode is widely used, which is safe, reliable, and fast.
(3) bonding can only provide link monitoring, that is, whether the link from the host to the switch is connected. If the external link of the switch is down and the switch is not faulty, bonding considers that the link is correct and continues to be used.
(4), max_bonds = 2 Nic binding if BOND is more than one, it is best to add this parameter to limit the maximum number of BOND loads, if this parameter is not loaded, the system reports an error similar to "BOND1 cannot be found, and BOND1 fails to be loaded" when the network is restarted"