vim /etc/sysconfig/network-scripts/ifcfg-ens33
ifcfg-ens33 内容:
TYPE="Ethernet"
PROXY_METHOD="none"
BROWSER_ONLY="no"
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="55657833-2764-4b12-8670-b799fdb06ea8"
DEVICE="ens33"
ONBOOT="yes"
IPADDR=192.168.45.211
GATEWAY=192.168.45.2
NETMASK=255.255.255.0
DNS1=114.114.114.114
DNS2=8.8.8.8
service network restart
原文:https://www.cnblogs.com/mergy/p/14216826.html