debian配置静态ip

$ sudo vi /etc/network/interfaces

...

# The primary network interface

allow-hotplug eth0

#iface eth0 inet dhcp

iface eth0 inet static

address 192.168.10.168

netmask 255.255.255.0

gateway 192.168.10.1


$ sudo vi /etc/resolv.conf

nameserver 192.168.1.1

nameserver 192.168.10.1


$ sudo ifdown eth0

[note, 如果出现“ifdown: interface eth0 not configured”的错误,则在interfaces文件中加入auto eth0,然后重新执行 sudo /etc/init.d/networking restart

]

$ sudo ifup eth0

你可能感兴趣的:(IP,Debian,static)