NG_IFACE(4)
β¨ NAME β¨
okay bestie, welcome to the ng_iface(4) page from the Kernel Interfaces Manual β itβs giving interface netgraph node type energy π
. This is where a netgraph node and a system networking interface are literally the same main character.
πΈ SYNOPSIS πΈ
#include <netgraph/ng_iface.h>
π¦ DESCRIPTION π¦
An iface node is both a netgraph node and a system networking interface. When an iface node is created, a new interface appears, and itβs accessible via ifconfig(8). Iface node interfaces are named ng0, ng1, etc. When a node is shut down, the corresponding interface is removed, and the interface name becomes available for reuse by future iface nodes; new nodes always take the first unused interface. The node itself is assigned the same name as its interface, unless the name already exists, in which case the node remains unnamed.
An iface node has a single hook corresponding to each supported protocol. Packets transmitted via the interface flow out the corresponding protocol-specific hook. Same energy the other way: packets received on a hook appear on the interface as packets received into the corresponding protocol stack. The currently supported protocols are IP and IPv6.
An iface node can be configured as a point-to-point interface or a broadcast interface. The configuration can only be changed when the interface is down. The default mode is point-to-point.
Iface nodes support the Berkeley Packet Filter (BPF), periodt.
π HOOKS π
This node type supports the following hooks:
inetβ transmission and reception of IP packets.inet6β transmission and reception of IPv6 packets.
π CONTROL MESSAGES π
This node type supports the generic control messages, plus the following:
NGM_IFACE_GET_IFNAME(getifname) β returns the name of the associated interface as aNUL-terminated ASCII string. Normally this is the same as the name of the node.NGM_IFACE_GET_IFINDEX(getifindex) β returns the global index of the associated interface as a 32 bit integer.NGM_IFACE_POINT2POINT(point2point) β sets the interface to point-to-point mode. The interface must not currently be up.NGM_IFACE_BROADCAST(broadcast) β sets the interface to broadcast mode. The interface must not currently be up.
π«Ά SHUTDOWN π«Ά
This node shuts down upon receipt of a NGM_SHUTDOWN control message. The associated interface is removed and becomes available for use by future iface nodes.
Unlike most other node types, an iface node does not go away when all hooks have been disconnected; rather, an explicit NGM_SHUTDOWN control message is required. Itβs giving βyou canβt ghost me, I need closureβ π.
π₯ ALTQ Support π₯
The ng_iface interface supports the ALTQ bandwidth management feature. However, ng_iface is a special case, since it is not a physical interface with limited bandwidth.
One should not turn ALTQ onng_ifaceif the latter corresponds to some tunneled connection, e.g.PPPoEorPPTP. In this case, ALTQ should be configured on the interface that is used to transmit the encapsulated packets.
In case when your graph ends up with some kind of serial line, either synchronous or modem, the ng_iface is the right place to turn ALTQ on. Slay.
π Nesting π
ng_iface supports nesting, a configuration when traffic of one ng_iface interface flows through the other. The default maximum allowed nesting level is 2. It can be changed at runtime setting the sysctl(8) variable net.graph.iface.max_nesting to the desired level of nesting.
π SEE ALSO π
altq(4), bpf(4), netgraph(4), ng_cisco(4), ifconfig(8), ngctl(8), sysctl(8)
β HISTORY β
The iface node type was implemented in FreeBSD 4.0.
π AUTHORS π
Archie Cobbs <archie@FreeBSD.org>
This page came from the Debian manual source, dated July 31, 2020 β and thatβs the cute little sign-off, bestie πβ¨
π¦ where this page comes from
- freebsd 14.5: base 14.5
- freebsd 15.1: base 15.1
- nixpkgs unstable: source
- Copyright (c) 1996-1999 Whistle Communications, Inc
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms