![centos7 cannot connect to the network](https://img.php.cn/upload/article/000/000/041/5e86a84b73d6e111.jpg)
1. Find the NAT settings, check the subnet ip, subnet mask, gateway
![1585883244563093.png centos7 cannot connect to the network](https://img.php.cn/upload/image/773/936/478/1585883244563093.png)
![1585883255914437.png centos7 cannot connect to the network](https://img.php.cn/upload/image/182/824/629/1585883255914437.png)
##2. Enter this directory and find the network configuration file
1 | cd /etc/sysconfig/network-scripts/
|
Copy after login
![1585883321914986.png centos7 cannot connect to the network](https://img.php.cn/upload/image/782/210/803/1585883321914986.png)
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)
![1585883372815159.png centos7 cannot connect to the network](https://img.php.cn/upload/image/974/351/492/1585883372815159.png)
4. Restart the network
5. Test whether the ping is successful
![1585883413663007.png centos7 cannot connect to the network](https://img.php.cn/upload/image/351/688/875/1585883413663007.png)
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!