在/etc/network/interfaces中增加:
auto eth0
iface eth0 inet static
address 192.168.2.170
netmask 255.255.255.0
gateway 192.168.2.1
最终的/etc/network/interfaces是:
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
address 192.168.2.170
netmask 255.255.255.0
gateway 192.168.2.1