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

# cdist-type\_\_firewalld\_rule(7)

Configure firewalld rules

## NAME

cdist-type\_\_firewalld\_rule - Configure firewalld rules

## DESCRIPTION

This cdist type allows you to manage rules in firewalld using the *direct* way (i.e. no zone support).

## REQUIRED PARAMETERS

- **rule**

  The rule to apply. Essentially an firewalld command line without firewalld in front of it.

- **protocol**

  Either ipv4, ipv4 or eb. See [firewall-cmd(1)](/firewall-cmd/1.md)

- **table**

  The table to use (like filter or nat). See [firewall-cmd(1)](/firewall-cmd/1.md).

- **chain**

  The chain to use (like INPUT\_direct or FORWARD\_direct). See [firewall-cmd(1)](/firewall-cmd/1.md).

- **priority**

  The priority to use (0 is topmost). See [firewall-cmd(1)](/firewall-cmd/1.md).

## OPTIONAL PARAMETERS

- **state**

  'present' or 'absent', defaults to 'present'

## EXAMPLES

```
# Allow access from entrance.place4.ungleich.ch
__firewalld_rule entrance \
    --protocol ipv4 \
    --table filter \
    --chain INPUT_direct \
    --priority 0 \
    --rule '-s entrance.place4.ungleich.ch -j ACCEPT'
# Allow forwarding of traffic from br0
__firewalld_rule vm-forward --protocol ipv4 \
    --table filter \
    --chain FORWARD_direct \
    --priority 0 \
    --rule '-i br0 -j ACCEPT'
# Ensure old rule is absent - warning, the rule part must stay the same!
__firewalld_rule vm-forward
    --protocol ipv4 \
    --table filter \
    --chain FORWARD_direct \
    --priority 0 \
    --rule '-i br0 -j ACCEPT' \
    --state absent
```

## SEE ALSO

[**cdist-type\_\_iptables\_rule**(7)](/cdist-type__iptables_rule/7.md), **firewalld**(8)

## AUTHORS

Nico Schottelius \<*nico-cdist--@--schottelius.org*\>

## COPYING

Copyright (C) 2015 Nico Schottelius. 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
