参考:linux中设置固定ip(亲测有效)_王林冲的博客-CSDN博客_linux 固定ip
原有的:
[root@localhost packages]# cat /etc/sysconfig/network-scripts/ifcfg-ens33
TYPE=Ethernet
BOOTPROTO=static
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
IPV6_ADDR_GEN_MODE=stable-privacy
NAME=ens33
UUID=9f802a8b-b0ae-4807-aec1-2d5b1d35524d
DEVICE=ens33
ONBOOT=yes
DNS1=114.114.114.114
IPADDR=192.168.59.141
NETMASK=255.255.255.0
GATEWAY=192.168.59.255
DNS1=8.8.8.8