1. Modify the configuration file
Use vi editor to modify /etc/sysconfig/network-scripts/ifcfg-eth0
Enter /etc/ sysconfig/network-scripts directory
cd /etc/sysconfig/network-scripts
vi ifcfg-ens33 Your file name may not be this, but just look for the one with ifcfg-ens in front.
Change ONBOOT=no in the file to ONBOOT=yes, then save and exit (don’t forget to save!!)
After modification, it will look as follows:
2. Restart the network service
service network restart
Recommended related tutorials: centos tutorial
The above is the detailed content of What should I do if centos cannot connect to the Internet?. For more information, please follow other related articles on the PHP Chinese website!