From nobody Wed Apr 27 15:53:12 2022 X-Original-To: freebsd-net@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 654C21ABA3FF for ; Wed, 27 Apr 2022 15:53:27 +0000 (UTC) (envelope-from benoitc@enki-multimedia.eu) Received: from mail-4018.proton.ch (mail-4018.proton.ch [185.70.40.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "protonmail.com", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4KpNZY67Jjz3ss5 for ; Wed, 27 Apr 2022 15:53:25 +0000 (UTC) (envelope-from benoitc@enki-multimedia.eu) Date: Wed, 27 Apr 2022 15:53:12 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enki-multimedia.eu; s=protonmail; t=1651074797; bh=FrTkrNH2PHBYC9TWdSdncBj7w7l68ffpI5JOJOWci70=; h=Date:To:From:Reply-To:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID; b=VrlsK7JgiF7nCjVNQV+ELUjwVGtaL3qdxhbKRToUNhO2xPi0I2b64a2seNDdspoIs eQk42TiBGdsH/BR3SJXFrNjVGn4ZdrY5kzscGoAQvXT4ya0TF5wnXfBdvvno9WH/6y mdG3kH+nXeEDIpldPTOnGmGlvrPRCw5WKSdcbWNg= To: "freebsd-net@FreeBSD.org" From: Benoit Chesneau Reply-To: Benoit Chesneau Subject: Re: how to bridge "native" vlan? Message-ID: In-Reply-To: <0RhhcsKLKqJaufaFaFO3ySBXX1Ldy-BC2hhzfUNVwjmqu6aokSy7ICFmAO8x3Gb3JoV_MplmrA0rt0BLFIlnvCtq3FaEaDLaVAx3oFRbsBg=@enki-multimedia.eu> References: <8E5C5DFB-B029-4B32-A67B-D09042ACCEE3@punkt.de> <20220423212002.GC3774@belenus.iks-jena.de> <0RhhcsKLKqJaufaFaFO3ySBXX1Ldy-BC2hhzfUNVwjmqu6aokSy7ICFmAO8x3Gb3JoV_MplmrA0rt0BLFIlnvCtq3FaEaDLaVAx3oFRbsBg=@enki-multimedia.eu> Feedback-ID: 9066678:user:proton List-Id: Networking and TCP/IP with FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-net List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-net@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 4KpNZY67Jjz3ss5 X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=pass header.d=enki-multimedia.eu header.s=protonmail header.b=VrlsK7Jg; dmarc=pass (policy=none) header.from=enki-multimedia.eu; spf=pass (mx1.freebsd.org: domain of benoitc@enki-multimedia.eu designates 185.70.40.18 as permitted sender) smtp.mailfrom=benoitc@enki-multimedia.eu X-Spamd-Result: default: False [-1.33 / 15.00]; HAS_REPLYTO(0.00)[benoitc@enki-multimedia.eu]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[enki-multimedia.eu:s=protonmail]; REPLYTO_EQ_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:185.70.40.0/24]; MIME_GOOD(-0.10)[text/plain]; NEURAL_SPAM_SHORT(0.21)[0.209]; NEURAL_HAM_LONG(-0.99)[-0.993]; RCPT_COUNT_ONE(0.00)[1]; NEURAL_HAM_MEDIUM(-0.55)[-0.545]; DKIM_TRACE(0.00)[enki-multimedia.eu:+]; DMARC_POLICY_ALLOW(-0.50)[enki-multimedia.eu,none]; TO_DN_EQ_ADDR_ALL(0.00)[]; MLMMJ_DEST(0.00)[freebsd-net]; RCVD_COUNT_ZERO(0.00)[0]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; SUBJECT_ENDS_QUESTION(1.00)[]; ASN(0.00)[asn:62371, ipnet:185.70.40.0/24, country:CH]; MID_RHS_MATCH_FROM(0.00)[] X-ThisMailContainsUnwantedMimeParts: N Do I read it well ? It seems that not matched tag are still decoded in nom= atch hook : https://github.com/freebsd/freebsd-src/blob/373ffc62c158e52cde86a5b934ab4a5= 1307f9f2e/sys/netgraph/ng_vlan.c#L576-L599 Beno=C3=AEt > Hi Lutz, > > I tried your solution, so far it works (once i figured it was "link0" and= not "0" :) . But the notmatch bridge will only receive the native vlan it = seems. Is there a way to get all the other tags, ie not filtered, as well? > > Beno=C3=AEt > > ------- Original Message ------- > On Tuesday, April 26th, 2022 at 12:08, Benoit Chesneau benoitc@enki-multi= media.eu wrote: > > > > > I am trying > > > > `mkpeer vlan0: bridge 100`but so fat it is returningan error. Should I = create the node first? > > > > Beno=C3=AEt Chesneau > > > > Sent with ProtonMail secure email. > > ------- Original Message ------- > > On Saturday, April 23rd, 2022 at 23:20, Lutz Donnerhacke lutz@donnerhac= ke.de wrote: > > > > > On Thu, Apr 21, 2022 at 02:11:54PM +0200, Patrick M. Hausen wrote: > > > > > > > > Am 21.04.2022 um 11:29 schrieb Benoit Chesneau benoitc@enki-multi= media.eu: > > > > > I have an interface on which multiple vlans are connected. I woul= d like to bridge the vlan 100 and 200 but also have a bridge for the "nativ= e" vlan 1. I Can setup a bridge for vlan 100 and 200 the way below I think = but how to create a bridge for the "native" vlan? > > > > > > > > I don't have any experience with netgraph but I do know that > > > > you cannot do that with if_bridge(4). If you make the physical > > > > interface the member of a bridge, you cannot use additional > > > > VLANs on that interface, anymore. > > > > > > > > Does anybody know if the same restriction applies to ng_bridge(4)? > > > > > > ng_bridge does not inspect the ethertypes only the mac addresses of t= he frames. > > > So you can split the VLANs using ng_vlan and connect them to the thre= e bridges: > > > > > > : mkpeer em0: vlan lower downstream > > > : name em0:lower vlan0 > > > : mkpeer vlan0: bridge 100 0 > > > : mkpeer vlan0: bridge 200 0 > > > : mkpeer vlan0: bridge nomatch 0 > > > : msg vlan0: addfilter { vid=3D100 hook=3D"100" } > > > : msg vlan0: addfilter { vid=3D200 hook=3D"200" } > > > : name vlan0:100 bridge100 > > > : name vlan0:200 bridge200 > > > > > > : mkpeer em1: vlan lower downstream > > > : name em1:lower vlan1 > > > : connect vlan1: bridge100: 100 1 > > > : connect vlan1: bridge200: 200 1 > > > : connect vlan1: bridge_untagged: nomatch 1 > > > : msg vlan1: addfilter { vid=3D100 hook=3D"100" } > > > : msg vlan1: addfilter { vid=3D200 hook=3D"200" } > > > > > > : mkpeer em2: vlan lower downstream > > > : name em2:lower vlan2 > > > : connect vlan2: bridge100: 100 2 > > > : connect vlan2: bridge200: 200 2 > > > : connect vlan2: bridge_untagged: nomatch 2 > > > : msg vlan2: addfilter { vid=3D100 hook=3D"100" } > > > : msg vlan2: addfilter { vid=3D200 hook=3D"200" }