Ubuntu version: Ubuntu-16.04-desktop-amd64.iso
Setting up a virtual machine can not be networked is very painful, here I on the internet of Ubuntu Nat on the personal experience, other bridge connection and so on without the use of experience.
1. View/Set the network under NAT
Open VMware Workstation,
Click Edit-Virtual network editor to view the NAT mode network.
As shown, if you do not like the auto-assigned subnet IP can be clicked to restore the default settings, but will be automatically assigned, can not set their own.
Click Nat settings, view the subnet IP subnet mask, and view and set the gateway IP
By clicking on DHCP settings, you can view and set the IP ranges that are automatically assigned, followed by manually assigned IPs in those IPs.
2. Set the IP of the virtual machine
Click VMware Workstation Virtual Machines---settings, turn on virtual machine settings
To set the network connection as a NAT connection
Turn on the virtual machine, go to the graphical interface, click the network up and down arrow symbol in the upper right, which shows that wired connection 1 is the network currently in use. If there are other networks that can connect to other networks
We click on the edit connections below to enter the IP settings.
Select the IP you want to edit and click Edit to enter the network Settings screen
Select IPv4 Settings, go to the Network Settings screen, select method:
Automatic for automatic allocation, we are in order to be our network immobilization, choose Manual;
Click on Add network below, including set address (IP address) netmask and Gateway
Where address is the IP range in DHCP for the Virtual Network editor NAT interface, netmask is the subnet mask in DHCP, and gateway is the one inside the NAT setting.
After Setup is complete, save exit, click the network up and down arrow in the upper right corner, click Disconnect, then select the network we set up, here is wired connection 1.
Equivalent to reloading under Network configuration file access network.
Now we look at the IP of the network;
Ping the host IP, not the NAT network, (but the host itself's IP), ping Baidu
PING host IP and Baidu results
Networking effects:
Tips:
If you can ping the IP and not ping Baidu or other domain-based ping, then it means that there is no tool to resolve the domain name, we need to set the name server IP in the virtual machine:
View the IP Name server address of the host 210.22.70.3
Set the IP of the DNS server in the virtual machine network settings: So it should be.
The solution to the problem of Ubuntu--nat in virtual machine