From owner-freebsd-net@freebsd.org Sat Apr 28 08:59:00 2018 Return-Path: Delivered-To: freebsd-net@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CB2A6FA70BC for ; Sat, 28 Apr 2018 08:58:59 +0000 (UTC) (envelope-from eugen@grosbein.net) Received: from hz.grosbein.net (unknown [IPv6:2a01:4f8:d12:604::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "hz.grosbein.net", Issuer "hz.grosbein.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 58E586BBBB for ; Sat, 28 Apr 2018 08:58:59 +0000 (UTC) (envelope-from eugen@grosbein.net) Received: from eg.sd.rdtc.ru (root@eg.sd.rdtc.ru [62.231.161.221] (may be forged)) by hz.grosbein.net (8.15.2/8.15.2) with ESMTPS id w3S8woSm030084 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sat, 28 Apr 2018 10:58:50 +0200 (CEST) (envelope-from eugen@grosbein.net) X-Envelope-From: eugen@grosbein.net X-Envelope-To: ab.tariq90@gmail.com Received: from [10.58.0.4] ([10.58.0.4]) by eg.sd.rdtc.ru (8.15.2/8.15.2) with ESMTPS id w3S8wkEr060448 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Sat, 28 Apr 2018 15:58:46 +0700 (+07) (envelope-from eugen@grosbein.net) Subject: Re: NETGRAPH- bridge vlans using netgraph help To: Abdullah Tariq References: <5AE216DC.7010905@grosbein.net> <5AE33513.1000001@grosbein.net> <5AE34754.6040905@grosbein.net> <5AE34CFA.7000207@grosbein.net> Cc: "freebsd-net@freebsd.org" From: Eugene Grosbein Message-ID: <5AE437C1.8010706@grosbein.net> Date: Sat, 28 Apr 2018 15:58:41 +0700 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.7.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=2.2 required=5.0 tests=BAYES_00, LOCAL_FROM, RDNS_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.1 X-Spam-Report: * -0.0 SPF_PASS SPF: sender matches SPF record * -2.3 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] * 2.6 LOCAL_FROM From my domains * 1.9 RDNS_NONE Delivered to internal network by a host with no rDNS X-Spam-Level: ** X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on hz.grosbein.net X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Apr 2018 08:59:00 -0000 28.04.2018 12:49, Abdullah Tariq wrote: You still top-posting. Please don't. > > And please do not top-post and reply to the list, not privately. Thank you. > > sorry for that. > > They do but that's not what you need. You deal with untagged frames on igb5, > > so do not create any vlan on top on igb5 but use it directly: > > ifconfig bridge10 create addm igb5 addm vlan3 up > > so if i need 2 ports with same vlan tags to communicate with each other > > i create 2 bridges > > ifconfig vlan2 create vlan 5 vlandev igb5 > > ifconfig vlan3 create vlan 5 vlandev igb6 > > ifconfig bridge10 create addm igb5 addm vlan3 up > > ifconfig bridge11 create addm igb6 addm vlan2 up > > is this the right way? > No. If you have two ports that should carry untagged frames and form single vlan > and this vlan has no other ports carrying tagged frames, then > this vlan effectively has *no* tag number, or better say, its tag number does not matter. > In that case, do not create any vlan interfaces for the vlan at all but bridge ports directly: > ifconfig bridge10 addm igb5 addm igb6 > So it is not possible to replicate behaviour of standard L2 switches > using freebsd where we have different VLANs, access and trunk ports? It is possible to replicate *behaviour* but not configuration style. Unless you have real embedded switching chip in your system like many ARM or MIPS-based routers do, in which case you can use etherswitch(4) and etherswitchcfg(8) to create vlans and configure ports of such chip similar to L2 switches.