IT lexicon › Security › Anchor (pf)

Anchor (pf)

Security På svenska → Updated: 2026-11-09

A named slot in a pf ruleset where other rules, often inserted by a program, can be attached and replaced without touching the rest.

You write anchor "relayd/*" in pf.conf, and at that point pf evaluates whatever currently lives in the anchor. Rules are loaded into it with pfctl -a name -f file and flushed just as easily. Anchors nest and can be loaded from their own files, so a large firewall can be split up per service or per interface.

The real use case is daemons that need to punch holes on the fly. OpenBSD's relayd keeps its redirections in its own anchor, and ftp-proxy opens data connections for active-mode FTP right there. The main ruleset stays the one the administrator wrote, and a misbehaving program can only make a mess in its own corner — which is more than can be said for most firewall APIs.

← Back to the lexicon