Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What if the ubuntu in the virtual machine cannot be connected to the Internet?

2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

The purpose of this article is to share with you what to do if the ubuntu in the virtual machine cannot be connected to the Internet. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.

It is very painful to set up virtual machines that cannot be connected to the Internet. Here I would like to talk about my personal experience on the NAT Internet access problem of ubuntu. There will be no experience without other bridge connections.

Ubuntu version: ubuntu-16.04-desktop-amd64.iso

1. View / set the network of 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 auto-assigned subnet IP, you can click to restore the default settings, but it will be automatically assigned and cannot be set by yourself.

Click NAT Settings to view the subnet IP subnet mask and view and set the gateway IP

Click DHCP Settings to view and set the automatically assigned IP range, and the manually assigned IP is later used in these IP.

two。 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, where wired connection 1 is the network currently in use. If there are other networks that can connect to other networks

Let's click the Edit Connections below to enter the IP settings.

Select the IP you want to edit, click Edit to enter the network settings interface

Select IPv4 Settings, enter the network settings interface, and select the method of Method:

Automatic is automatically assigned, and we choose Manual for our network immobilization.

Click the Add below to add the network, including setting up Address (IP address) NetMask and Gateway

Address is the IP range in the NAT interface of the virtual network editor DHCP, Netmask is the subnet mask in DHCP, and Gateway sets the gateway in NAT.

After setting up, 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 we choose wired connection 1.

It is equivalent to reloading the network profile to access the network.

Now let's take a look at the IP of the network

The IP of the host under ping is not the network of NAT (but the IP of the host itself). Ping Baidu.

Results of IP and Baidu of PING host

Networking effect:

Tip:

If you can ping IP but not ping Baidu or other domain name-oriented ping, it means there is no tool to resolve the domain name. We need to set the domain name server IP in the virtual machine:

View the IP domain name server address 210.22.70.3 of the host

Set the IP of the DNS server in the virtual machine network settings: this should be fine

Thank you for reading! This is the end of the article on "what to do if the ubuntu cannot be connected to the Internet in the virtual machine". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it for more people to see!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report