Centos7 Network is unreachable 解决办法

安装完Linux系统后,无法上网 ping www.baidu.com 提示Network is unreachable
解决办法:
1、vi /etc/sysconfig/network-scripts/ifcfg-enp0s3 (后缀为本机自动生成)
TYPE=Ethernet
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=static
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
IPV6_ADDR_GEN_MODE=stable-privacy
NAME=enp0s3
UUID=fadf194d-7c3e-4b65-9ddc-8a0e780fc234
DEVICE=enp0s3
ONBOOT=yes
IPADDR=192.168.10.168
NETWORK=192.168.10.1
NETSTAT=255.255.255.0
GATEWAY=192.168.10.1
DNS1=8.8.8.8
DNS2=114.114.114.114

2、重启网卡 service network restart

你可能感兴趣的:(Centos7 Network is unreachable 解决办法)