sudo vim /etc/sysconfig/network-scripts/ifcfg-ens33
TYPE="Ethernet"
PROXY_METHOD="none"
BROWSER_ONLY="no"
BOOTPROTO="none" #动态改成静态#
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="ens192"
UUID="0275b5b1-9524-46e6-88ce-eef69fe7afbc"
DEVICE="ens192"
ONBOOT="yes"
IPADDR="172.16.50.47" #静态IP地址#
PREFIX="16" #子网掩码
GATEWAY="172.16.1.1" #网关
DNS1="223.5.5.5" #DNS1
DNS2="223.6.6.6" #DNS2
IPV6_PRIVACY="no"
原文:https://www.cnblogs.com/pengpengboshi/p/13590430.html