
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/

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

4. Restart the network
service network restart
5. Test whether the ping is successful
ping www.baidu.com

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!
Statement:The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn