vim /etc/network/interfaces
添加如下内容
# interfaces(5) file used by ifup(8) and ifdown(8) auto lo iface lo inet loopback auto ens33 iface ens33 inet static address 192.168.1.111 gateway 192.168.1.1 netmask 255.255.255.0
gateway是网关可写可不写,注意ens33是ifconfig中的网卡的名字;



