The difference between the three network connections in VMware

1 Overview

  After installing the virtual machine, two virtual network cards are installed by default, VMnet1 and VMnet8, as shown in the following figure. Among them, VMnet1 is the host network card, which is used to connect to the network in the host mode. VMnet8 is a NAT network card, which is used to connect to the network in NAT mode. Their IP addresses are randomly generated.

  VMware provides three working modes, they are bridged (bridged mode), NAT (network address translation mode) and host-only (host mode), as shown below. To apply them properly in network management and maintenance, you should first understand these three working modes.

2. bridged (bridged mode)

  In this mode, using the VMnet0 virtual switch, the virtual operating system is like an independent host in the local area network. Like the host computer, it can access any machine in the network. In bridge mode, you can manually configure its TCP/IP configuration information (IP, subnet mask, etc., and it must be in the same network segment as the host machine) to access the Internet through the gateway or router of the LAN; you can also set the The IP address and DNS are set to "Obtain automatically".

  If you want to use VMWare to create a new server in the LAN to provide Web or network services for LAN users, you should choose bridge mode.

  In bridge mode, the VMnet0 virtual switch is used. At this time, the virtual machine is equivalent to an independent computer and host on the network, and has an independent IP address.

  • A1, A2, A, B four operating systems can access each other
  • The IPs of A1 and A2 are "external network" IPs, which can be set manually or obtained automatically

3. NAT (Network Address Translation Mode)

  Using NAT mode is to let the virtual machine use the NAT (Network Address Translation) function to access the public network through the network where the host machine is located. That is to say, using NAT mode can achieve Internet access in a virtual system. The TCP/IP configuration information of the virtual machine in NAT mode is provided by the DHCP server of the VMnet8 virtual network, so the IP and DNS are generally set to "automatically obtain", so the virtual system cannot communicate with other real hosts in the local area network. communication.

  The biggest advantage of using NAT mode is that it is very simple for the virtual system to access the Internet. You do not need to perform any other configuration, only the host machine can access the Internet. If you want to use VMWare to install a new virtual system, you can directly access the Internet without any manual configuration in the virtual system, it is recommended that you use NAT mode.

  The Vmnet8 virtual switch is used in Nat mode. At this time, the virtual machine can "one-way access" other hosts on the network through the host, and other hosts cannot access the virtual machine. In NAT mode:

  • A1, A2 can access B
  • B cannot access A1, A2
  • A1, A2, A visit each other
  • The IPs of A1 and A2 are LAN IPs, which can be configured manually or obtained automatically

4. host-only (host mode)

In the host-only mode, the virtual machine can only communicate with the virtual machine and the host, but the virtual machine and the external network are isolated, that is, they cannot access the Internet. In host-only mode, the TCP/IP configuration information (such as IP address, gateway address, DNS server, etc.) of the virtual system is dynamically allocated by the DHCP server of the VMnet1 virtual network. Use host-only mode:

  • A, A1, A2 can visit each other
  • A1, A2 cannot access B
  • B cannot access A1, A2
  • A1 and A2 are LAN IPs, which can be manually configured or set to automatic acquisition mode

In the three modes, the IP of the virtual machine can be set to be obtained automatically. Once obtained automatically, it will not change (unless manually configured), that is, the IP after the next restart is the same as the last time.

5. Explanation of the replicate physical network connection state option

  Select if the virtual machine uses a bridged network connection and if you use the virtual machine on a laptop or other mobile device. As you move from one wired or wireless network to another, the IP address is automatically renewed.

  When a single machine with multiple network cards or a laptop and a mobile device uses a virtual machine, when switching between wired network and wireless network, check Replicate physical network connection state, and the IP address of the virtual machine network card will be automatically updated, and there is no need to reset it.

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326853074&siteId=291194637