From owner-freebsd-net@FreeBSD.ORG Mon Sep 22 15:43:09 2008 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 67586106567E for ; Mon, 22 Sep 2008 15:43:09 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from pele.citylink.co.nz (pele.citylink.co.nz [202.8.44.226]) by mx1.freebsd.org (Postfix) with ESMTP id F1CEE8FC19 for ; Mon, 22 Sep 2008 15:43:08 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from localhost (localhost [127.0.0.1]) by pele.citylink.co.nz (Postfix) with ESMTP id 67EF02BC4D; Tue, 23 Sep 2008 03:43:07 +1200 (NZST) X-Virus-Scanned: Debian amavisd-new at citylink.co.nz Received: from pele.citylink.co.nz ([127.0.0.1]) by localhost (pele.citylink.co.nz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 8BSch0BUnIzn; Tue, 23 Sep 2008 03:43:02 +1200 (NZST) Received: from citylink.fud.org.nz (unknown [202.8.44.45]) by pele.citylink.co.nz (Postfix) with ESMTP; Tue, 23 Sep 2008 03:43:02 +1200 (NZST) Received: by citylink.fud.org.nz (Postfix, from userid 1001) id 80C921142C; Tue, 23 Sep 2008 03:43:01 +1200 (NZST) Date: Mon, 22 Sep 2008 08:43:01 -0700 From: Andrew Thompson To: Sergey Listopad Message-ID: <20080922154301.GC76768@citylink.fud.org.nz> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17 (2007-11-01) Cc: freebsd-net@freebsd.org Subject: Re: bridged tap interfaces with stp X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Sep 2008 15:43:09 -0000 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 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 > member: tap1 flags=143 > > rt2# ifconfig bridge0 > bridge0: flags=8843 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 > member: tap1 flags=143 > > 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 > 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 > port 12 priority 128 path cost 2000000 proto rstp > role disabled state discarding > member: tap1 flags=147 > 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 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 > port 9 priority 128 path cost 2000000 proto rstp > role disabled state discarding > member: tap1 flags=147 > 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