What to do if CentOS7 cannot connect to the network
Step one: Modify the configuration file
Use vi editor to modify /etc/sysconfig/network-scripts/ifcfg-eth0
Enter the /etc/sysconfig/network-scripts directory (recommended learning: MySQL video tutorial)
cd /etc/sysconfig/network-scripts # 打开配置文件 vi ifcfg-ens33 # 这里可能你的文件名不是这个,但是找前面是 ifcfg-ens 的就是了
Change ONBOOT=no in the file to ONBOOT=yes, then save and exit (don’t forget to save!!)
Step 2: Restart the network service
After the modification is completed, you need to restart the network service for it to take effect. Use the following command.
service network restart
This article comes from the PHP Chinese website, CentOS usage tutorial column, please pay attention to this column for more related tutorials!
The above is the detailed content of What to do if CentOS7 cannot connect to the network. For more information, please follow other related articles on the PHP Chinese website!