Environment Description:
Physical Machine: win7 flagship edition 64bit
VMWare Version: vmwareworkstation 8
Virtual Machine System Version: centos5.5
Network Connection Mode: Host-only
Test Description:
Ping the IP address 192.168.64.20 of the centos VM on the physical machine. If any network card is down, the network remains smooth.
Test conditions:
Install centos.
Set the host-only network.
Add one Nic to centos (two NICs in total ).
Configure the network.
Steps:
1. Install the Operating System (omitted)
2. Add the host-only Network
Select Edit from the menu bar of VMware and select virtualnetwork editor from the drop-down menu.
In the pop-up window, click the Add network button to add a network (vmnet1 added in the experiment), and specify the added vmnet1 connection method as host-only. Click OK. Pay attention to the network field assigned to the user. The field in the experiment is 192.168.64.0.
A vmnet1 Nic is generated in the "Network Connection" of the physical machine after the VM is added.
View vmnet1 details. You can ping this address in cmd.
3. Add a second Nic for centos.
Select the virtual machine to operate, click VM in the menu, and select Settings from the drop-down menu
In the pop-up window, click "add" (as shown in the following figure ).
Select the network adapter, that is, "network adapter ". Next
Select Custom and specify the network vmnet1. Click Finish.
After the configuration is complete. Both NICs must set the network to wmnet1. Click OK to complete Nic addition.
After the VM is added, start the VM. Two NICs are displayed in the status bar in the lower right corner of the VM.
4. boot with root login, check the/etc/sysconfig/network-scripts folder, whether there are ifcfg-bond0, ifcfg-eth0, ifcfg-eth1 three files, add and modify, if the modification exists. The modified content of the three files is as follows:
[Root @ GP network-Scripts] # PWD/etc/sysconfig/network-scripts [root @ GP network-Scripts] # More ifcfg-bond0DEVICE = bond0 # mode = 1 indicates the active/standby mode, mode = 0 indicates the Server Load balancer mode bonding_opts = "mode = 1 miimon = 500" bootproto = noneonboot = yes # The network settings are determined by the host-only parameter set earlier. Broadcast = 192.168.64.255ipaddr = 192.168.64.20netmask = 255.255.255.0network = 192.168.64.0userctl = No
[Root @ GP network-Scripts] # More ifcfg-eth0 # Intel Corporation 82545em gigabitethernet controller (copper) device = eth0bootproto = nonehwaddr = 00: 0C: 29: A8: 19: CB # MAC address onboot = yesmaster = bond0slave = yesuserctl = No [root @ GP network-Scripts] # More ifcfg-eth1 # Intel Corporation 82545em gigabitethernet controller (copper) device = eth1bootproto = noneonboot = yeshwaddr = 00: 0C: 29: A8: 19: d5master = bond0slave = yesuserctl = No
After modification, restart the network service,
# Service network restart
Test:
When the physical machine is pinged to the IP address of the virtual machine, the connection to one of the NICS is disconnected.
The network is slightly jittery and then returns to normal immediately.
When the network card connection is restored, the following prompt is displayed:
This completes the test.
Doubt:
When you use the command ifconfigdown eth0 or ifdwon eth0 to disconnect the NIC for testing, the network may be disconnected, and even the physical machine and virtual machine cannot communicate with each other. If the connection fails, you can restart the network service, disconnect the network, and reconnect again.