Solution to the problem that ubuntu cannot connect to the Internet in the virtual machine

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

Solution to the problem that ubuntu cannot connect to the Internet in the virtual machine
Solution to the virtual machine ubuntu16.04 cannot connect to the Internet
Xshell and Xftp fail to connect to the virtual machine Ubuntu
Install Ubuntu 18.04 in the virtual machine VMware
Solution to ubuntu unable to surf the Internet after plugging in the network cable
Solution for Ubuntu unable to connect to the network
How to make the ubuntu virtual machine in vmware display in full screen
The same solution for cloning ubuntu18 virtual machine ip
Solve the problem that the Ubuntu 17.10 settings panel cannot be opened
About solving the problem that ubuntu cannot resolve the domain name
The ubuntu 16.04 system perfectly solves the problem that pip cannot be upgraded
centos7 cannot connect to the external network
Solve the problem that Centos8 cannot install docker
Explain the solution to the Ubuntu 16.04 launcher icon exception
Use the command to solve the Ubuntu projector problem:
The solution to the failure to install .deb under Ubuntu 16.04
How to open the ubuntu system in win10
Use Ubuntu and windows system in virtual machine
Remotely connect to MySQL database in Ubuntu environment
Introduction to the use of Hanlp in ubuntu
How to create a CentOS virtual machine in VMware
How to create a CentOS virtual machine in VMware
Solution to the slow speed of ubuntu18.04 wireless network
How to create a Python virtual environment in Ubuntu 14.04
How to control the ubuntu system in win10 through ssh
Mac uses vnc to remotely log in to the ubuntu16.04 desktop
Detailed steps to automatically set the line number in ubuntu16.04
Encountered in the process of building a virtual environment in ubuntu
Explain the solution to the freeze when ubuntu dual system starts
Ubuntu14.04 creates Genymotion virtual machine
Virtual machine VirtualBox-5.1 install ubuntu16.0.1
How to fix the problem of missing system settings on Ubuntu 14.04