NG_EIFACE(4)
π NG_EIFACE π
okay bestie, so this is a Kernel Interfaces Manual page for ng_eiface, section 4. yes we're doing kernel stuff today and yes you're gonna slay it. π
β¨ NAME β¨
ng_eiface β generic Ethernet interface netgraph node type
like. that's the whole vibe. a netgraph node that is an Ethernet interface. iconic behavior honestly. π¦
πΈ SYNOPSIS πΈ
#include <netgraph/ng_eiface.h>
that's it. one include. we love a low-effort entry point. π
π« DESCRIPTION π«
so the eiface netgraph node implements the generic Ethernet interface. the way that works is: when an eiface node gets created, a whole new interface just appears, and you can go touch it with ifconfig(8). main character entrance fr. β¨
these interfaces are named ngeth0, ngeth1, etc. β numbered, cute, orderly. π
when a node is shut down, its matching interface gets removed, and that interface name goes back into the pool, available for reuse by future eiface nodes. and heads up: new nodes always take the first unused interface. no skipping, no choosing, first come first served. that's just the rules bestie. π
πͺ HOOKS πͺ
an eiface node has exactly one single hook, and its name is ether. one hook. monogamous. loyal. π«Ά
you should connect it to the Ethernet downstream β for example, to the ng_vlan(4) node. that's its whole social circle.
- packets transmitted via the interface flow out this hook
- packets received on the hook go to the protocol stack exactly like packets received by any real Ethernet interface
so like, it's giving real NIC, but it's a node. no cap. π
π¨ CONTROL MESSAGES π¨
this node type supports the generic control messages, plus these extra ones:
NGM_EIFACE_SET(ASCII name:set) β sets the link-level address of the interface. requiresstruct ether_addras its argument. this message also has an ASCII version, calledset, which instead requires an ASCII string made of 6 colon-separated hex digits. so like00:11:22:33:44:55energy. πNGM_EIFACE_GET_IFNAME(ASCII name:getifname) β returns the name of the associated interface, as a NULL-terminated ASCII string. yes it's null-terminated, we are not out here guessing string lengths, that's not the vibe. πNGM_EIFACE_GET_IFADDRSβ returns the list of link-level addresses associated with the node. plural addresses, so if you were expecting just one... surprise bestie. π
π SHUTDOWN π
this node shuts down upon receipt of a NGM_SHUTDOWN control message. the associated interface gets removed, and its name becomes available for reuse by future eiface nodes. circle of life. π¦
IMPORTANT WARNING β unlike most other node types, aneifacenode does not go away when all hooks have been disconnected. it just... stays there. chilling. an explicitNGM_SHUTDOWNcontrol message is required. so don't come crying to me when you unplug everything and the node is still standing there like π. you have to actually tell it to leave.
π SEE ALSO π
netgraph(4), ng_ether(4), ng_iface(4), ng_vlan(4), ifconfig(8), ngctl(8)
the whole friend group. go read them too, iykyk. π
π HISTORY π
the eiface node type was implemented in FreeBSD 4.6. old money. vintage. we respect the elders. β
π AUTHORS π
- the
eifacenode type was written by Vitaly V Belekhov - this manual page was written by Gleb Smirnoff
absolute legends, both of them. π«Ά
okay that's the whole page bestie, you're officially an ng_eiface girlie now. this one shipped out from Debian, dated May 14, 2019, and it lives under the name NG_EIFACE(4) β go be the main character of your own network stack. mwah. π
πβ¨
π¦ 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) 2004 Gleb Smirnoff
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms