接口/静态IP问题 – Debian

我试图configuration我的Debian机器(Lenny)使用静态IP地址。 这是我的接口文件目前的样子:

# This file describes the network interfaces available on your system. # and how to activate them. For more information, see interfaces #The loopback network interface auto lo iface lo inet loopback auto eth0 iface eth0 inet static address 192.168.1.200 network 192.168.1.1 netmask 255.255.255.0 

这是我所做的。 我进入我的路由器设置,并将其dynamicIP范围更改为192.168.1.2到192.168.1.100。 所以我可以使用任何超过100作为我的静态地址。 然后,我进入了接口文件,并编辑到你上面看到的。 我将地址设置为192.168.1.200,因为这是我的路由器为dynamic地址保留的范围,我也将networking设置为192.168.1.1,因为这是我的路由器的IP地址。

我不知道我错了什么,但我没有连接到互联网。 我不确定我是否拥有正确的IP地址。

有任何想法吗?

您应该添加“网关192.168.1.1”并将networking条目更改为“networking192.168.1.0”。

还添加下面的configuration。

打开/etc/resolv.conf。 在其中使用nameserver指令来指定你的名字服务器。 nameserver指令将按照这里input的顺序进行search。 这里是一个例子:nameserver 192.168.1.2 nameserver 192.168.1.3