How to solve the problem that CentOS7 connection network is unreachable?
1. Enter ifconfig
Check the network card status
2. Edit /etc/sysconfig/network- scripts/ifcfg-xxx
File
Input vi /etc/sysconfig/network-scripts/ifcfg-ens33
(This ens33 is the name of the Ethernet card corresponding to the picture above , some may be ifcfg-eth0)
Change ONBOOT=no
to ONBOOT=yes
Press the Esc key and enter :wq , save and exit.
3. Restart the network
Enter service network restart
to restart the network.
4. Enter ifconfig again
Check the network card
You should see the inet information in the Ethernet configuration, and you can now access the Internet.
Related references: centOS tutorial
The above is the detailed content of How to solve the problem that CentOS7 connection network is unreachable. For more information, please follow other related articles on the PHP Chinese website!