查阅了一下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不出去了。