分页: 1 / 1

ping中出现dup,如何解决

发表于 : 2011-02-19 12:08
chenjun
请教一个问题,我在OB下按照官方手册做trunk

代码: 全选

# ifconfig bge0 up
# ifconfig bge1 up
# ifconfig trunk0 trunkport bge0 trunkport bge1192.168.1.1 netmask 255.255.255.0
trunk0生成后,ping 192.168.1.2时出现许多dup,在网上查了一下,没有找到明确的解决方法,请高手指点一下,如何才能解决此问题

发表于 : 2011-02-20 3:51
leo
我用的是千兆交换,平时的传输速度接近硬盘的极限,所以还没有设置过trunk, 还真不清楚,哪天试试吧,有关trunk:http://network.ccidnet.com/art/3723/200 ... 817_1.html
CU上也有类似的讨论,看看是否可以帮助你,http://www.chinaunix.net/jh/30/465794.html

发表于 : 2011-02-21 8:35
chenjun
OB官方手册上trunk可以实现双网卡故障转移,功能我实现了,可是就是在ping同一网段是出现大量dup,很是费解,trunk官方手册http://www.openbsd.org/cgi-bin/man.cgi? ... ormat=html

发表于 : 2011-02-22 3:36
leo
chenjun 写了:OB官方手册上trunk可以实现双网卡故障转移,功能我实现了,可是就是在ping同一网段是出现大量dup,很是费解,trunk官方手册http://www.openbsd.org/cgi-bin/man.cgi? ... ormat=html
环境i386 4.9:
我在接路由器设置时,网络时断时续,接switch时设置,根本ping不通(参考example 1),不知道是什么原因,我再仔细看看man。
该用户手册的最后有警告:

代码: 全选

CAVEATS
     The trunk protocols loadbalance and roundrobin require a switch which
     supports IEEE 802.3ad static link aggregation; otherwise protocols such
     as inet6(4) duplicate address detection (DAD) cannot properly deal with
     duplicate packets.
     There is no way to configure LACP administrative variables, including
     system and port priorities.  The current implementation always performs
     active-mode LACP and uses 0x8000 as system and port priorities.

发表于 : 2011-02-22 10:10
chenjun
非常感谢,可能是OB中trunk的问题吧,我也在换种环境测试一下。做端口故障转移时,如果仅在一个端口上接网线,就不会出现DUP的问题

发表于 : 2011-02-22 10:29
leo
chenjun 写了:非常感谢,可能是OB中trunk的问题吧,我也在换种环境测试一下。做端口故障转移时,如果仅在一个端口上接网线,就不会出现DUP的问题
我这里确实不好确认,因为路由器采用dhcp分配IP地址,而switch是最简单的D-link DGS-2205,我也不清楚是否满足man的基本条件,因为默认是roundrobin模式,我并不清楚我的switch是否支持所谓的“IEEE 802.3ad static link aggregation”。

发表于 : 2011-02-23 3:42
leo
查阅了一下switch的说明, 支持该特性,又尝试了一下“外网——路由器——交换机——主机”的方式,发现可以使用trunk, trunk0可以ping其它内网主机,其它非OpenBSD主机也可以ping通trunk0所在主机,没有你所说的显示dup现象,是否你的trunk0所在主机的总线速度过小?

代码: 全选

# cat /etc/hostname.re0
dhcp
# cat /etc/hostname.re1
dhcp
# 
# ifconfig trunk0 trunkproto failover trunkport re0 trunkport re1 192.168.2.88 netmask 255.255.255.0
# ifconfig
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 33200
        priority: 0
        groups: lo
        inet 127.0.0.1 netmask 0xff000000
        inet6 ::1 prefixlen 128
        inet6 fe80::1%lo0 prefixlen 64 scopeid 0x6
dc0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> mtu 1500
        lladdr 00:08:a1:13:d9:b9
        priority: 0
        media: Ethernet autoselect (none)
        status: no carrier
re0: flags=8b43<UP,BROADCAST,RUNNING,PROMISC,ALLMULTI,SIMPLEX,MULTICAST> mtu 1500
        lladdr 00:18:e7:17:e1:b8
        priority: 0
        trunk: trunkdev trunk0
        groups: egress
        media: Ethernet autoselect (1000baseT full-duplex,rxpause,txpause)
        status: active
        inet6 fe80::208:a1ff:fe13:d9b9%re0 prefixlen 64 scopeid 0x2
        inet 192.168.2.100 netmask 0xffffff00 broadcast 192.168.2.255
re1: flags=8b43<UP,BROADCAST,RUNNING,PROMISC,ALLMULTI,SIMPLEX,MULTICAST> mtu 1500
        lladdr 00:18:e7:17:e1:b8
        priority: 0
        trunk: trunkdev trunk0
        media: Ethernet autoselect (1000baseT full-duplex,rxpause,txpause)
        status: active
        inet6 fe80::208:a1ff:fe13:d9b9%re1 prefixlen 64 scopeid 0x3
        inet 192.168.2.35 netmask 0xffffff00 broadcast 192.168.2.255
xl0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> mtu 1500
        lladdr 00:b0:d0:e4:97:14
        priority: 0
        media: Ethernet autoselect (none)
        status: no carrier
enc0: flags=0<>
        priority: 0
        groups: enc
        status: active
pflog0: flags=141<UP,RUNNING,PROMISC> mtu 33200
        priority: 0
        groups: pflog
trunk0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
        lladdr 00:18:e7:17:e1:b8
        priority: 0
        trunk: trunkproto failover
                trunkport re1
                trunkport re0 master,active
        groups: trunk
        media: Ethernet autoselect
        status: active
        inet 192.168.2.88 netmask 0xffffff00 broadcast 192.168.2.255
        inet6 fe80::218:e7ff:fe17:e1b8%trunk0 prefixlen 64 scopeid 0x8
#
# ping 192.168.2.33
PING 192.168.2.33 (192.168.2.33): 56 data bytes
64 bytes from 192.168.2.33: icmp_seq=0 ttl=128 time=1.199 ms
64 bytes from 192.168.2.33: icmp_seq=1 ttl=128 time=0.447 ms
64 bytes from 192.168.2.33: icmp_seq=2 ttl=128 time=0.433 ms
64 bytes from 192.168.2.33: icmp_seq=3 ttl=128 time=0.474 ms
64 bytes from 192.168.2.33: icmp_seq=4 ttl=128 time=1.127 ms
64 bytes from 192.168.2.33: icmp_seq=5 ttl=128 time=0.452 ms
64 bytes from 192.168.2.33: icmp_seq=6 ttl=128 time=0.454 ms
64 bytes from 192.168.2.33: icmp_seq=7 ttl=128 time=0.558 ms
64 bytes from 192.168.2.33: icmp_seq=8 ttl=128 time=0.439 ms
64 bytes from 192.168.2.33: icmp_seq=9 ttl=128 time=0.442 ms
64 bytes from 192.168.2.33: icmp_seq=10 ttl=128 time=0.454 ms
64 bytes from 192.168.2.33: icmp_seq=11 ttl=128 time=0.481 ms
64 bytes from 192.168.2.33: icmp_seq=12 ttl=128 time=0.647 ms
64 bytes from 192.168.2.33: icmp_seq=13 ttl=128 time=0.445 ms
64 bytes from 192.168.2.33: icmp_seq=14 ttl=128 time=0.440 ms
64 bytes from 192.168.2.33: icmp_seq=15 ttl=128 time=0.451 ms
64 bytes from 192.168.2.33: icmp_seq=16 ttl=128 time=0.448 ms
64 bytes from 192.168.2.33: icmp_seq=17 ttl=128 time=0.846 ms
64 bytes from 192.168.2.33: icmp_seq=18 ttl=128 time=0.459 ms
64 bytes from 192.168.2.33: icmp_seq=19 ttl=128 time=0.460 ms
64 bytes from 192.168.2.33: icmp_seq=20 ttl=128 time=0.461 ms
64 bytes from 192.168.2.33: icmp_seq=21 ttl=128 time=0.452 ms
64 bytes from 192.168.2.33: icmp_seq=22 ttl=128 time=0.438 ms
64 bytes from 192.168.2.33: icmp_seq=23 ttl=128 time=0.441 ms
64 bytes from 192.168.2.33: icmp_seq=24 ttl=128 time=0.452 ms
64 bytes from 192.168.2.33: icmp_seq=25 ttl=128 time=0.467 ms
64 bytes from 192.168.2.33: icmp_seq=26 ttl=128 time=0.456 ms
64 bytes from 192.168.2.33: icmp_seq=27 ttl=128 time=0.444 ms
64 bytes from 192.168.2.33: icmp_seq=28 ttl=128 time=0.442 ms
64 bytes from 192.168.2.33: icmp_seq=29 ttl=128 time=0.444 ms
64 bytes from 192.168.2.33: icmp_seq=30 ttl=128 time=0.449 ms
64 bytes from 192.168.2.33: icmp_seq=31 ttl=128 time=0.474 ms
64 bytes from 192.168.2.33: icmp_seq=32 ttl=128 time=0.463 ms
64 bytes from 192.168.2.33: icmp_seq=33 ttl=128 time=0.458 ms
64 bytes from 192.168.2.33: icmp_seq=34 ttl=128 time=1.068 ms
64 bytes from 192.168.2.33: icmp_seq=35 ttl=128 time=0.447 ms
64 bytes from 192.168.2.33: icmp_seq=36 ttl=128 time=0.451 ms
64 bytes from 192.168.2.33: icmp_seq=37 ttl=128 time=0.471 ms
--- 192.168.2.33 ping statistics ---
38 packets transmitted, 38 packets received, 0.0% packet loss
round-trip min/avg/max/std-dev = 0.433/0.524/1.199/0.193 ms
#
其它问题:
1. 同一网段的另一台OpenBSD主机却无法ping通trunk0主机——即便双方均禁用了PF, 我这里只能用桥接的搭建在windows下虚拟OpenBSD主机,也许和这个有关系。不过同样环境下的windows主机也可以同样与trunk0所在主机相互ping通,而且没有dup信息出现。原因待查。
2. 不太稳定,过几个小时后可能就ping不出去了。

发表于 : 2011-02-23 8:44
chenjun
1.我这边没有网络设备,我是在虚拟机上做的该实验,实验模式就是“OB服务器——客户机”,看了4楼你给我的回复,我估计是虚拟机不支持IEEE 802.3ad static link aggregation,上网搜了一下,发现好多在虚拟机上实现LACP的,现在我也说不清到底是那块出了问题。
2.我实验时,把re0、re1的IP清空了,等于虚拟了一个trunk0端口,来代替re0和re1的出口,如果re0、re1都有ip的话,你上面得到的数据会不会不是从trunk0出来的.

发表于 : 2011-02-23 8:55
leo
至少不应该全是虚拟机的问题,我的trunk0主机有时候也ping不出去,不知道是否和dhcp分配IP的方式有关,我的机器一直是由路由器自动分配IP地址,找机会试试手动分配看看结果。此外我测试用的同一个局域网的主机尽管在虚拟机(virrualbox)内,不过用windows主机ping的通而且没有dup现象,所以估计问题也不在虚拟机上,应该还是OpenBSD自己的问题。