Home > Article > Operation and Maintenance > What should I do if centos7 cannot access the Internet?
First enter the directory /etc/sysconfig/network-scripts
cd /etc/sysconfig/network-scripts/
and then find the name of the network card configuration file. This network card configuration file can be viewed through the ifconfig command. As shown below, the network card name of the virtual machine here is ens33.
Then use the ls command to view the network card configuration file name:
Then edit the last line of the ifcfg-ens33 file, Change ONBOOT=no to ONBOOT=yes, as shown below:
Finally enter: wq to save and exit, and then restart the network.
service network restart
Recommended tutorial: centos tutorial
The above is the detailed content of What should I do if centos7 cannot access the Internet?. For more information, please follow other related articles on the PHP Chinese website!