It is very painful to set up the virtual machine to be unable to connect to the Internet. Here I will talk about the personal experience of ubuntu's NAT Internet access. If other bridge connections are not used, there is no experience.
ubuntu version: ubuntu-16.04-desktop-amd64.iso
1. View/set the network under NAT
Open VMware Workstation and click Edit-Virtual Network Editor to view the network in NAT mode.
As shown in the figure below, if you don’t like the automatically assigned subnet IP, you can click to restore the default settings, but it will still be assigned automatically and you cannot set it yourself.
Click NAT settings, view the subnet IP subnet mask and view and set the gateway IP
Click DHCP settings, you can view and set the automatically assigned IP range, and the manually assigned IP is in these IPs.
2. Set the IP of the virtual machine
Click VMware Workstation virtual machine -> Settings to open the virtual machine settings
Set the network connection to NAT connection mode
Turn on the virtual machine, enter the graphical interface, and click the network up and down arrow symbol at the top right. The icon wired connection 1 is the currently used network. If there are other networks you can connect to other networks
We click Edit Connections below to enter the IP settings.
Select the IP to be edited, click Edit, enter the network setting interface
Select IPv4 Settings, enter the network settings interface, and select Method:
Automatic is automatic allocation, we choose Manual in order to fix our network fixed;
Click Add below to add a network, including setting Address (IP address) NetMask and Gateway
Where Address is the IP range in the DHCP of the NAT interface of the virtual network editor, Netmask is the subnet mask in the DHCP, and Gateway is the gateway in the NAT setting.
After the setting is complete, save and exit, click the network up and down arrow in the upper right corner, click Disconnect, and then select the network we set up, here is wired connection 1.
It is equivalent to reloading the network configuration file to access the network.
Now we check the IP of the network;
Ping the IP of [Host] (https://cloud.tencent.com/product/cdh?from=10680), not the NAT network, (but the IP of the host itself), Ping Baidu
PING host IP and Baidu results
Networking effect:
prompt:
If you can ping the IP but cannot ping Baidu or other domain-based pings, it means that there is no tool to resolve this domain name. We need to set the domain name server IP in the virtual machine:
View the host's IP domain name server address 210.22.70.3
Set the IP of the DNS server in the virtual machine network settings: this should be fine
The above is the whole content of this article, I hope it will be helpful to everyone's study.
Recommended Posts