# 在/etc/sysconfig/network-scripts 目录下找到需要修改的网卡文件

TYPE=Ethernet
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=ens33
UUID=57e6dfae-b9e3-4ac5-8981-1cb51dbb9fda
DEVICE=ens33
ONBOOT=yes
PROXY_METHOD=none
BROWSER_ONLY=no
DNS1=114.114.114.114
HWADDR=00:0C:29:14:7A:7F
IPADDR=192.168.244.29
GATEWAY=192.168.244.2
PREFIX=24

设置完毕,重启网卡

#  有时修改后网卡重启失败,此时需要停掉networkmanager服务

systemctl stop NetworkManager

systemctl disable NetworkManager