免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 3018 | 回复: 5
打印 上一主题 下一主题

上不去网的怪问题 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2008-08-11 22:37 |只看该作者 |倒序浏览
我的提问有很多代码,因为就是这些代码令我不解,请帮帮忙,谢谢大家了。因为使用了VIRTUALBOX,所以在UBUNTU 8.04中设置了桥接,重启机后不能上网,ifconfig内容如下

br0       Link encap:Ethernet  HWaddr 00:1b:24:85:e1:61  
          inet addr:192.168.0.68  Bcast:192.168.0.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:46 errors:0 dropped:0 overruns:0 frame:0
          TX packets:66 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:4096 (4.0 KB)  TX bytes:7751 (7.5 KB)

eth0      Link encap:Ethernet  HWaddr 00:1b:24:85:e1:61  
          UP BROADCAST RUNNING PROMISC MULTICAST  MTU:1500  Metric:1
          RX packets:55 errors:0 dropped:0 overruns:0 frame:0
          TX packets:69 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:4838 (4.7 KB)  TX bytes:7957 (7.7 KB)
          Interrupt:17

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:44 errors:0 dropped:0 overruns:0 frame:0
          TX packets:44 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:2440 (2.3 KB)  TX bytes:2440 (2.3 KB)

tap0      Link encap:Ethernet  HWaddr 00:ff:50:95:b1:31  
          UP BROADCAST RUNNING PROMISC MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:93 overruns:0 carrier:0
          collisions:0 txqueuelen:500
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
其中bro中的inet addr:192.168.0.68为我以前设置的。现在已经不是了,但为什么br0还没有改过来?
我使用ping 192.168.1.1
PING 192.168.1.1 (192.168.1.1) 56(84) bytes of data.
From 192.168.1.103 icmp_seq=1 Destination Host Unreachable
From 192.168.1.103 icmp_seq=2 Destination Host Unreachable
From 192.168.1.103 icmp_seq=3 Destination Host Unreachable
然后使用sudo /etc/init.d/networking restart
内容如下
* Reconfiguring network interfaces...                                          RTNETLINK answers: No such process
SIOCDELRT: No such process
RTNETLINK answers: No such process
SIOCDELRT: No such process
Set 'tap0' persistent and owned by uid 1000
device br0 already exists; can't create bridge with the same name

Waiting for br0 to get ready (MAXWAIT is 32 seconds).
此时还是上不去网,我又一次使用sudo /etc/init.d/networking restart
* Reconfiguring network interfaces...                                          
RTNETLINK answers: No such process
Set 'tap0' persistent and owned by uid 1000

Waiting for br0 to get ready (MAXWAIT is 32 seconds).
此时就可以上网了,而这时的ifconfig内容变为
br0       Link encap:Ethernet  HWaddr 00:1b:24:85:e1:61  
          inet addr:192.168.1.62  Bcast:192.168.1.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:431 errors:0 dropped:0 overruns:0 frame:0
          TX packets:99 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:28789 (28.1 KB)  TX bytes:41019 (40.0 KB)

eth0      Link encap:Ethernet  HWaddr 00:1b:24:85:e1:61  
          UP BROADCAST RUNNING PROMISC MULTICAST  MTU:1500  Metric:1
          RX packets:544 errors:0 dropped:0 overruns:0 frame:0
          TX packets:278 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:37351 (36.4 KB)  TX bytes:59224 (57.8 KB)
          Interrupt:17

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:131 errors:0 dropped:0 overruns:0 frame:0
          TX packets:131 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:7949 (7.7 KB)  TX bytes:7949 (7.7 KB)

tap0      Link encap:Ethernet  HWaddr 00:ff:50:95:b1:31  
          UP BROADCAST RUNNING PROMISC MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:570 overruns:0 carrier:0
          collisions:0 txqueuelen:500
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
这到底是怎么回事呢?

论坛徽章:
0
2 [报告]
发表于 2008-08-11 22:40 |只看该作者
/etc/network/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

# The primary network interface
auto eth0
#iface eth0 inet dhcp

iface eth0 inet static
address 192.168.1.103
netmask 255.255.255.0
gateway 192.168.1.1

auto tap0
iface tap0 inet manual
up ifconfig $IFACE 0.0.0.0 up
down ifconfig $IFACE down
tunctl_user smouse

auto br0
iface br0 inet static
address 192.168.1.62
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.1
bridge_ports all tap0

论坛徽章:
0
3 [报告]
发表于 2008-08-12 09:44 |只看该作者
急等回音,帮帮忙啦,十分感谢

论坛徽章:
0
4 [报告]
发表于 2008-08-12 10:08 |只看该作者
从文件上没看出问题,如果你的UBUNTU是装在虚拟机上的,感觉应该是你是虚拟机的问题,可以删除虚拟机网卡,重新设置下看看

论坛徽章:
0
5 [报告]
发表于 2008-08-12 22:49 |只看该作者
唉,可是我的UBUNTU不是装的虚拟机上啊,很奇怪的是为什么重启机后br0的网址是以前设置的,而两次sudo /etc/init.d/networking restart后br0的IP就变为我正常设置的了?

论坛徽章:
0
6 [报告]
发表于 2008-08-13 14:26 |只看该作者
还是看不出什么问题.不好意思!
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP