In the past two days, some computer problems have occurred. The host can ping the Internet IP address, but the virtual machine cannot, and the virtual machine cannot even ping the Host IP address, solved the problem. :) (The network adapter set for the virtual machine is a NAT connection)
First, you can temporarily disable both the host and the virtual machine firewall because the ping IP address is restricted by the firewall, then the virtual machine should be able to ping the Host IP address.
Second, you can modify the network configuration to solve the problem that the virtual machine cannot ping the internet.
To enable the network configuration, you can set the dynamic IP Address Allocation to solve the problem that the network cannot be pinged, but because my computer usually runs securecrt, if the dynamic IP Address Allocation is set, it is troublesome to reset the IP address for each connection, so it is set as a static IP address.
First, set the network to dynamically allocate IP addresses (Don't worry). In this way, you can first view the default gateway and run the route command. Set a static IP address for the network. You can set a static IP address with a network mask of 255.255.255.0. Then, set the default gateway in the next step. The default gateway address is obtained by running the route command and then click Next, the settings are complete. In this way, you can ping the internet.
For example, if the VM address is 192.168.12.12 and the host address is 192.168.1.109, use the route command to check the default gateway address 192.168.12.2. there is also a NAT address (which can be viewed through the VMware Virtual Ethernet adapter for vmnet8 Nic In the host network connection) 192.168.12.1. how does a virtual machine connect to the Internet? First, the virtual machine connects to the NAT address through the gateway, which is equivalent to a NIC of the host, so it can connect to the Internet.