vlan stacking

Ivan Alexandrovich ivsan at ngs.ru
Wed Aug 29 04:05:56 PDT 2007


I'm wondering is anybody using double vlans ("q-in-q",
"vlan stacking", any name you like) on production hosts?
Does it play well with common ethernet device drivers in freebsd
(concerning the frame size) -  fxp, em, for example?

Looks like that almost nobody mentions q-in-q in freebsd maillists/forums,
except that nesting ng_vlan can be used to implement it.
At the the end of the message there's an example of initialization
sequence that we try to use. It's rather straightforward but maybe
someone can criticize it or drop a hint how to do it the right way.


#rl0: creating 802.1q vlan 3555 and nested vlan 2555

 ifconfig rl0 netmask
 kldload ng_ether
 kldload ng_vlan

 ngctl mkpeer rl0: vlan lower downstream
 ngctl name rl0:lower vlanL1
 ngctl connect rl0: vlanL1: upper nomatch
 ngctl mkpeer vlanL1: eiface vlan3555 ether
 ngctl msg vlanL1: addfilter '{ vlan=3555 hook="vlan3555" }'
# the same mac address as for parent interface rl0
 ifconfig ngeth0 link 00:c0:df:1f:22:de
 ifconfig ngeth0 netmask

 ngctl mkpeer ngeth0: vlan lower downstream
 ngctl name ngeth0:lower vlanL2
 ngctl connect ngeth0: vlanL2: upper nomatch
 ngctl mkpeer vlanL2: eiface vlan2555 ether
 ngctl msg vlanL2: addfilter '{ vlan=2555 hook="vlan2555" }'
 ifconfig ngeth1 link 00:c0:df:1f:22:de
 ifconfig ngeth1 netmask

 ifconfig ngeth0 name spvid3555
 ifconfig ngeth1 name dvlan2555
 ifconfig rl0 promisc

More information about the freebsd-net mailing list