分页: 1 / 1

[问题]网卡已激活,但仍然不能自动上网

发表于 : 2006-04-02 20:22
michaely
笔记本通过eth0连入局域网,每次开机后不能自动上网,在联网设置中可以
看到eth0已经激活,但要在默认网关那里选eth0才能上网。关机后再次出现同样的问题。

贴上我的interfaces:
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# This is a list of hotpluggable network interfaces.
# They will be activated automatically by the hotplug subsystem.
mapping hotplug
script grep
map eth0

iface eth0 inet static
address 10.11.0.2
netmask 255.255.225.0
gateway 10.11.0.1

auto eth0

#iface lo inet loopback

发表于 : 2006-04-02 20:32
eexpress
auto eth0

发表于 : 2006-04-02 20:57
michaely
加了auto eth0 后问题依旧。。。

发表于 : 2006-04-03 1:01
catinsnow
这样试试呢.

代码: 全选

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

auto eth0

iface eth0 inet static
address 10.11.0.2
netmask 255.255.225.0
gateway 10.11.0.1

发表于 : 2006-04-03 2:44
michaely
catinsnow 写了:这样试试呢.

代码: 全选

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

auto eth0

iface eth0 inet static
address 10.11.0.2
netmask 255.255.225.0
gateway 10.11.0.1
不行,问题照旧。
连接网页出现警告:当试图与XXX联系时,连接被拒绝。

发表于 : 2006-04-03 10:09
eexpress
ping?情况说清楚点。过路由吗?adsl?等。

发表于 : 2006-04-04 17:53
catinsnow
michaely 写了:
catinsnow 写了:这样试试呢.

代码: 全选

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

auto eth0

iface eth0 inet static
address 10.11.0.2
netmask 255.255.225.0
gateway 10.11.0.1
不行,问题照旧。
连接网页出现警告:当试图与XXX联系时,连接被拒绝。
添一行,配置一下DNS,试试.202.96.209.6可换为本地的DNS服务器IP.
dns-nameservers 202.96.209.6

发表于 : 2006-04-04 18:48
michaely
在gateway 下添加dns-nameservers 10.11.0.1后问题依旧。

具体情况是这样的,台机通过ADSL上网,笔记本通过双机互连线与台机
(IP:10.11.0.1)相连,在Windows下面按照这样设置没有问题(也加了dns)。

Ubuntu下启动后,可以ping通网关,但ping不到其他地方。
只有手动将联网设置那里的默认网关设置为eht0才能上网。

PS:无线网卡和拨号都禁用。

发表于 : 2006-04-13 0:10
xusamuel
正常的interfaces

代码: 全选

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# This is a list of hotpluggable network interfaces.
# They will be activated automatically by the hotplug subsystem.
mapping hotplug
	script grep
	map eth0

# The primary network interface
iface eth0 inet static
	address 172.18.23.176
	netmask 255.255.255.0
	network 172.18.23.0
[i]	[color=red]broadcast 172.18.23.255[/color][/i]
	gateway 172.18.23.1
	# dns-* options are implemented by the resolvconf package, if installed
	dns-nameservers 172.16.100.180
如果这样还是不能解决,自己用命令行修改,我发现在图形界面下修改ip并不会写入interfaces,而系统重启时候又每次调用这个脚本设置ip,所以上次的问题下一次还是会遇到.

我要在两个局域网内切换,以前从一个局域网换到另一个局域网时候也遇到你这样的问题,所以自己写了一个脚本修改ip,实际上就是调用ifconfig命令从底层修改网络设置,可以发给你作参考.