From owner-freebsd-net@freebsd.org Thu Apr 26 18:14:03 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 7C1F1FB488E for ; Thu, 26 Apr 2018 18:14:03 +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 9576785C81 for ; Thu, 26 Apr 2018 18:14:02 +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 w3QIDqKK037793 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 26 Apr 2018 20:13:53 +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] (dadv@[10.58.0.4]) by eg.sd.rdtc.ru (8.15.2/8.15.2) with ESMTPS id w3QIDmeg028867 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Fri, 27 Apr 2018 01:13:48 +0700 (+07) (envelope-from eugen@grosbein.net) Subject: Re: NETGRAPH- bridge vlans using netgraph help To: Abdullah Tariq , freebsd-net@freebsd.org References: From: Eugene Grosbein Message-ID: <5AE216DC.7010905@grosbein.net> Date: Fri, 27 Apr 2018 01:13:48 +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=windows-1252 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=4.4 required=5.0 tests=BAYES_00, DATE_IN_FUTURE_48_96, LOCAL_FROM,RDNS_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.1 X-Spam-Report: * 2.2 DATE_IN_FUTURE_48_96 Date: is 48 to 96 hours after Received: date * -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: Thu, 26 Apr 2018 18:14:03 -0000 27.04.2018 0:58, Abdullah Tariq wrote: > I am trying to make 2 systems connected to freebsd box directly to be able > to communicated with each other. Explanation diagram is attached > > ifconfig vlan2 create vlan 5 vlandev igb5 > ifconfig vlan3 create vlan 5 vlandev igb6 > ifconfig bridge10 create addm vlan2 addm vlan3 up > > as explained to me on freebsd forums > >> PC1 would send packets without any vlan tags attached (so they belong to >> the "DEFAULT" vlan aka vlan 1). igb0 on FreeBSD would receive the packet, >> compare the vlan tag to what it's configured to use (1 <--> 5), see they >> are not equal, and would drop the packet. >> Same for PC2. It would send untagged packets (aka vlan tag 1) to igb1. >> FreeBSD would compare vlan tags, see they don't match what's set on igb1, >> and drop the packets. >> If you configure PC1 and PC2 to also use tagged vlan 5, then the bridge >> configuration using tagged vlan 5 interfaces would work. > > > > Which turns me to netgraph. The documentation is very very scarce. So i > want to know if what i am trying to achieve is possible and if anyone can > please guide me. > Rhanks If you want to bridge untagged frames between igb5 and igb6, you do not need to dive into netgraph structures. Just create another bridgeX and add both of igb5 and igb6 to that bridge.