1. Find the NAT settings, check the subnet ip, subnet mask, gateway
##2. Enter this directory and find the network configuration file
cd /etc/sysconfig/network-scripts/
Copy after login
3. Enter the file to perform relevant configuration
Note: gateway, subnet mask It must be consistent with the NAT configuration; the gateway and IP address must be in the same network segment as the subnet IP (that is, the first three numbers of the IP, for example: 192.168.152.xx)
vi ifcfg-ens33
Copy after login
4. Restart the network
service network restart
Copy after login
5. Test whether the ping is successful
ping www.baidu.com
Copy after login
Recommended related tutorials:
centos tutorial
The above is the detailed content of centos7 cannot connect to the network. For more information, please follow other related articles on the PHP Chinese website!