Date: Mon, 22 Sep 2008 08:43:01 -0700 From: Andrew Thompson <thompsa@FreeBSD.org> To: Sergey Listopad <psychosensor@gmail.com> Cc: freebsd-net@freebsd.org Subject: Re: bridged tap interfaces with stp Message-ID: <20080922154301.GC76768@citylink.fud.org.nz> In-Reply-To: <b3da4f3f0809220700j2194a0c3x7a4f8999aaa20fde@mail.gmail.com> References: <b3da4f3f0809220700j2194a0c3x7a4f8999aaa20fde@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20080922154301.GC76768>