Home  >  Article  >  Operation and Maintenance  >  How to solve the problem that CentOS7 cannot connect to the Internet

How to solve the problem that CentOS7 cannot connect to the Internet

WJ
WJOriginal
2020-06-02 16:26:542827browse

How to solve the problem that CentOS7 cannot connect to the Internet

How to solve the problem that CentOS7 cannot connect to the Internet?

I downloaded CentOS 7 and installed it in the virtual machine. I found that I could not connect to the Internet and kept prompting Cannot find a valid baseurl for repo: base/7/x86_64

How to solve the problem that CentOS7 cannot connect to the Internet

Share here how to solve this problem.

Step1, modify the configuration file

使用 vi 编辑器修改 /etc/sysconfig/network-scripts/ifcfg-eth0
进入 /etc/sysconfig/network-scripts 目录
cd /etc/sysconfig/network-scripts打开配置文件
vi ifcfg-ens33这里可能你的文件名不是这个,但是找前面是 ifcfg-ens 的就是了
将文件里的 ONBOOT=no,改为ONBOOT=yes,然后保存并退出(不要忘记保存!!)

How to solve the problem that CentOS7 cannot connect to the Internet

How to solve the problem that CentOS7 cannot connect to the Internet

##Step2, restart the network service

After the modification is completed The network service needs to be restarted for it to take effect. Use the following command.

service network restart

Related references:

centOS tutorial

The above is the detailed content of How to solve the problem that CentOS7 cannot connect to the Internet. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn