PFLOG(4)
π PFLOG(4) β the packet filter logging interface, bestie edition π
Kernel Interfaces Manual β¨ so like, this is pflog, and she's serving main character energy in the kernel interfaces department π
πΈ NAME πΈ
pflog β the packet filter logging interface, aka the lil interface that spills all the tea your firewall logs π
π¦ SYNOPSIS π¦
device pflog
β¨ DESCRIPTION β¨
okay so listen π the pflog interface is literally a device that makes visible all the packets logged by the packet filter, pf(4) π₯ like, every single packet pf decided to write down? yeah, it shows up here. no cap.
and the way you can justβ¦ watch them in real time?? obsessed. you invoke tcpdump(1) on the pflog interface and boom π₯ you're monitoring logged packets live. or if you want them kept forever, you store them to disk using pflogd(8) π
so the pflog0 interface? she gets created automatically at boot if both pf(4) and pflogd(8) are enabled π«Ά iconic behaviour honestly. and if you want more of them β further instances β you can create them using ifconfig(8) π
now here's the part that's giving very much "pay attention bestie" π:
every packet retrieved on this interface has a header associated with it, and that header has length PFLOG_HDRLEN. this header documents the address family, interface name, rule number, reason, action, and direction of the packet that was logged π
the structure is defined in β¨net/if_pflog.hβ© and it looks like this:
struct pfloghdr {
u_int8_t length;
sa_family_t af;
u_int8_t action;
u_int8_t reason;
char ifname[IFNAMSIZ];
char ruleset[PF_RULESET_NAME_SIZE];
u_int32_t rulenr;
u_int32_t subrulenr;
uid_t uid;
pid_t pid;
uid_t rule_uid;
pid_t rule_pid;
u_int8_t dir;
u_int8_t pad[3];
};
look at her. structured. flawless. no notes π β¨
π EXAMPLES π
want to create a pflog interface and monitor all packets logged on it? say less, bestie:
# ifconfig pflog1 up
# tcpdump -n -e -ttt -i pflog1
literally two lines and you're watching the whole situation unfold in real time ππ₯
π SEE ALSO π
iykyk π
π HISTORY π
the pflog device first appeared in OpenBSD 3.0 π a legend from the very beginning, fr fr.
and that's the whole page bestie, mwah π this cutie was brought to you by Debian, dated May 31, 2007 β yeah she's vintage but she still slays ππβ¨
π¦ 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) 2001 Tobias Weingartner
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms