Home >Operation and Maintenance >CentOS >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
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,然后保存并退出(不要忘记保存!!)##Step2, restart the network serviceAfter the modification is completed The network service needs to be restarted for it to take effect. Use the following command.
service network restartRelated references:
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!