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

Quickly solve the problem that CentOS is unable to access the Internet in VMware

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

Share

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

Yesterday, I installed CentOS7 under VMware. I wanted to use ftp to upload the tomcat package, but I found that I didn't install ftp, so I used the "yum-y install vsftpd" command to install it, but it prompted me that I didn't have my network!?

At first I thought it was a problem with the mirror server, but later I found that there was no way to connect to the network through ping. Since many settings are default, and the virtual machine is also the default NAT mode, sharing the network with the host computer, it should not be a problem with the VMware setting. After consulting a lot of information on the Internet, the ultimate reason is the disaster caused by the default installation. The specific ways to deal with it are as follows:

Enter the network configuration file directory: cd / etc/sysconfig/network-scripts

List the contents of the directory: ls (L next to K, neither 1 nor I)

Then look at the file under the directory, there is an ifcfg-ens33, usually this ifcfg-ens33, the environment is different "ens" after the "33" may also be other numbers.

Open it for editing through the "vi" command: vi ifcfg-ens33

Note: most tutorials on the Internet are edited with the "vim" command. During the test, I found that "vim" was not installed, and then to find out how to install "vim" tutorials, in the end, you still have to download online, so use the "vi" command here.

There will be a long list of English, but if you can understand the last line for a long time, remind us to enter and press "ENTER".

At this point, position the cursor to the last line and change the item ONBOOT=no to ONBOOT=yes.

Enter the command:: wq to save

The ": wq" entered in the input mode will be recognized as text, first press "ESC" to convert the pattern, and then type:: wq to save.

Finally, enter the command: service network restart to restart the network service.

Summary

The above is introduced by the editor to quickly solve the problem that CentOS can not surf the Internet in VMware. I hope it will be helpful to you. If you have any questions, please leave me a message and the editor will reply you in time. Thank you very much for your support to the website!

If you think this article is helpful to you, you are welcome to reprint it, please indicate the source, thank you!

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