BOOTPROTO=dhcp
ONBOOT=yes
systemctl restart network
BOOTPROTO=static ONBOOT=yes
IPADDR=192.168.1.160 NETMASK=255.255.255.0 GATEWAY=192.168.1.1 DNS1=119.29.29.29 DNS2=8.8.8.8
DNS服务器可以只配一个。
systemctl restart network
原文:https://www.cnblogs.com/jxl1996/p/10134884.html