1、修改/etc/network/interfaces文件内容
# interfaces(5) file used by ifup(8) and ifdown(8)auto loiface lo inet loopback auto eth1iface eth1 inet static address 192.168.0.20gateway 192.168.0.1netmask 255.255.255.0
2、刷新ip地址
ip addr flush eth1
3、重启网络接口
ifdown eth1ifup eth1
京公网安备 11010502049817号