1.修改/etc/network/interfaces文件内容
source-directory /etc/network/interfaces.d
source interfaces.d/eth0
2.在/etc/network/interfaces.d/录下,添加文件eth0
3.eth0添加以下内容
auto eth0
iface eth0 inet static
address 192.168.1.129
netmask 255.255.255.0
gateway 192.168.1.1
dns0 114.114.114.114
4.如果是多网卡,重复1、2、3操作,配置多网卡静态IP和DNS
5.reboot重启系统,一切ok