PF was originally designed as replacement for Darren Reed's IPFilter, from which it derives much of its rule syntax. IPFilter was removed from OpenBSD's CVS tree on 30 May 2001 due to OpenBSD developers' concerns with its license.
PF's logging is configurable per rule within the pf.conf and logs are provided from PF by a pseudo-network interface called pflog, which is the only way to lift data from kernel-level mode for user-level programs. Logs may be monitored using standard utilities such as tcpdump, which in OpenBSD has been extended especially for the purpose, or saved to disk in a modified tcpdump/pcap binary format using the pflogd daemon.
## Macros
# The internal interface (connected to the local network).
int_if="xl0"
## Options
# Set the default policy to return RSTs or ICMPs for blocked traffic.
set block-policy return
# Ignore the loopback interface entirely.
set skip on lo0
## Translation rules
# NAT traffic on the interface in the default egress interface group (to
# which the interface out of which the default route goes is assigned) from the
# local network.
nat on egress from $int_if:network to any -> (egress)
## Filtering rules
# Default deny rule, with all blocked packets logged.
block log all
# Pass all traffic to and from the local network, using quick so that later
# rules are not evaluated if a packet matches this. Some rulesets would restrict
# local traffic much further.
pass quick on $int_if all
# Permit all traffic going out, keep state so that replies are automatically passed;
# many rulesets would have many rules here, restricting traffic in and out on the
# external (egress) interface. (keep state is not needed in the newest version of pf)
pass out keep state