一: 修改网卡配置文件(操作前先备份一下该文件),/etc/sysconfig/network-scripts/
(1) cd /etc/sysconfig/network-scripts/
(2)编辑 网卡网卡 ifcfg-ens33
TYPE="Ethernet"
BOOTPROTO="static"
IPADDR=192.168.1.21
NETMASK=255.255.255.0
NETWORK=192.168.1.1
NAME="ens33"
ME="ens33"
ONBOOT="yes"
DNS1=192.168.1.1
#DEFROUTE="yes"
#PEERDNS="yes"
#PEERROUTES="yes"
#IPV4_FAILURE_FATAL="no"
#IPV6INIT="yes"
#IPV6_AUTOCONF="yes"
#IPV6_DEFROUTE="yes"
#IPV6_PEERDNS="yes"
#IPV6_PEERROUTES="yes"
#IPV6_FAILURE_FATAL="no"
#IPV6_ADDR_GEN_MODE="stable-privacy"
#NAME="ens33"
#UUID="59469ff2-89aa-4cb0-9304-bb1ca20c9db3"
#DEVICE="ens33"
#ONBOOT="yes"
二:修改网关配置文件,/etc/sysconfig/network 信息
[root@localhost sysconfig]# vi network
# Created by anaconda
NETWORKING=yes
NETWORKING_IPV6=no
HOSTNAME=localhost.localdomain
GATEWAY=192.168.1.1