vi /etc/sysconfig/network-scripts/ifcfg-eno16777736
HWADDR=00:0C:29:8D:24:73
TYPE=Ethernet
BOOTPROTO=static #启用静态IP地址
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
NAME=eth0
UUID=ae0965e7-22b9-45aa-8ec9-3f0a20a85d11
DEVICE=eth0
ONBOOT=yes #开启自动启用网络连接
IPADDR=192.168.21.128 #设置IP地址
PREFIX=24 #设置子网掩码
GATEWAY=192.168.21.2 #设置网关
DNS1=8.8.8.8 #设置主DNS
# service network restart //重启网卡服务