LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 1258|回复: 2

虚拟网卡干扰正常上网,请帮忙给看一下。

[复制链接]
发表于 2006-11-6 16:10:15 | 显示全部楼层 |阅读模式
虚拟网卡干扰正常上网,请帮忙给看一下。

今天更新系统之后出现虚拟网卡干扰正常上网的现象,以前没有发生过这种情况。

  1. apt-get update; apt-get -y upgrade; apt-get -y dist-upgrade
复制代码


如下是网卡配置文件,

  1. wolfkin:~# cat /etc/network/interfaces
  2. # This file describes the network interfaces available on your system
  3. # and how to activate them. For more information, see interfaces(5).

  4. # The loopback network interface
  5. auto lo
  6. iface lo inet loopback

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

  12. # The primary network interface
  13. allow-hotplug eth0
  14. iface eth0 inet dhcp

  15. # Bridge for QEMU
  16. auto br0
  17. iface br0 inet dhcp
  18.         pre-up /sbin/ifconfig eth0 up
  19.         network 192.168.1.0
  20.         bridge_ports eth0
  21.         # bridge_fd 9
  22.         # bridge_hello 2
  23.         # bridge_maxage 12
  24.         # bridge_stp off
复制代码


如下是启动以后,执行的命令及其结果,

  1. wolfkin:~# ping -c 3 192.168.1.1
  2. PING 192.168.1.1 (192.168.1.1) 56(84) bytes of data.
  3. From 192.168.1.130 icmp_seq=1 Destination Host Unreachable
  4. From 192.168.1.130 icmp_seq=2 Destination Host Unreachable
  5. From 192.168.1.130 icmp_seq=3 Destination Host Unreachable

  6. --- 192.168.1.1 ping statistics ---
  7. 3 packets transmitted, 0 received, +3 errors, 100% packet loss, time 2010ms
  8. , pipe 3
  9. wolfkin:~# ifconfig
  10. br0       Link encap:Ethernet  HWaddr 00:50:8D:60:6A:3A  
  11.           inet addr:192.168.1.130  Bcast:192.168.1.255  Mask:255.255.255.0
  12.           inet6 addr: fe80::250:8dff:fe60:6a3a/64 Scope:Link
  13.           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
  14.           RX packets:326 errors:0 dropped:0 overruns:0 frame:0
  15.           TX packets:7 errors:0 dropped:0 overruns:0 carrier:0
  16.           collisions:0 txqueuelen:0
  17.           RX bytes:23104 (22.5 KiB)  TX bytes:810 (810.0 b)

  18. eth0      Link encap:Ethernet  HWaddr 00:50:8D:60:6A:3A  
  19.           inet addr:192.168.1.130  Bcast:192.168.1.255  Mask:255.255.255.0
  20.           inet6 addr: fe80::250:8dff:fe60:6a3a/64 Scope:Link
  21.           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
  22.           RX packets:364 errors:0 dropped:0 overruns:0 frame:0
  23.           TX packets:96 errors:0 dropped:0 overruns:0 carrier:0
  24.           collisions:0 txqueuelen:1000
  25.           RX bytes:32613 (31.8 KiB)  TX bytes:7966 (7.7 KiB)
  26.           Interrupt:11 Base address:0xc000

  27. lo        Link encap:Local Loopback  
  28.           inet addr:127.0.0.1  Mask:255.0.0.0
  29.           inet6 addr: ::1/128 Scope:Host
  30.           UP LOOPBACK RUNNING  MTU:16436  Metric:1
  31.           RX packets:26 errors:0 dropped:0 overruns:0 frame:0
  32.           TX packets:26 errors:0 dropped:0 overruns:0 carrier:0
  33.           collisions:0 txqueuelen:0
  34.           RX bytes:2810 (2.7 KiB)  TX bytes:2810 (2.7 KiB)
  35. wolfkin:~# ifdown br0
  36. br0: port 1(eth0) entering disabled state
  37. eth0: Promiscuous mode enabled.
  38. device eth0 left promiscuous mode
  39. br0: port 1(eth0) entering disabled state
  40. wolfkin:~# ping -c 3 192.168.1.1
  41. connect: Network is unreachable
  42. wolfkin:~# ifconfig
  43. lo        Link encap:Local Loopback  
  44.           inet addr:127.0.0.1  Mask:255.0.0.0
  45.           inet6 addr: ::1/128 Scope:Host
  46.           UP LOOPBACK RUNNING  MTU:16436  Metric:1
  47.           RX packets:26 errors:0 dropped:0 overruns:0 frame:0
  48.           TX packets:26 errors:0 dropped:0 overruns:0 carrier:0
  49.           collisions:0 txqueuelen:0
  50.           RX bytes:2810 (2.7 KiB)  TX bytes:2810 (2.7 KiB)
  51. wolfkin:~# ifup eth0
  52. ifup: interface eth0 already configured
  53. wolfkin:~# ifdown eth0
  54. wolfkin:~# ifup eth0
  55. Internet Software Consortium DHCP Client 2.0pl5
  56. Copyright 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium.
  57. All rights reserved.

  58. Please contribute if you find this software useful.
  59. For info, please visit http://www.isc.org/dhcp-contrib.html

  60. sit0: unknown hardware address type 776
  61. eth0: link up, 100Mbps, full-duplex, lpa 0x45E1
  62. sit0: unknown hardware address type 776
  63. Listening on LPF/eth0/00:50:8d:60:6a:3a
  64. Sending on   LPF/eth0/00:50:8d:60:6a:3a
  65. Sending on   Socket/fallback/fallback-net
  66. DHCPREQUEST on eth0 to 255.255.255.255 port 67
  67. DHCPACK from 192.168.1.62
  68. bound to 192.168.1.130 -- renewal in 43200 seconds.
  69. wolfkin:~# ifconfig
  70. eth0      Link encap:Ethernet  HWaddr 00:50:8D:60:6A:3A
  71.           inet addr:192.168.1.130  Bcast:192.168.1.255  Mask:255.255.255.0
  72.           inet6 addr: fe80::250:8dff:fe60:6a3a/64 Scope:Link
  73.           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
  74.           RX packets:454 errors:0 dropped:0 overruns:0 frame:0
  75.           TX packets:104 errors:0 dropped:0 overruns:0 carrier:0
  76.           collisions:0 txqueuelen:1000
  77.           RX bytes:41254 (40.2 KiB)  TX bytes:9049 (8.8 KiB)
  78.           Interrupt:11 Base address:0xc000

  79. lo        Link encap:Local Loopback
  80.           inet addr:127.0.0.1  Mask:255.0.0.0
  81.           inet6 addr: ::1/128 Scope:Host
  82.           UP LOOPBACK RUNNING  MTU:16436  Metric:1
  83.           RX packets:26 errors:0 dropped:0 overruns:0 frame:0
  84.           TX packets:26 errors:0 dropped:0 overruns:0 carrier:0
  85.           collisions:0 txqueuelen:0
  86.           RX bytes:2810 (2.7 KiB)  TX bytes:2810 (2.7 KiB)
  87. wolfkin:~# ping -c 3 192.168.1.1
  88. PING 192.168.1.1 (192.168.1.1) 56(84) bytes of data.
  89. 64 bytes from 192.168.1.1: icmp_seq=1 ttl=255 time=3.38 ms
  90. 64 bytes from 192.168.1.1: icmp_seq=2 ttl=255 time=1.04 ms
  91. 64 bytes from 192.168.1.1: icmp_seq=3 ttl=255 time=1.21 ms

  92. --- 192.168.1.1 ping statistics ---
  93. 3 packets transmitted, 3 received, 0% packet loss, time 2001ms
  94. rtt min/avg/max/mdev = 1.048/1.883/3.383/1.062 ms
  95. wolfkin:~# ifup br0
  96. eth0: Promiscuous mode enabled.
  97. device eth0 entered promiscuous mode
  98. eth0: Promiscuous mode enabled.
  99. eth0: Promiscuous mode enabled.
  100. br0: port 1(eth0) entering learning state

  101. Waiting for br0 to get ready (MAXWAIT is 32 seconds).
  102. br0: topology change detected, propagating
  103. br0: port 1(eth0) entering forwarding state
  104. Internet Software Consortium DHCP Client 2.0pl5
  105. Copyright 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium.
  106. All rights reserved.

  107. Please contribute if you find this software useful.
  108. For info, please visit http://www.isc.org/dhcp-contrib.html

  109. sit0: unknown hardware address type 776
  110. sit0: unknown hardware address type 776
  111. Listening on LPF/br0/00:50:8d:60:6a:3a
  112. Sending on   LPF/br0/00:50:8d:60:6a:3a
  113. Sending on   Socket/fallback/fallback-net
  114. DHCPREQUEST on br0 to 255.255.255.255 port 67
  115. DHCPACK from 192.168.1.62
  116. bound to 192.168.1.130 -- renewal in 43200 seconds.
  117. wolfkin:~# ping -c 3 192.168.1.1
  118. PING 192.168.1.1 (192.168.1.1) 56(84) bytes of data.
  119. 64 bytes from 192.168.1.1: icmp_seq=1 ttl=255 time=2.93 ms
  120. 64 bytes from 192.168.1.1: icmp_seq=2 ttl=255 time=1.05 ms
  121. 64 bytes from 192.168.1.1: icmp_seq=3 ttl=255 time=3.18 ms

  122. --- 192.168.1.1 ping statistics ---
  123. 3 packets transmitted, 3 received, 0% packet loss, time 2000ms
  124. rtt min/avg/max/mdev = 1.059/2.391/3.183/0.947 ms
  125. wolfkin:~# ifconfig
  126. br0       Link encap:Ethernet  HWaddr 00:50:8D:60:6A:3A
  127.           inet addr:192.168.1.130  Bcast:192.168.1.255  Mask:255.255.255.0
  128.           inet6 addr: fe80::250:8dff:fe60:6a3a/64 Scope:Link
  129.           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
  130.           RX packets:7107 errors:0 dropped:0 overruns:0 frame:0
  131.           TX packets:5765 errors:0 dropped:0 overruns:0 carrier:0
  132.           collisions:0 txqueuelen:0
  133.           RX bytes:3017289 (2.8 MiB)  TX bytes:743612 (726.1 KiB)

  134. eth0      Link encap:Ethernet  HWaddr 00:50:8D:60:6A:3A
  135.           inet6 addr: fe80::250:8dff:fe60:6a3a/64 Scope:Link
  136.           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
  137.           RX packets:7980 errors:0 dropped:0 overruns:0 frame:0
  138.           TX packets:6363 errors:0 dropped:0 overruns:0 carrier:0
  139.           collisions:0 txqueuelen:1000
  140.           RX bytes:3501780 (3.3 MiB)  TX bytes:835899 (816.3 KiB)
  141.           Interrupt:11 Base address:0xc000

  142. lo        Link encap:Local Loopback
  143.           inet addr:127.0.0.1  Mask:255.0.0.0
  144.           inet6 addr: ::1/128 Scope:Host
  145.           UP LOOPBACK RUNNING  MTU:16436  Metric:1
  146.           RX packets:2231 errors:0 dropped:0 overruns:0 frame:0
  147.           TX packets:2231 errors:0 dropped:0 overruns:0 carrier:0
  148.           collisions:0 txqueuelen:0
  149.           RX bytes:255351 (249.3 KiB)  TX bytes:255351 (249.3 KiB)

  150. wolfkin:~# uname -a
  151. Linux wolfkin 2.6.16-2-686 #1 Fri Aug 18 19:01:49 UTC 2006 i686 GNU/Linux
  152. wolfkin:~# cat /proc/version
  153. Linux version 2.6.16-2-686 (Debian 2.6.16-18) (fs@debian.org) (gcc version 4.0.4 20060730 (prerelease) (Debian 4.0.3-6)) #1 Fri Aug 18 19:01:49 UTC 2006
复制代码
发表于 2006-11-6 19:39:14 | 显示全部楼层
试试用下面这个配置文件看看。
当启用桥模式的时候,与桥关联的物理网卡一般是不需要设置IP的,因为这个时候物理网卡是处于混杂模式的。而且只要物理网卡加入到桥中的时候,当桥启动的时候会自动将相应的物理网卡启用。

# 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

# Bridge for QEMU
auto br0
iface br0 inet dhcp
        bridge_ports eth0
        # bridge_fd 9
        # bridge_hello 2
        # bridge_maxage 12
        # bridge_stp off
回复 支持 反对

使用道具 举报

 楼主| 发表于 2006-11-7 13:21:41 | 显示全部楼层
行了!
非常感谢!
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表