NFBPF_COMPILE(8)
β¨ NFBPF_COMPILE β¨
okay bestie, welcome to the nfbpf_compile page π
this one lives in the iptables world (version 1.8.11, if you're keeping receipts) and it's genuinely such a useful little goblin. come sit, we're gonna get you fluent in it π«Ά
πΈ NAME πΈ
nfbpf_compile β generate bytecode for use with xt_bpf
like. it makes BPF bytecode. for xt_bpf. that's the whole job and she does it beautifully π
π SYNOPSIS π
nfbpf_compile [ LLTYPE ] PROGRAM
LLTYPE := { EN10MB | RAW | SLIP | ... }
so you can pass an LLTYPE, or you can just... not, and let her pick π§ either way PROGRAM is the main character here.
π DESCRIPTION π
The nfbpf_compile utility aids in generating BPF byte code suitable for passing to the iptables bpf match. no cap β that's literally her entire purpose and she's obsessed with it β¨
π OPTIONS π
LLTYPEβ the link-layer header type to operate on, bestie. it's a name as defined in<pcap/dlt.h>, but with the leadingDLT_prefix stripped off (yes, they really do just chop it off, iconic honestly). for use withiptables,RAWshould be the right choice β it's also the default if not specified π so if you say nothing, she's already givingRAW.PROGRAMβ the BPF expression to compile π¦ peeppcap-filter(7)for a description of the language, because that's where the grammar lives.
π EXIT STATUS π
The program returns 0 on success, 1 otherwise. so 0 is the slay, 1 is the "not me" π
π EXAMPLE π
Match incoming TCP packets with size bigger than 100 bytes:
bpf=$(nfbpf_compile 'tcp and greater 100')
iptables -A INPUT -m bpf --bytecode "$bpf" -j ACCEPT
see how she just hands you the bytecode and you pipe it straight into --bytecode?? that's the vibe fr fr π₯
The description of bpf match in iptables-extensions(8) lists a few more examples, so if you want more inspo, that's your next stop π
π₯ SEE ALSO π₯
and that's the whole page, bestie!! π this was iptables 1.8.11's NFBPF_COMPILE(8) β go forth and compile some bytecode, you absolute main character ππ¦
π¦ where this page comes from
- centos-stream 10: iptables-utils 1.8.11-16.el10 Β· GPL-2.0-only AND Artistic-2.0 AND ISC
- fedora 43: iptables-utils 1.8.11-11.fc43 Β· GPL-2.0-only AND Artistic-2.0 AND ISC
- fedora 43: iptables-utils 1.8.11-12.fc43 Β· GPL-2.0-only AND Artistic-2.0 AND ISC
- fedora 44: iptables-utils 1.8.11-13.fc44 Β· GPL-2.0-only AND Artistic-2.0 AND ISC
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms