用路由器上网Ubuntu无法连接但是虚拟机里的XP却可以连接?[已解决:重启路由器]

系统安装、升级讨论
版面规则
我们都知道新人的确很菜,也喜欢抱怨,并且带有浓厚的Windows习惯,但既然在这里询问,我们就应该有责任帮助他们解决问题,而不是直接泼冷水、简单的否定或发表对解决问题没有任何帮助的帖子。乐于分享,以人为本,这正是Ubuntu的精神所在。
回复
头像
zwdnet
帖子: 348
注册时间: 2010-06-09 15:22

用路由器上网Ubuntu无法连接但是虚拟机里的XP却可以连接?[已解决:重启路由器]

#1

帖子 zwdnet » 2010-12-01 20:31

我用的是Ubuntu10.04,内核2.6.36-1,电脑是华硕EeePC1000H。
我上网是在大学宿舍里面,通过路由器7个人共享上网的,之前网络正常,一插上网线就可以连上了,IP地址是192.168.1.103之类的。今天网上,我上着上着网,突然一下子就断线了,再手动连接连不上了。其他人的网络正常。于是我就重启,但是重启后仍然连接不上。在断线的当时,我是开了浏览器,开了pps在看电影,同时开了wget在下载东西,另外我在终端里用"sudo nmap -O"命令想试试百度谷歌他们用什么操作系统,百度的试了,刚把谷歌的敲进去执行网络就断了,就再也连接不上了。不知道跟这个有没有关系。
重启后还连接不上,这是syslog里的相关日志:

代码: 全选

Dec  1 18:25:34 localhost kernel: [   45.922043] Skipping EDID probe due to cached edid
Dec  1 18:25:34 localhost kernel: [   45.959559] Skipping EDID probe due to cached edid
Dec  1 18:25:34 localhost kernel: [   46.024750] Skipping EDID probe due to cached edid
Dec  1 18:25:38 localhost kernel: [   49.914080] Skipping EDID probe due to cached edid
Dec  1 18:25:39 localhost dhclient: DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 5
Dec  1 18:25:44 localhost dhclient: DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 6
Dec  1 18:25:50 localhost dhclient: DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 12
Dec  1 18:26:02 localhost dhclient: DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 10
Dec  1 18:26:04 localhost NetworkManager: <info>  (eth0): DHCP transaction took too long, stopping it.
Dec  1 18:26:04 localhost NetworkManager: <info>  (eth0): canceled DHCP transaction, dhcp client pid 841
Dec  1 18:26:04 localhost NetworkManager: <info>  Activation (eth0) Stage 4 of 5 (IP4 Configure Timeout) scheduled...
Dec  1 18:26:04 localhost NetworkManager: <info>  Activation (eth0) Stage 4 of 5 (IP4 Configure Timeout) started...
Dec  1 18:26:04 localhost NetworkManager: <info>  (eth0): device state change: 7 -> 9 (reason 5)
Dec  1 18:26:04 localhost NetworkManager: <info>  Marking connection 'Auto eth0' invalid.
Dec  1 18:26:04 localhost NetworkManager: <info>  Activation (eth0) failed.
Dec  1 18:26:04 localhost NetworkManager: <info>  Activation (eth0) Stage 4 of 5 (IP4 Configure Timeout) complete.
Dec  1 18:26:04 localhost NetworkManager: <info>  (eth0): device state change: 9 -> 3 (reason 0)
Dec  1 18:26:04 localhost NetworkManager: <info>  (eth0): deactivating device (reason: 0).
我就想开XP看看,于是启动了VirtualBox里的XP,没想到可以连接上的。我现在就是在虚拟机里的XP里发帖。windows的本地连接状态里的连接信息为:

代码: 全选

地址类型: 通过DHCP指派
IP地址:   192.168.1.107
子网掩码: 255.255.255.0
默认网关: 192.168.1.1
再点详细信息为:

代码: 全选

实际地址: 08-00-27-BF-5A-A2
IP 地址: 192.168.1.107
子网掩码: 255.255.255.0
默认网关: 192.168.1.1
DHCP 服务器: 192.168.1.1
获得了租约: 2010-12-1 19:32:38
租约过期: 2010-12-1 21:32:38
DNS 服务器: 211.162.223.4, 222.172.200.68
WINS 服务器: 
而在Ubuntu终端里输ifconfig的结果为:

代码: 全选

zym@zym-freedom:~$ ifconfig
eth0      Link encap:以太网  硬件地址 00:22:15:75:c3:dd  
          inet6 地址: fe80::222:15ff:fe75:c3dd/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  跃点数:1
          接收数据包:222653 错误:0 丢弃:0 过载:0 帧数:0
          发送数据包:153753 错误:0 丢弃:0 过载:0 载波:2
          碰撞:0 发送队列长度:1000 
          接收字节:311062093 (311.0 MB)  发送字节:11248441 (11.2 MB)
          中断:41 

eth0:avahi Link encap:以太网  硬件地址 00:22:15:75:c3:dd  
          inet 地址:169.254.10.9  广播:169.254.255.255  掩码:255.255.0.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  跃点数:1
          中断:41 

lo        Link encap:本地环回  
          inet 地址:127.0.0.1  掩码:255.0.0.0
          inet6 地址: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  跃点数:1
          接收数据包:183934 错误:0 丢弃:0 过载:0 帧数:0
          发送数据包:183934 错误:0 丢弃:0 过载:0 载波:0
          碰撞:0 发送队列长度:0 
          接收字节:14162136 (14.1 MB)  发送字节:14162136 (14.1 MB)
而我的/etc/network/interfaces的内容就两行:

代码: 全选

auto lo
iface lo inet loopback
我在网上找了下,发现这个帖子http://forum.ubuntu.org.cn/viewtopic.php?f=116&t=162276 照其意思,改成

代码: 全选

auto lo
auto eth0
iface lo inet loopback
iface eth0 inet dhcp
netmask 255.255.255.0
gateway 192.168.1.1
然后执行

代码: 全选

zym@zym-freedom:~$ sudo /etc/init.d/networking restart
 * Reconfiguring network interfaces...                                           * Stopping the Firestarter firewall...
   ...done.
 * Starting the Firestarter firewall...
   ...fail!
run-parts: /etc/network/if-down.d/50firestarter exited with return code 2
RTNETLINK answers: No such process
There is already a pid file /var/run/dhclient.eth0.pid with pid 11720
killed old client process, removed PID file
Internet Systems Consortium DHCP Client V3.1.3
Copyright 2004-2009 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/

Listening on LPF/eth0/00:22:15:75:c3:dd
Sending on   LPF/eth0/00:22:15:75:c3:dd
Sending on   Socket/fallback
Internet Systems Consortium DHCP Client V3.1.3
Copyright 2004-2009 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/

Listening on LPF/eth0/00:22:15:75:c3:dd
Sending on   LPF/eth0/00:22:15:75:c3:dd
Sending on   Socket/fallback
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 6
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 8
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 16
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 20
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 11
No DHCPOFFERS received.
No working leases in persistent database - sleeping.
 * Stopping the Firestarter firewall...
   ...done.
 * Starting the Firestarter firewall...
   ...fail!
run-parts: /etc/network/if-up.d/50firestarter exited with return code 2
                                                                         [ OK ]
再用鼠标左键单击托盘区的网络图标,选"Auto eth0",还是连接不上。
我没辙了,特来请教,还要设置哪里啊?谢谢了!
上次由 zwdnet 在 2010-12-01 21:45,总共编辑 1 次。
您好,请多关照!
头像
zwdnet
帖子: 348
注册时间: 2010-06-09 15:22

Re: 用路由器上网Ubuntu无法连接但是虚拟机里的XP却可以连接?

#2

帖子 zwdnet » 2010-12-01 21:42

唉,搞来搞去,把/etc/network/interfaces恢复原状,浏览器里输192.168.1.1登陆路由器,重启路由器,连上了!
您好,请多关照!
回复