---
name: "cdist-type__pf_apply_anchor"
section: "7"
platform: "linux"
package: "cdist"
version: "7.0.0-5"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/cdist-type__pf_apply_anchor"
---

# cdist-type\_\_pf\_apply\_anchor(7)

Apply a pf(4) anchor on $\_\_target\_host

## NAME

cdist-type\_\_pf\_apply\_anchor - Apply a [pf(4)](/pf/4.md) anchor on $\_\_target\_host

## DESCRIPTION

This type is used on \*BSD systems to manage anchors for the pf firewall.

Notice this type does not take care of copying the ruleset, that must be done by the user with, e.g. *\_\_file*.

## OPTIONAL PARAMETERS

- **anchor\_name**

  The name of the anchor to apply. If not set, *${\_\_object\_id}* is used. This type requires */etc/pf.d/${anchor\_name}* to exist on *$\_\_target\_host*.

## EXAMPLES

```
# Copy anchor file to ${__target_host}
__file "/etc/pf.d/80_dns" --source - <<EOF
# Managed remotely, changes will be lost
pass quick proto {tcp,udp} from any to any port domain
EOF
# Apply the anchor
require="__file/etc/pf.d/80_dns" __pf_apply_anchor 80_dns
# This is roughly equivalent to:
#   pfctl -a "${anchor_name}" -f "/etc/pf.d/${anchor_name}"
```

## SEE ALSO

[**pf**(4)](/pf/4.md)

## AUTHORS

Evilham \<*contact--@--evilham.com*\> Kamila Součková \<*coding--@--kamila.is*\> Jake Guffey \<*jake.guffey--@--eprotex.com*\>

## COPYING

Copyright (C) 2020 Evilham. Copyright (C) 2016 Kamila Součková. Copyright (C) 2012 Jake Guffey. You can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

## COPYRIGHT

ungleich GmbH 2021
