PFLOW(4)
π PFLOW(4) β like, the kernel interface for pflow data export, bestie β¨
okay so this is section 4 of the kernel interfaces manual (Kernel Interfaces Manual), and the star of the show is pflow β say hi π
π¦ NAME
pflow β the kernel interface for pflow data export. that's it, that's the vibe π
πΈ SYNOPSIS
pseudo-device pflow
literally just that one line, no cap β¨
π DESCRIPTION
okay so the pflow subsystem exports pflow accounting data straight outta the kernel using udp(4) packets. and get this β pflow is compatible with netflow version 5 and IPFIX (10) π₯ where does the data even come from? it's extracted from the pf(4) state table. slay.
you can create multiple pflow interfaces at runtime with the pflowctlN -c command β yes, more than one, go off π. but each interface must be configured with a flow receiver IP address and a flow receiver port number. non-negotiable, bestie.
β οΈ only states created by a rule marked with thepflowkeyword get exported bypflow. like, only those ones. don't come crying to me about your other flows π
pflow will attempt to export multiple pflow records in one UDP packet β bundling, we love efficiency π
β but it will not hold a record for longer than 30 seconds. thirty. seconds. clock's ticking β°
each packet seen on this interface has one header and a variable number of flows. the header indicates:
- the version of the protocol
- number of flows in the packet
- a unique sequence number
- system time
- an engine ID and type
header and flow structs are defined in <net/pflow.h> β go look, iykyk π§
the pflow source and destination addresses are controlled by pflowctl(8). so:
srcis the sender IP address of the UDP packet, which can be used to identify the source of the data on the pflow collector πdstdefines the collector IP address and the port- the
dstIP address and port must be defined to enable the export of flows β like, required required π
for example, the following command sets 10.0.0.1 as the source and 10.0.0.2:1234 as destination:
# pflowctl -s pflow0 src 10.0.0.1 dst 10.0.0.2:1234
and the protocol is set to IPFIX with the following command:
# pflowctl -s pflow0 proto 10
iconic. periodt. π«Ά
π SEE ALSO
netintro(4), pf(4), udp(4), pf.conf(5), pflowctl(8), tcpdump(8) β the whole friend group, honestly π
β STANDARDS
B. Claise, Specification of the IP Flow Information Export (IPFIX) Protocol for the Exchange of IP Traffic Flow Information, RFC 5101, January 2008. π academic queen behavior
π HISTORY
the pflow device first appeared in OpenBSD 4.5 and was imported into FreeBSD 15.0 . so it's been around, it's got lore π¦
π BUGS
okay so here's the messy part, don't @ me:
- a state created by
pfsync(4)can have a creation or expiration time before the machine came up π in this case,pflowpretends such flows were created or expired when the machine came up. it's just vibes, it's fine. - the IPFIX implementation is incomplete: the required transport protocol SCTP is not supported. transport over TCP and DTLS protected flow export is also not supported. like... not supported at all π
and that's the whole page, bestie π this one's from the Debian crew, dated January 08, 2024 β mwah, sending you the entire flow of love πβ¨
π¦ where this page comes from
- freebsd 15.1: base 15.1
- nixpkgs unstable: source
- Copyright (c) 2008 Henning Brauer <henning@openbsd.org>
- Copyright (c) 2008 Joerg Goltermann <jg@osn.de>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms