fwb_pf(1)
π fwb_pf β like, the manual page, but make it make sense π
okay bestie, welcome to fwb_pf(1), a page straight out of the Firewall Builder manual. grab a snack, we're learning the OpenBSD packet filter compiler and it's lowkey iconic π
β¨ NAME β¨
fwb_pf β the policy compiler for the OpenBSD packet filter, aka pf. yes, that pf. the one everyone's obsessed with. π¦
πΈ SYNOPSIS πΈ
fwb_pf [-vVx] [-d wdir] [-o output.fw] [-i] -f data_file.xml object_name
like, that's the whole vibe. flags first, then the file, then the object name. periodt. π
π«Ά DESCRIPTION π«Ά
So. fwb_pf is one of the firewall policy compiler components that live inside Firewall Builder (peep fwbuilder(1) if you wanna meet the parent π₯Ί). This lil guy generates code for the OpenBSD Packet Filter (pf). It reads your object definitions and your firewall description out of the data file you point it at with the -f option, and then it spits out pf configuration files plus a firewall activation script. slay. β¨
Every file it makes starts with the name of the firewall object. The firewall activation script gets the extension .fw, and it's just a simple shell script that:
- flushes the current policy,
- loads the new filter and nat rules,
- activates
pf.
The PF configuration file name also starts with the name of the firewall object, plus -pf.conf. The NAT configuration file name starts with the name of the firewall object too, plus -nat.conf. So if your firewall object is named myfirewall, the compiler creates three files:
myfirewall.fw
myfirewall-pf.conf
myfirewall-nat.conf
three files, one firewall, no notes. π§
The data file and the name of the firewall object must be specified on the command line β those are non-negotiable bestie. Everything else? optional. π
π OPTIONS π
-fFILE β names the data file that's getting processed. the whole reason we're here. π-ooutput.fw β names the output file. you pick it, it writes it. β¨-dwdir β sets the working directory. the compiler drops the firewall activation script and the PF configuration files in there. if you skip this one, everything lands in the current working directory instead. no drama. π-vβ be verbose: the compiler prints diagnostic messages while it's working. it's giving "narrating its own life". π£οΈ-Vβ print the version number and quit. that's it, that's the whole job. π-iβ when this flag shows up, the last argument on the command line is supposed to be the firewall object ID instead of its name. plot twist. π-xβ generate debugging information while working. β οΈ this one is intended for debugging only and may produce lots of cryptic messages. you have been warned, bestie. π
π NOTES π
Support for PF was introduced in version 1.0.1 of Firewall Builder. baby's first pf support, we love to see it. πΌ
Supported features β the stuff it can do:
- both
pf.confandnat.conffiles are generated β¨ - negation in policy and NAT rules
- grouping in
"from","to"and ports using the'{' '}'syntax - if the checkbox
"Scrub"is checked in the rule options dialog, and the rule's action is Accept, the compiler generates two (almost) identical rules: the first with action'scrub'and the second with action'pass quick' - stateful inspection in an individual rule can be turned off in the rule options dialog. by default the compiler adds
"keep state"or"modulate state"to each rule with action'pass'β yes, it's doing that automatically, yes it's on purpose π - the rule options dialog gives you a choice of icmp or tcp rst replies for rules with action
"Reject" - the compiler adds the flag
"allow-opts"if a match on ip options is needed - the compiler can generate rules matching on TCP flags
- the compiler can generate a script adding ip aliases for NAT rules using addresses that do not belong to any interface of the firewall
- the compiler always adds the rule
"block quick all"at the very bottom of the script to ensure a"block all by default"policy β even if the policy is empty. safety queen. π‘οΈ - Address ranges in both policy and NAT
Features that are not supported (yet) β the "coming soon, maybe, don't rush me" list:
- custom services
What will not be supported (at least not anytime soon) β the hard no list:
- policy routing
π URL π
The Firewall Builder home page is located at the following URL:
http://www.fwbuilder.org/
go look, it's cute. πΈ
π BUGS π
Please report bugs using the bug tracking system on SourceForge:
http://sourceforge.net/tracker/?group_id=5314&atid=105314
found a bug? don't suffer in silence, bestie, drop it in the tracker. π
π«Ά SEE ALSO π«Ά
fwbuilder(1), fwb_ipt(1), fwb_ipf(1)
and that's the whole page, bestie! this was FWB's fwb_pf(1) manual page, and yeah β it's part of the Firewall Builder family of pages. go forth and compile, you absolute main character. πβ¨π
π¦ where this page comes from
- arch rolling: fwbuilder 5.3.7-21 Β· GPL-2.0-or-later
- debian bookworm: fwbuilder 5.3.7-5+b1
- debian trixie: fwbuilder 5.3.7-8
- nixos 26.05: fwbuilder 6.0.0-rc1
- nixpkgs unstable: fwbuilder 6.0.0-rc1
- ubuntu jammy: fwbuilder 5.3.7-5
- ubuntu jammy: fwbuilder 5.3.7-5ubuntu0.22.04.1
- ubuntu noble: fwbuilder 5.3.7-5build3
- ubuntu noble: fwbuilder 5.3.7-5ubuntu0.24.04.1
- ubuntu questing: fwbuilder 5.3.7-8ubuntu2
- ubuntu resolute: fwbuilder 5.3.7-8ubuntu3
- ubuntu stonking: fwbuilder 5.3.7-8ubuntu4
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms