Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 22 Sep 2008 17:00:59 +0300
From:      "Sergey Listopad" <psychosensor@gmail.com>
To:        freebsd-net@freebsd.org
Subject:   bridged tap interfaces with stp
Message-ID:  <b3da4f3f0809220700j2194a0c3x7a4f8999aaa20fde@mail.gmail.com>

next in thread | raw e-mail | index | archive | help
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)?

Even when bridge0 on both router has only 1 member, ports stay in
disabled state.

rt1# ifconfig bridge0 deletem tap1 deletem 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: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

rt2# ifconfig bridge0 deletem tap1 deletem 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: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

rt1# ifconfig bridge0 addm tap1 stp tap1
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: tap1 flags=147<LEARNING,DISCOVER,STP,AUTOEDGE,AUTOPTP>
               port 16 priority 128 path cost 2000000 proto rstp
               role disabled state discarding

rt2# ifconfig bridge0 addm tap1 stp tap1
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: tap1 flags=147<LEARNING,DISCOVER,STP,AUTOEDGE,AUTOPTP>
               port 8 priority 128 path cost 2000000 proto rstp
               role disabled state discarding

-- 
S.Listopad



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?b3da4f3f0809220700j2194a0c3x7a4f8999aaa20fde>