修改網卡配置文件(操做前先備份一下該文件),/etc/sysconfig/network-scripts/ifcfg-enp0s3 ,以下:dom
TYPE=Ethernet BOOTPROTO=static IPADDR=192.168.1.101 NETMASK=255.255.255.0 NETWORK=192.168.1.0 NAME=enp0s3 DEVICE=enp0s3 ONBOOT=yes DNS1=114.114.114.114
默認該文件中還有其餘配置,能夠都刪除或註釋。spa
修改網關配置文件,/etc/sysconfig/network,以下:rest
# Created by anaconda NETWORKING=yes NETWORKING_IPV6=no HOSTNAME=localhost.localdomain GATEWAY=192.168.1.1
重啓服務code
systemctl restart networkblog