[root@localhost network-scripts]# vi /etc/sysconfig/network-scripts/ifcfg-enp4s0
HWADDR=D8:CB:8A:66:E7:1E
HWADDR=D8:CB:8A:66:E7:1E
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
NAME=ens0
UUID=46667ae3-ce55-4141-8017-e8f9f89fca33
ONBOOT=yes
IPADDR0=192.168.18.117
PREFIXO0=24
GATEWAY0=192.168.18.1
DNS1=8.8.8.8
DNS2=8.8.4.4
转载于:https://blog.51cto.com/kangxi/2050574