Three Modes of VMware workstation network connection

Source: Internet
Author: User
ArticleDirectory
    • 2. Bridging Network
    • 3. Nat Network
    • 4. How to modify the NAT network ID

Always use VmwareWorkstationTo test different operating systems locally. In the past, I was not clear about the three network connection modes. I have read several articles to understand them. The following is a summary:

1. VMWare Workstation Virtual Network Components

Virtual <NIC/network adapter>:See. A virtual <network adapter/network adapter> is automatically installed when a virtual PC is installed. You can add multiple virtual NICs.
Vswitch:See. 10 vswitches are automatically installed when the VM is installed.
Virtual Bridge:A virtual bridge is applied only when the virtual network card is connected to the vmnet0 (default bridged) vswitch.

 

Virtual DHCP server:See. When a virtual Nic is connected to a vmnet1 or vmnet8 vswitch, the virtual DHCP server is automatically installed and connected to the vswitch.

Virtual Nat Server:See. The virtual Nat server is automatically installed and connected to this vswitch only when the virtual Nic is connected to the vmnet8 (NAT) vswitch.

Host virtual <NIC/network adapter>:See. It is equivalent to an existing NIC that is used to connect the host and vswitch. "Border = 0 alt =" vmware workstation host virtual "src =" http://www.storageonline.com.cn/wp-content/uploads/2011/04/VMwareWorkstationvirtualPCNICs_thumb.jpg "width = 644 Height = 351>

VMWareAfter the installation, a virtual DHCP server will assign an IP address and a virtual Nat server to map the internal address to the external address of the host. It is actually a system service, enter services. MSC, you will see the two services:

■ Vmnet0: This isVMWareUsed for Virtual Switches under a virtual bridge network;
■ Vmnet1: This is the virtual switch used by VMware in the Virtual Host-only network;
■ Vmnet8: This is the virtual switch that VMware uses for the virtual Nat network;
■ VMware network adapter vmnet1: This is the virtual Nic used by the host to communicate with the host-only virtual network;
■ VMware network adapter vmnet8: This is the virtual Nic used by the host to communicate with the NAT virtual network;

2. Bridging Network

Topology:

In this way, the physical Nic of the host and the NIC of the guest are directly bridging through the virtual bridge on the vmnet0 switch, which is similar to binding two different addresses to the next Nic of Linux, in fact, you can set the NIC to the hybrid mode to listen to multiple IP addresses.
In this mode, the NIC (for example, eth0 in Linux) inside the VM is directly connected to the network where the physical Nic is located, and the VM and host are in the same status, the network relationship is equal, so the Virtual Machine network cannot be controlled.

The physical Nic configuration of my host is as follows:

The IP address is obtained through DHCP, And the gateway is 192.168.0.1.

Therefore, guest and host should be in the same network segment, and their configuration can be:

3. Nat Network

Topology:

In this way, a virtual Nic vmnet8 (by default) appears inside the host. vmnet8 is equivalent to the NIC connected to the Intranet, and the VM itself is equivalent to a machine running on the Intranet, the network adapter (eth0) in the virtual machine is independent of vmnet8.

In a NAT network, the vmnet8 virtual switch is used. The VMware network adapter vmnet8 virtual Nic on the host is connected to the vmnet8 switch to communicate with guest, however, the VMware network adapter vmnet8 virtual network card is only used to communicate with the vmnet8 network segment. It does not provide routing functions for the vmnet8 network segment, the guest in the virtual Nat network is connected to the Internet using the virtual Nat server.

The IP address of my VMware network adapter vmnet8 virtual Nic is configured as follows: (the IP address is manually specified and is an IP address automatically assigned by VMware during installation)

The IP address of the virtual machine in the NAT network is also 192.168.152.0. The IP address is configured as follows:

In this way, the DHCP service provided by VMware is loaded to the vmnet8 interface by default, so that virtual machines can use the DHCP service. More importantly, VMWare comes with the NAT service, provides address translation from vmnet8 to the Internet. Therefore, a real Nat server is running, but it is only for virtual machines. Obviously, this method is suitable if you only have one Internet address.

One thing to note is that in a NAT network, the gateway of guest points192.168.x.2In this example, x = 152 is the address of the virtual Nat server. This server is a virtual Nat server. You can ping it, but cannot access this virtual machine, because it is also a system service:

At this time, your guest and host can achieve mutual access, and if your host has been connected to the Internet, then your guest can be connected to the Internet. So what role does the VMware network adapter vmnet8 virtual Nic play here? It only provides an interface for the communication between the host and the guest in the NAT virtual network. Therefore, even if the virtual network card is disable, the guest can still access the internet, only the host cannot access the vmnet8 CIDR block.

4. How to modify the NAT network ID

If the network allocated by VMware is not good, for example, it assigns you a network ID of 192.168.152.0 to vmnet8, you can modify it here and click the "host" menu on Vmware, select "virtual network settings ..."

I have adjusted vmnet8 here, so of course vmnet1 can also be adjusted in this way. Remember, the VMware network adapter vmnet1 and VMWare network adapter vmnet8 also need to be adjusted to the corresponding network ID, otherwise the host and guest cannot communicate.

5. Host-only Network

Topology:

This should be the most flexible side. If you are interested, you can conduct various network experiments. The only difference from Nat is that there is no address translation service in this mode. Therefore, by default, a virtual machine can only access the host, and of course it cannot access the Internet. This is also the meaning of the hostonly name.
By default, a DHCP service is also loaded to vmnet1. In this way, the virtual machine connected to vmnet8 can still be set to DHCP to facilitate system configuration.

This is the configuration of my host's VMware network adapter vmnet1 virtual NIC:

Host-onlyThe IP address of the virtual machine on the network is also 192.168.192.0. The IP address is configured as follows:

As you can see, in the Host-only network, the default gateway of guest is set to null, because no virtual Nat server is used.

6. Is it true? Host-only Network There is no way to connect to the Internet?

Of course not. In fact, this method is more flexible. You can use your own method to achieve the optimal configuration, for example:

A. Use your own Dhcp Service:First, stop the DHCP service provided by VMware to make the DHCP service more unified.
B. Use your own NAT:Easy to add to the firewall. Windows host can be used for Nat in many ways, such as Windows XP Internet sharing, and complex Nat services such as Windows server.
C. Use your own firewall:Because you have full control over vmnet1, you can add (or test) a firewall between the vmnet1 and the Internet Nic.

As you can see from the above, the hostonly mode is similar to the normal Nat server with the entire intranet, so you can easily conduct relevant experiments, such as setting a strong fire prevention.

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.