Go Three modes of VMware Workstation network connectivity

Source: Internet
Author: User

Often to use the VMware Workstation to test different operating systems locally, it was not clear that the network connection three modes, recently read a few articles to calculate the understanding. It is summarized as follows:

1. Virtual Networking components for VMware workstation

Virtual < NIC/network adapter;: See. A virtual < NIC/network adapter is installed automatically when a Virtual PC is installed, and multiple virtual network cards can be added.
Virtual Switch: see. 10 virtual switches are installed automatically when the VM is installed.
Virtual Bridge: The Virtual Network Bridge is only applied when the virtual network card is connected to the VMnet0 (default bridged) virtual switch.

virtual DHCP server: see. When the virtual network card is connected to the VMNET1 or VMnet8 Virtual switch, the virtual DHCP server is automatically installed and connected to the virtual switch.

Virtual NAT server: see. The virtual NAT server is automatically installed and connected to this virtual switch only when the virtual network card is connected to the VMnet8 (NAT) Virtual switch.

host Virtual < NIC/network adapter;: See. The equivalent of a real network card, is the connection between the host and the Virtual Switch network card.

After VMware is installed, a virtual DHCP server assigns an IP address to the virtual machine and a virtual NAT server to map the internal address to the host's external address, which is actually a system service, starting with When you enter Services.msc in the run, you will see these two services:

VMnet0: This is the virtual switch used by VMware for virtual bridging networks;
VMnet1: This is the virtual switch used by VMware for virtual host-only networks;
VMnet8: This is the virtual switch that VMware uses for virtual NAT networks;
VMware Network Adapter VMnet1: This is the virtual network card that host uses to communicate with host-only virtual networks;
VMware Network Adapter VMnet8: This is the virtual NIC that host uses to communicate with the NAT virtual network;

2. Bridging the Network

Topology diagram:

In this way, the host's physical network card and guest's network card are bridged through the virtual bridge on the VMnet0 switch, and the Linux next network adapter binds two different addresses, in effect, the network card is set to promiscuous mode, which can achieve the ability to listen to multiple IPs.
In this mode, the inside of the virtual Machine network card (for example, Linux under the eth0) directly connected to the network of physical network card, virtual machine and host machine in the peer position, the network relationship is equal, and therefore cannot control the network of the virtual machine.

The physical NIC of my host is configured as follows:

The IP address is the DHCP acquisition, and the gateway is 192.168.0.1.

Then guest should be in the same network segment as host, which can be configured to:

3. Nat Network

Topology diagram:

In this way, there is a virtual network card Vmnet8 (by default), where the vmnet8 is equivalent to the network card connected to the intranet, and the virtual machine itself is the equivalent of running a network of machines, the virtual Machine network card (eth0) is independent of the vmnet8.

In a NAT network, a VMnet8 Virtual switch is used, and the VMware network Adapter VMnet8 virtual network card on host is connected to the VMNET8 switch to communicate with the guest, but the VMware network Adapter VMnet8 Virtual network card is only used for communication with the VMNET8 network segment, it does not provide the routing function for the VMNET8 network segment, the guest under the virtual NAT network is connected to the Internet using Virtual NAT server.

The IP address of my VMware network Adapter VMnet8 virtual network card is configured as follows: (the IP address is specified manually and is an IP address that is automatically assigned by VMware at the time of installation)

The IP address of the virtual machine for the NAT network is also 192.168.152.0 this segment, with the IP address configured as:

In this way, VMware's own DHCP is loaded into the Vmnet8 interface by default, so that the virtual machine can use the DHCP service, and more importantly, VMware has its own NAT service, which provides address translation from the Vmnet8 to the extranet. So this is a real NAT server running, just for virtual machines. Obviously, if you have only one extranet address, this approach is appropriate.

One thing to note is that in a NAT network, the guest gateway points to 192.168.x.2, in this case, x=152, the address of the virtual NAT server, which is a virtual NAT server, You can ping it, but you can't access the virtual machine because it's also a system service:

At this point, your guest and host will be able to exchange visits, and if your host is connected to the Internet at this time, your guest will be able to connect to the Internet. So what role does the VMware network Adapter VMnet8 virtual network card play here? It simply provides an interface for guest communication under the host and NAT virtual networks, so even if the disable off the virtual network card, guest is still able to surf the internet, but host can no longer access the VMNET8 network segment.

4. How to modify the NAT network ID

So if the network is not good for VMware distribution, such as it gives you a 192.168.152.0 network ID to VMnet8, then you can go here to modify, click on the "Host" menu on VMware, select "Virtual Network Settings ... ”

I am here to adjust the VMnet8, then VMnet1 of course can also be adjusted in this way. Remember, the VMware network Adapter VMnet1 and the VMware Network Adapter VMnet8 also need to be adjusted to the appropriate net ID, otherwise the host and guest cannot communicate.

5. host-only Network

Topology diagram:

This should be the most flexible side, if you are interested, you can conduct various network experiments. Unlike NAT, the only difference is that there is no address translation service in this way. Therefore, by default, the virtual machine can only be accessed by the host, which of course has no way to access the Internet, which is also the meaning of Hostonly's name.
By default, a DHCP service is also loaded onto Vmnet1. The virtual machine connected to the VMNET8 can still be set to DHCP, which facilitates the configuration of the system.

, this is the configuration of my host's VMware network Adapter VMnet1 virtual network card:

The IP address of the virtual machine for the host-only Network is also the 192.168.192.0 network segment with the IP address:

As you can see, under the Host-only network, the default gateway of guest is set to NULL, because the virtual NAT server is not used.

6. Is not host-only NetworkThere is no way to connect to the external network?

Of course not, in fact, this approach is more flexible. You can use your own way to achieve the most ideal configuration, for example:

A. Use your own DHCP service: first stop the VMware-brought DHCP service and make the DHCP service more uniform.
B. Use your own NAT: Easy to join the firewall. Windows host can do a lot of NAT, simple as a Windows XP Internet share, complex as a NAT service in Windows Server.
c. Use your own firewall: because you have complete control over the VMNET1, you can join (or experiment) the firewall between the VMNET1 and the extranet's network card.

As can be seen from the above, hostonly this mode is similar to the normal NAT server with the whole intranet, so you can easily carry out experiments related to it, such as fire-proof strong settings.

Part of this section is from the diagram of the VMware Workstation virtual network VMnet0, VMnet1, VMnet8, and the three modes of understanding network connectivity under VMware virtual machines.

Go Three modes of VMware Workstation network connectivity

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.