bridged tap interfaces with stp
Andrew Thompson
thompsa at FreeBSD.org
Mon Sep 22 15:43:09 UTC 2008
On Mon, Sep 22, 2008 at 05:00:59PM +0300, Sergey Listopad wrote:
> Hi!
>
> I am playing with bridge(4) stp feature.
>
> there are 2 boxes with 7.0-RELEASE-p4.
>
> rt1 rt2
> ___________ ___________
> | ____| |____ |
> | |tap1| ------------------------|tap1| |
> | | | |
> | |tap2|-------------------------|tap2| |
> |___________| |___________|
>
> rt1 connected to rt2 with 2 openvpn L2 links (tap).
>
> tap1 bridged with tap2 on both routers.
>
> rt1# ifconfig bridge0
> bridge0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
> ether 56:8d:35:75:ee:3f
> inet 3.3.3.1 netmask 0xffffff00 broadcast 3.3.3.255
> id 00:00:00:00:00:00 priority 32768 hellotime 2 fwddelay 15
> maxage 20 holdcnt 6 proto rstp maxaddr 100 timeout 1200
> root id 00:00:00:00:00:00 priority 32768 ifcost 0 port 0
> member: tap2 flags=143<LEARNING,DISCOVER,AUTOEDGE,AUTOPTP>
> member: tap1 flags=143<LEARNING,DISCOVER,AUTOEDGE,AUTOPTP>
>
> rt2# ifconfig bridge0
> bridge0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
> ether 3a:af:9d:0f:c1:b9
> inet 3.3.3.2 netmask 0xffffff00 broadcast 3.3.3.255
> id 00:00:00:00:00:00 priority 16384 hellotime 2 fwddelay 15
> maxage 20 holdcnt 6 proto rstp maxaddr 100 timeout 1200
> root id 00:00:00:00:00:00 priority 16384 ifcost 0 port 0
> member: tap2 flags=143<LEARNING,DISCOVER,AUTOEDGE,AUTOPTP>
> member: tap1 flags=143<LEARNING,DISCOVER,AUTOEDGE,AUTOPTP>
>
> rt1# ping 3.3.3.2
> PING 3.3.3.2 (3.3.3.2): 56 data bytes
> 64 bytes from 3.3.3.2: icmp_seq=0 ttl=64 time=8.144 ms
> 64 bytes from 3.3.3.2: icmp_seq=1 ttl=64 time=4.313 ms
> 64 bytes from 3.3.3.2: icmp_seq=2 ttl=64 time=4.421 ms
> ...
> all works while broadcast
>
> Then I'd try to enable stp on bridge0 interfaces for automatic disable
> one of redundant links (tap1/tap2).
> rt1# ifconfig bridge0 stp tap1 stp tap2
> rt1# ifconfig bridge0
> bridge0: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST>
> metric 0 mtu 1500
> ether 56:8d:35:75:ee:3f
> inet 3.3.3.1 netmask 0xffffff00 broadcast 3.3.3.255
> id 00:1c:c0:39:d6:b9 priority 32768 hellotime 2 fwddelay 15
> maxage 20 holdcnt 6 proto rstp maxaddr 100 timeout 1200
> root id 00:1c:c0:39:d6:b9 priority 32768 ifcost 0 port 0
> member: tap2 flags=147<LEARNING,DISCOVER,STP,AUTOEDGE,AUTOPTP>
> port 12 priority 128 path cost 2000000 proto rstp
> role disabled state discarding
> member: tap1 flags=147<LEARNING,DISCOVER,STP,AUTOEDGE,AUTOPTP>
> port 16 priority 128 path cost 2000000 proto rstp
> role disabled state discarding
>
> rt2# ifconfig bridge0 stp tap1 stp tap2
> rt2# ifconfig bridge0
> bridge0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
> ether 3a:af:9d:0f:c1:b9
> inet 3.3.3.2 netmask 0xffffff00 broadcast 3.3.3.255
> id 00:1c:c0:39:d6:ad priority 16384 hellotime 2 fwddelay 15
> maxage 20 holdcnt 6 proto rstp maxaddr 100 timeout 1200
> root id 00:1c:c0:39:d6:ad priority 16384 ifcost 0 port 0
> member: tap2 flags=147<LEARNING,DISCOVER,STP,AUTOEDGE,AUTOPTP>
> port 9 priority 128 path cost 2000000 proto rstp
> role disabled state discarding
> member: tap1 flags=147<LEARNING,DISCOVER,STP,AUTOEDGE,AUTOPTP>
> port 8 priority 128 path cost 2000000 proto rstp
> role disabled state discarding
>
> But when stp is enabled, it blocks all bridge members, and bridge stop working.
>
> May be I am misunderstand something with stp?
> At all it is possible to use bridge(4) stp with tap(4)?
This is because tap(4) does not have a media attachment, the spanning
tree code uses this to check if there is a link and obtain the duplex
(see bstp_ifupdstatus). Im not sure what the answer is, maybe ignore
this for pseudo interfaces.
Andrew
More information about the freebsd-net
mailing list