NETGRAPH- bridge vlans using netgraph help

Slawa Olhovchenkov slw at zxy.spb.ru
Fri Apr 27 15:09:19 UTC 2018


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


More information about the freebsd-net mailing list