上不去网的怪问题

包含网卡/无线网的网络问题和ADSL/校园网/宽带拨号支持及代理/共享等网络使用问题
回复
头像
M2WOW
帖子: 175
注册时间: 2008-01-23 11:13

上不去网的怪问题

#1

帖子 M2WOW » 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)
这到底是怎么回事呢?


[/code]
头像
M2WOW
帖子: 175
注册时间: 2008-01-23 11:13

#2

帖子 M2WOW » 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
头像
M2WOW
帖子: 175
注册时间: 2008-01-23 11:13

#3

帖子 M2WOW » 2008-08-12 9:44

急等回音阿
回复