NG_IPFW(4)
π NG_IPFW π
okay so bestie, welcome to ng_ipfw β the Kernel Interfaces Manual page, no less. this is the whole vibe: it's the interface between netgraph and the IP firewall. that's it. that's the girl. let's get into it π¦
β¨ SYNOPSIS β¨
#include <netinet/ip_var.h>
#include <netgraph/ng_ipfw.h>
like, include both or don't bother, fr fr π
πΈ DESCRIPTION πΈ
the ipfw node is literally the middleman, the group-chat moderator, the interface between the ipfw(4) subsystem and the netgraph(4) subsystem. she bridges the two. she's the blueprint. iconic behavior honestly π
π HOOKS π
okay so the ipfw node can have an arbitrary number of hooks β she's flexible like that πββοΈ β but here's the thing: those hook names must be made up of only numeric characters. numbers only. no letters, no vibes, no exceptions. periodt.
π₯ OPERATION π₯
so the moment the ng_ipfw module gets loaded into the kernel, one single node named ipfw is automatically created for you. that's your one and only. no more ipfw nodes can be created. none. she's the main character and there is no ensemble cast.
and likeβ¦ once she's destroyed? the only way to recreate that node is to reload the ng_ipfw module. so maybe don't. π
packets can be injected into netgraph(4) using either the netgraph or ngtee commands of the ipfw(8) utility. these commands require a numeric cookie to be supplied as an argument. packets are sent out of the hook whose name equals the cookie value. if no hook matches, the packets are justβ¦ discarded. gone. not me losing packets π
packets injected via the netgraph command are tagged with struct ipfw_rule_ref. this tag carries the info that helps the packet re-enter ipfw(4) processing, in case the packet comes back from netgraph(4) to ipfw(4). it's giving return ticket, honestly π«
packets received by a node from the netgraph(4) subsystem must be tagged with the struct ipfw_rule_ref tag. packets re-enter IP firewall processing at the next rule. and if no tag is supplied? packets are discarded. bye bestie π
π CONTROL MESSAGES π
this node type supports only the generic control messages. that's it. lowkey minimal, highkey valid β¨
π SHUTDOWN π
this node shuts down upon receipt of a NGM_SHUTDOWN control message.
do not do this. because the newipfwnode can only be created by reloading theng_ipfwmodule. i'm serious. put it down. π«Ά
β SEE ALSO β
go read those too, iykyk π
π§ HISTORY π§
the ipfw node type was implemented in FreeBSD 6.0. vintage. retro. she's been serving since day one π
π AUTHORS π
the ipfw node was written by Gleb Smirnoff <glebius@FreeBSD.org>. legend behavior, we love to see it π
that's the whole page bestie!! π this one's from the Debian squad, dated March 2, 2010, and it's NG_IPFW(4) β go forth and bridge those subsystems, no cap πΈβ¨
π¦ 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) 2005 Gleb Smirnoff
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms