When you cannot connect to the Internet, there are times when you need to do some experimentation to require that the host system and the virtual system interconnect. At this point, you can solve the demand by configuring the loopback network card. This article describes a brief step, starting with the Internet.
First of all, the reason for this is to evade the research on VMware Network settings. When our work is not focused on the network, there is no need to study the network mechanism too much, consume a lot of time.
I use the host system is Win7 Home Premium, Virtual machine system is CentOS, virtual machine system network card set to bridge. The virtual machine uses VMware player.
Initial state: Cell Broadband, Win7 local connection automatically obtains IP address via DHCP. The two virtual network adapters (VMNET1/VMNET8) that were automatically added when VMware was installed are disabled in Win7. After the virtual machine is started, the virtual system is also assigned an IP address because the network card of the virtual system is set to bridge, and the host system can also communicate with the host system on the Internet at the same time.
1 if you want to simulate a broken network in the state of the test, then unplug the network cable.
2 Add loopback network card:
2.1 Control Panel-Device Manager (Device Manager)
2.2 Right-click on the machine name (or left button to select the machine name, then menu bar action)-Add Legacy hardware (seemingly translated is to add outdated hardware.) )
2.3 The previous step will pop up an Add Hardware wizard window. Click Next-Select the manual installation option, next-Select network adapters (network adapter), next
2.4 Select the Microsoft Loopback network card, as shown below, and then next:
2.5 start installation, after the installation of the control Panel in the network connection appears a new NIC, Microsoft Loopback network card. The default should be enabled, if not, enabled.
3 as the first step to unplug the network cable, the virtual machine should be connected to the state of failure. At this time ifconfig view eth0 should be no IPv4 address. Arbitrarily set an address: Ifconfig 192.168.6.2
4 Accordingly, reset the IP address of the loopback network card just added to the host Win7 system as shown below (of course the address to be set to the same network segment as the virtual machine)
5 after setting, start the ping bar:
Can ping pass, set up.
Now, in the case of network disconnection, the host system and the virtual system can interconnect. What if you plug in the cable at this time?
When the network cable is plugged in, the host's local connection is connected to the Internet. But the virtual machine is not connected. How to make the virtual machine can also go to the Internet. The first step is to disable the loopback network card for the host system. The second step is to restart the Network service in the virtual system: Service network restart. These two steps cannot be reversed. Under normal circumstances, the virtual system restart network services, you can connect to the Internet.