Prerequisites:
1. Do not configure it on the VM. Whether it is vm5 or vm6, I have tried it many times and it seems to be successful each time, But I will find the truth when I use machine ping for a network disconnection test;
2. NICs of the same brand and model must be used. Two different NICs. After configuring according to the document, even if you ping the external address from the local machine, the network seems to have been completely disconnected;
3. Use Service Network restart with caution. After the configuration is complete, after the test is successful, avoid restarting the network on the dual Nic machine. Otherwise, you will find that the network is disconnected, even if you manually execute ifenslave eth0 eth1 again, you can only activate one network card.
The configuration is as follows:
1. Nic Configuration
# Cd/etc/sysconfig/network-scripts/
# Cp ifcfg-eth0 ifcfg-bond0
# Vi ifcfg-bond0
Change the first line to device = bond0
# Cat ifcfg-bond0
Device = bond0
Bootproto = static
Ipaddr = 192.168.1.100
Netmask = 255.255.255.0
Broadcast = 192.168.1.255
Onboot = Yes
Type = Ethernet
The configurations of other NICs are as follows:
# Cat ifcfg-eth0
Device = eth0
Onboot = Yes
Bootproto = none
# Cat ifcfg-eth1
Device = eth0
Onboot = Yes
Bootproto = none
2. module configuration
Edit the/etc/modules. conf or/etc/moprobe. conf file.
Add the following lines
Alias bond0 Bonding
Options bond0 miimon = 100 mode = 1
3. Start Configuration
# Vi/etc/rc. d/rc. Local
Join
Ifenslave bond0 eth0 eth1
After the machine is restarted, use ifconfig-a to view the NIC configuration information. If you find that the MAC addresses and IP addresses of the three NICs bond0, eth0, and eth1 are the same, that's all done.
4. test and verification
Ping test is performed on a machine with the same external network segment. Manually unplug any network line (or use IFUP eth0 & ifdown eth1) on the dual-nic machine. The terminal for ping should have no interruption information, or if a "timeout" is restored quickly, the test is successful.