NG_VLAN(4)
β¨ ng_vlan β the IEEE 802.1Q VLAN tagging netgraph node type β¨
okay bestie, pull up a chair, we're talking about ng_vlan from the Kernel Interfaces Manual (section 4, networking, iykyk) π
πΈ SYNOPSIS πΈ
#include <sys/types.h>
#include <netgraph.h>
#include <netgraph/ng_vlan.h>
π¦ DESCRIPTION π¦
So the vlan node type is literally a little frame multiplexer β it takes frames that are tagged per the IEEE 802.1Q standard and shuffles them between different hooks. That's the whole job. She's focused. She's booked and busy. β¨
Every node has two special hooks β downstream and nomatch β plus as many "vlan" hooks as you want, and each one of those is tied to a specific VLAN tag. No cap.
Here's the tea on how frames move around π΅:
- An
ETHERTYPE_VLANframe that shows up on thedownstreamhook, with a tag the node has been configured to filter, gets sent out the matching "vlan" hook. Slay. - If it doesn't match any of the configured tags, or it isn't even an
ETHERTYPE_VLANtype, it goes out thenomatchhook instead. And ifnomatchisn't connected? The packet is dropped. π - An Ethernet frame arriving on the
nomatchhook gets passed to thedownstreamhook unmodified β no touching, no edits, she's just a courier. - An Ethernet frame arriving on any of the "vlan" hooks gets tagged accordingly and sent out the
downstreamhook.
π HOOKS π
This node type supports these hooks, bestie:
downstreamβ typically you'd connect this one to anng_ether(4)node, using thelowerhook.nomatchβ typically this one also goes to anng_ether(4)type node, but using theupperhook.- β¨any valid nameβ© β literally any other hook name is accepted, and you should later associate it with a particular tag. Typically you'd attach this kind of hook to an
ng_eiface(4)type node using theetherhook.
π CONTROL MESSAGES π
This node type supports all the generic control messages, plus these little icons:
NGM_VLAN_ADD_FILTER(addfilter) β associates a hook with the tag. it's giving matchmaker π«ΆNGM_VLAN_DEL_FILTER(delfilter) β disassociates a hook from the tag. we're breaking up, it's not you it's the table πNGM_VLAN_GET_TABLE(gettable) β returns a table of all hook/tag associations. the receipts, fr fr π
π EXAMPLES π
no because this example eats every single time:
#!/bin/sh
ETHER_IF=rl0
ngctl -f- <<EOF
shutdown ${ETHER_IF}:
mkpeer ${ETHER_IF}: vlan lower downstream
name ${ETHER_IF}:lower vlan
connect ${ETHER_IF}: vlan: upper nomatch
EOF
ngctl mkpeer vlan: eiface vlan123 ether
ngctl msg vlan: addfilter '{ vlan=123 hook="vlan123" }'
like, setup, naming, connecting, filter added. main character energy from start to finish β
π§ SHUTDOWN π§
This node shuts down when it gets a NGM_SHUTDOWN control message, or when all hooks have been disconnected. she simply leaves when the party's over π
π SEE ALSO π
netgraph(4), ng_eiface(4), ng_ether(4), ngctl(8), nghook(8)
π HISTORY π
The ng_vlan node type appeared in FreeBSD 4.10. a true veteran, honestly.
π AUTHORS π
Ruslan Ermilov <ru@FreeBSD.org>
π okay that's the whole page, bestie. every flag, every hook, every message, all of it. go forth and tag your frames. periodt. π
Debian β March 1, 2004 β NG_VLAN(4) π that's the version, that's the date, that's the vibe check passed β¨π¦πΈ
π¦ where this page comes from
- debian bookworm: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- debian trixie: freebsd-manpages 12.2-2 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu jammy: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu noble: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu questing: freebsd-manpages 12.2-2
- ubuntu resolute: freebsd-manpages 12.2-2build1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu stonking: freebsd-manpages 12.2-2build1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- Copyright (c) 2003 Ruslan Ermilov
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms