把IP變為static
BOOTPROTO="static"
IPADDR="192.168.217.136"
最後,重啟網路
systemctl restart network
[root@centos01 conf]# cat /etc/sysconfig/network-scripts/ifcfg-ens33
TYPE="Ethernet"
PROXY_METHOD="none"
BROWSER_ONLY="no"
BOOTPROTO="static"
IPADDR="192.168.217.136"
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="66f67a60-38d0-4c79-9d05-886cca432242"
DEVICE="ens33"
ONBOOT="yes"
[root@centos01 conf]#