Date: Fri, 27 Apr 2018 17:42:38 +0300 From: Slawa Olhovchenkov <slw@zxy.spb.ru> To: Eugene Grosbein <eugen@grosbein.net> Cc: Abdullah Tariq <ab.tariq90@gmail.com>, freebsd-net@freebsd.org Subject: Re: NETGRAPH- bridge vlans using netgraph help Message-ID: <20180427144238.GA80496@zxy.spb.ru> In-Reply-To: <5AE216DC.7010905@grosbein.net> References: <CAPFxuwQOBkGTHZbGfJz=-fUW8M%2BQGOpTM9T%2B-RO6H4fWcGEtqA@mail.gmail.com> <5AE216DC.7010905@grosbein.net>
next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Apr 27, 2018 at 01:13:48AM +0700, Eugene Grosbein wrote: > 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. I am use next script for bridge vr0 and wlan0: kldload -v ng_eiface ng_ether ng_bridge ngctl mkpeer . eiface hook ether ifconfig ngeth0 ether 00:40:63:c1:87:02 ngctl mkpeer ngeth0: bridge ether link0 ngctl name ngeth0:ether br0 ngctl connect wlan0: br0: lower link1 ngctl msg wlan0: setpromisc 1 ngctl msg wlan0: setautosrc 0 ngctl connect vr0: br0: lower link2 ngctl msg vr0: setpromisc 1 ngctl msg vr0: setautosrc 0
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20180427144238.GA80496>