Host installs the Linux operating system for Windows XP, VMware virtual machines. After installing VMware, there are two new connections in the host's network connection, that is, VMware network Adapter VMnet1 and VMware network Adapter VMnet8 as shown. The system that is installed in the virtual machine relies on these two virtual network cards to network. (pictured below)
A similar antiarp firewall on the host must be turned off or the virtual machine will not be able to surf
There are several options for this:
1, bridged (Network Bridge) way:
If the host is connected through the LAN, the virtual machine can use the same settings as the host network segment, Gateway and DNS, and choose an effective LAN IP.
Bridging way can realize virtual machine <---> Host virtual machine <----> Internet communication (Host and virtual machine can be regarded as two machines of the same LAN). However, bridging requires a different independent IP address from the original computer, which is difficult to do in some cases (IP and Mac bindings, network management Disagree). And after the host unplug the network cable, the virtual machine is unable to communicate with the host over the Internet. And the following few do not have this problem. So the bridging method is not used very much.
1 The IP information of the host
2 set VMware network connection as bridged
3 Virtual machine System Network Setup
Multi-NIC Bridge connection
When I have a dual NIC, although vmnet0:bridged to a automatically chosen adapter (in VMware's edit->virtual network Settings ...) Open Virtual network Editor)
However, I tried, the virtual machine can only bridge the "local Connection" (via network card), can not bridge the "local Connection 2" (Realtek network card)
In virtual network Editor-> Automatic bridging tab
If we want to bridge the "local Connection 2" (Realtek network card) need to "Exclude adapters" add "via Network card" (local connection), so "local connection 2" can be bridged. However, "local connection" (via network card) is not allowed, even in the "Exclude adapters" remove "via network card" also not, I guess VMware actually only supports a network card bridge was not initially excluded.
OK, we can Mapping select VMnet2 Network card in virtual network Editor-> Host virtual network Realtek tab
At this time, we return to the virtual network Editor-> Automatic bridging tab, found VMnet0 to the Realtek network card excluding
When bridging the "Local Area Connection" (via network card), VMware chooses VMnet0,
When bridging "local connection 2" (Realtek NIC), VMware chooses VMnet2
The corresponding setting on the virtual machine network is OK.
2, Nat mode:
Using the NAT and DHCP service provided by VMware, the virtual machine uses the virtual network card VMNET8 in the host as the gateway, and TCP/IP settings follow the DHCP and NAT settings for VMNET8 in the program. If the IP must be between the StartIP and EndIP of its DHCP settings, the gateway needs to use the gateway IP set by its NAT.
NAT can implement virtual machine <---> host communication, but the virtual machine---> Internet is only able to access the Internet virtual machine, but if you want to use the virtual machine as a server, let the Internet access, can not.
However, if you have more than one network card, the virtual machine can access multiple network cards connected to the Internet without changing the settings.
1) Set up VMware Network connection mode for NAT
2 in the virtual machine, Linux network settings, simply choose to automatically obtain IP, it can be.
Of course, you can also manually set:
IP settings and vmnet8 with the same network segment, gateway,netmask,broadcast settings and vmnet8 the same, DNS settings and host the same.
We are in the host's network connection as follows, did not see the gateway (below)
Don't worry, in VMware's edit->virtual network Settings ... , there are related content.
These tabs contain many of the advanced settings for VMware and are interested in research.
3.host-only Way:
The default use of Vmnet1, the virtual machine IP settings and Vmnet1 with the network segment, gateway set to Vmnet1 IP, the remaining settings and vmnet1 the same, DNS settings and host the same
such as Vmnet1 ip:192.168.101.1
Virtual machine settings: ip:192.168.101.100 gateway:192.168.101.1
This enables the virtual machine <---> host communication, but the virtual machine <---> The Internet is still unable to communicate
1 Choose VMware's Host-only
2 Local connection of the host
3 in virtual Machine Linux, set up the network
4, the way to share the host's Internet connection(If the host is a Win98 system may not be applicable):
Share an Internet connection in the advanced level of the host's local Area Connection attribute. If the VMNET1 virtual network card is selected, the Ethernet setting for VMware is host-only, and if VMnet8 is selected, NAT is required for Ethernet settings. After sharing the connection, The selected virtual network card IP will be set to the default 192.168.0.1 (if the host is also through the LAN 192.168.0.1 gateway to the Internet, you need to set this virtual network card to different IP, such as 192.168.1.1) at this time the virtual machine can be used as a gateway to the Internet 。 is actually a simple route NAT, so the NAT approach is not discussed, we only take host-only as an example.
Shared Host-only way to implement virtual machine <---> host communication, but the virtual machine---> Internet is only able to access the Internet virtual machine, but if you want to use the virtual machine as a server, so that Internet access, can not.
1 Choose VMware's Host-only
2 Set the host's local connection properties
The IP of the selected virtual network card is set to 192.168.0.1 by default, and it can be changed, of course. And when the shared connection is canceled, it changes back to the network settings before the shared connection.
In virtual machine Linux, set up the network:
Summarize:
Shared connection mode and Nat way, can realize virtual machine <---> host, virtual Machine---> Internet communication, Nat way set simple, and can access multiple physical network card simultaneously.
Bridging mode can implement virtual machine <---> Host virtual machine <----> Internet communication, if the virtual machine as a server, only this way feasible. But the independent IP to the virtual machine, and if the physical network card connection disconnect, virtual machine and host can not connect.
Host-only mode only implements the virtual machine <---> host communication, which is not used alone.
Like me under the virtual machine development embedded, virtual confidential to the Development Board to provide NFS services, the use of bridging to connect the embedded network card. If you want to download some software, check the data, use NAT mode, very convenient