在/etc/network/interfaces.d/目錄下創(chuàng)建eth0,eth1文件
內(nèi)容分別為
auto eth0
? ? iface eth0 inet static
? ? ? ? address 192.168.18.36
? ? ? ? netmask 255.255.255.0
? ? ? ? gateway 192.168.18.1
auto eth1
? ? iface eth1 inet static
? ? ? ? address 192.168.18.37
? ? ? ? netmask 255.255.255.0
? ? ? ? gateway 192.168.18.1
重啟服務
sudo?service?networking?stop
sudo?service?networking?start