When we install VMware, VMware will automatically create one virtual machine network for each of the three network connection modes: VMnet0 (bridge mode), VMnet8 (NAT mode), and VMnet1 (host mode only). In addition, we can also create more virtual networks as needed.

VMware Bridging Mode

VMware bridging mode means that the virtual network adapter of the virtual machine is handed over to the physical network adapter of the host. The virtual network adapter in the virtual machine can directly access the external network through the physical network adapter in the host (such as the LAN and Internet shown in the figure, the same below). In short, it is like adding a new, independent computer to the LAN shown above. Therefore, the virtual machine will also occupy an IP address in the LAN and can access each other with other terminals. The bridge mode network connection supports wired and wireless host network adapters. If you want to treat the virtual machine as a completely independent computer and allow it to communicate with other terminals in the network, bridging mode is usually the simplest way for the virtual machine to access the network.

VMware NAT mode

NAT is the abbreviation of Network Address Translation, which means network address translation. NAT mode is also the default network connection mode for VMware to create virtual machines. When using NAT mode network connection, VMware will establish a separate private network on the host to communicate with each other between the host and the virtual machine. The request data "package" sent by the virtual machine to the external network will be sent to the NAT network adapter with a "special mark" and forwarded in the name of the host. The response data "package" returned by the external network is also received by the host first, and then sent to the NAT network adapter for identification according to the "special mark" and forwarded to the corresponding virtual machine. Therefore, The virtual machine does not have to have its own IP address in the external network. From the perspective of the external network, the virtual machine and the host share the same IP address. By default, the external network terminal cannot access the virtual machine.

In addition, only one virtual network in NAT mode is allowed on a host. Therefore, multiple virtual machines on the same host connected through the NAT mode network can also access each other.

As we mentioned earlier, by default, the external network cannot access the virtual machine. However, we can also manually modify the NAT settings to implement the port forwarding function, and forward the data sent from the external network to the specified port of the host to the specified virtual machine. For example, we have "established" a site on port 80 of the virtual machine. As long as we set the port forwarding and forward the data on port 88 of the host to port 80 of the virtual machine, the external network can access the site on port 80 of the virtual machine through port 88 of the host.

VMware host only mode

Host only mode is a more closed network connection mode than NAT mode. It will create a private network completely contained in the host. The host only virtual network adapter is visible only to the host and provides network connectivity between the virtual machine and the host system. Compared with the NAT mode, the host only mode does not have the NAT function. Therefore, by default, a virtual machine using the host only mode network connection cannot connect to the Internet (by installing appropriate routing or proxy software on the host, or using the Internet connection sharing function on the Windows system host, the virtual machine can still connect to the Internet or other networks).

Multiple host only virtual networks can be created on the same host. If multiple virtual machines are in the same host only network, they can communicate with each other; If they are in different host only networks, they cannot communicate with each other by default (they can communicate with each other by setting routers between them).