To improve the high availability of the system, we can bind two or more NICs to a virtual Nic and use the same IP address to ensure that a link is disconnected, another link can be started at any time to improve system stability.
Enable dual NICs in virtual machines
Finish
When the dual Nic is working, it is represented as a virtual NIC (bond0). The virtual NIC also needs a driver named bonding.
Check whether the kernel supports dual-nic binding
Vim/boot/config-2.6.18-164.e15
This network mode is supported, and BOUNDING is a built-in module.
Enter
After the network card is bound to a uniform ip address, you do not need to set the ip address for eth0 and eth1.
Vim ifcfg-eth0.
Vim ifcfg-eth1.
Generate additional Nic file ifcfg-bond0
Cp ifcfg-eth0 ifcfg-bond0
(Address required for the virtual Nic bond0)
Vim ifcfg-bond0.
Vim/etc/modprobe. conf (to enable the system to load the bonding module)
Add
(Bond0 link monitoring with a latency of 100 milliseconds. mode = 1 indicates the active/standby mode)
Vim/etc/rc. d/rc. local (in the boot script, specify that bond0 is bound to the eth0 and eth1 NICS)
Init 6 restart the system
Dmesg | grep bond0 (view information about the active/standby mode)
Or cat/proc/net/bonding/bond0
Monitoring once every second
Wtach-n 1 'cat/proc/net/bonding/bond'
When eth0 is down, the backup link eth1 is automatically started.
When eth1 is down, eth0 starts
This article is from the "HWOTT" blog, please be sure to keep this source http://iceblock.blog.51cto.com/6758400/1167681