The solution to the problem of Ubuntu--nat in virtual machine

Source: Internet
Author: User

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 below, if you do not like the auto-assigned subnet IP can be clicked to restore the default settings, but will be automatically assigned, not set by itself.


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.



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.