How to ping Windows and VM without connecting the network cable

  
        Under normal circumstances, if the network port of the host host is connected to the network cable and can access the Internet, then according to the default installation of the VM, select the Bridged connection mode in the VM-Settings-Hardware-Network Adapter-Network connection, and pay attention to close the firewall under the window, then Windows and VM are easy to ping directly, but when the network port of the host host is not connected to the network, it is not so easy to ping each other. The author just encountered such a problem in a project: The host host network port can not connect to the network cable The Windows system on the host host and the Ubuntu system on the VM must be bound to the IPv6 address. Here is the analysis of the problem, and at the same time, propose a solution to the problem. . Www.dnzg.cn VM network connection methods are Bridged, NAT, Host-only and Custom, below to see the first three connections (the last one I have not figured out). Bridged: The bridge connects the virtual machine to the LAN on which the host is located. This is the easiest way for a virtual machine to access the network where the host is located. In this case, the virtual machine needs its own independent identity. For example, the TCP/IP network needs its own IP address. This IP address is obtained from the network administrator. There are other network details that need to be manually set. In the bridge mode, the virtual machine is a separate entity in the local network, just like a host machine, just like a physical machine. If you run multiple virtual machines simultaneously in vmware, each virtual machine should have a separate IP address. NAT (Network Address Translation NAT Device): If the network where the host is located cannot give the virtual machine an IP address, then NAT is the easiest way for the virtual machine to access the host network. Since the virtual machine does not have an IP address of the external physical network, vmware establishes a separate private network on the host and obtains an ip address through the virtual DHCP server. NAT can distinguish network data of multiple virtual machines and transfer between virtual machines and external physical networks. Many standard TCP/IP protocols in NAT mode can be used on virtual machines, such as HTTP/FTP/TELET. However, by default, computers on the external network cannot connect to the virtual machine, so the virtual machine cannot provide services such as WEB browsing. Host-only: This mode allows the virtual machine to communicate with the host, but this virtual adapter will not connect to any external network. Only special software such as a proxy server can be set up on the host to virtualize it. The adapter is connected to the physical adapter. In fact, the virtual machine only has a network connection with the host. In addition, it should be noted that the switch components are automatically installed as needed during the installation of the vmware software. Like a real switch, it allows multiple network components to be connected, allowing up to nine switches to be attached, named VMnet0-8. Three of them have been assigned to the bridge (VMnet0), the host virtual network adapter (VMnet1) and the network address translation NAT device (VMnet8) by default. VMnet0, VMnet1, and VMnet8 can be seen under Windows. However, when the host host pulls out the network cable, VMnet0 will automatically disappear and become invalid. This is why when the host host is not connected to the network cable, the Bridged mode is selected, and the windows and the VM cannot be pinged. The solution to this problem is also very clear: Select NAT mode, VM selects the IP address of VMnet8 when pinging windows. Select Host-only mode, and VM selects the IP address of VMnet1 when pinging windows. The last tip is: When the Ubuntu of the VM is bound to the IP, it is best to bind the IPv4 and IPv6 addresses, even if only IPv6 is required, because only the IPv6 IP address is bound. When the network is connected, the specified NIC may be bound. Not on.
Copyright © Windows knowledge All Rights Reserved