NG_EIFACE(4)

πŸ“¦ version 15.1, in freebsd 14.5, freebsd 15.1, nixpkgs unstable

πŸ’… ng_eiface(4) β€” the manual page, bestie edition ✨

okay so this is the page for ng_eiface, aka the generic Ethernet interface netgraph node type, from section 4 of the manual (that's the kernel interfaces manual, iykyk). sit down, grab a strawberry drink πŸ“, and let's get into it.


✨ NAME ✨

ng_eiface β€” the generic Ethernet interface netgraph node type. it's giving "fake NIC but make it fashion" πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <netgraph/ng_eiface.h>

that's it. that's the whole synopsis. she's low maintenance. periodt.


🌸 DESCRIPTION 🌸

The eiface netgraph node implements the generic Ethernet interface. literally, that's her job.

When an eiface node is created, a new interface appears which is accessible via ifconfig(8). These interfaces are named β€œngeth0”, β€œngeth1”, etc. β€” yes, the numbering is automatic, she picks her own name and honestly slays at it.

When a node is shut down, the corresponding interface is removed, and the interface name becomes available for reuse by future eiface nodes. New nodes always take the first unused interface. so like, the names are a queue, not a VIP list, no cap πŸ’…


🧚 HOOKS 🧚

An eiface node has a single hook named ether, which should be connected to the Ethernet downstream β€” for example, to the ng_vlan(4) node. one hook, one bestie, not me being loyal to a fault 😭

Packets transmitted via the interface flow out this hook. Similarly, packets received on the hook go to the protocol stack as packets received by any real Ethernet interface. so it's a two-way street and both directions ate πŸ”₯


πŸ’– CONTROL MESSAGES πŸ’–

This node type supports the generic control messages, plus the following three icons:

  • NGM_EIFACE_SET (set) β€” Set link-level address of the interface. Requires struct ether_addr as an argument. This message also has an ASCII version, called β€œset”, which requires as an argument an ASCII string consisting of 6 colon-separated hex digits. yes, six. not five, not seven. six. count them 🫢
  • NGM_EIFACE_GET_IFNAME (getifname) β€” Return the name of the associated interface as a NULL-terminated ASCII string. just the name, nothing else, she's not oversharing.
  • NGM_EIFACE_GET_IFADDRS β€” Return the list of link-level addresses associated with the node. the whole list, bestie, all of them 🌈

⭐ SHUTDOWN ⭐

This node shuts down upon receipt of a NGM_SHUTDOWN control message. The associated interface is removed and its name becomes available for reuse by future eiface nodes. bye bestie, your name is someone else's name now πŸ’€

⚠️ okay this part is important, don't skip: unlike most other node types, an eiface node does not go away when all hooks have been disconnected; rather, an explicit NGM_SHUTDOWN control message is required. she does not leave the group chat when everyone else goes quiet. she needs to be told. main character energy, honestly πŸ‘‘

πŸ‘€ 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 πŸ¦‹


πŸŽ€ HISTORY πŸŽ€

The eiface node type was implemented in FreeBSD 4.6. vintage. iconic. before some of us were even born 😭


πŸ’œ AUTHORS πŸ’œ

The eiface node type was written by Vitaly V Belekhov. This manual page was written by Gleb Smirnoff. absolute legends, we stan 🫢


and that's the page!! this version came from the Debian folks and it's dated May 14, 2019 β€” so if you're reading this in a terminal, consider yourself briefed, hydrated, and fully caught up. slay πŸ’…βœ¨

πŸ“¦ where this page comes from