Skip to content

Backends and persistence

FireHawk detects the active firewall backend of each host when it tests the connection. This page lists what each backend supports.

Feature iptables nftables ufw firewalld
Managed-chain mode yes yes yes (ufw user rules) yes (default zone)
Full mode (whole ruleset) yes yes no no
Chains / directions in managed-chain mode INPUT, OUTPUT, FORWARD input, output, forward IN, OUT, ROUTED IN (inbound only)
Source and destination, ports, interfaces yes yes yes source address only (no destination, source port or interfaces)
Connection state (new, established, …) yes (-m conntrack --ctstate) yes (ct state) no no
IPv6 ip6tables as a separate ruleset, full mode only native (inet tables) IPv6 addresses passed to ufw IPv6 sources as family="ipv6" rich rules
NAT yes yes no port forwarding and masquerade
Aliases ipsets fh_<alias> when ipset is installed, else inline named sets for dynamic aliases, static ones inline inline inline
Live update of dynamic aliases yes, with ipset (atomic ipset swap) yes (set flush and refill in one transaction) no (needs a deploy) no (needs a deploy)
Policies yes (IPv4, and IPv6 in full mode) yes yes inbound policy rules only
Boot persistence distribution tooling, see below distribution tooling, see below ufw itself firewalld itself
  • In managed-chain mode FireHawk only touches its own objects: the iptables chains FIREHAWK (jumped to from INPUT), FIREHAWK_OUTPUT and FIREHAWK_FORWARD, the nftables table inet firehawk, ufw’s user rules and defaults, or the rich rules, ports and forwards of firewalld’s default zone. Everything else on the host stays as it is. FireHawk keeps its jump at the top of each base chain; a rule inserted above it shows as drift.
  • In full mode (iptables and nftables) FireHawk owns the whole ruleset: every iptables table (raw, mangle, nat, filter, security) or every native nftables table, with builtin chain policies, custom chains, sets and maps. Chains, rules and tables of other software (Docker, Kubernetes, fail2ban, libvirt, Tailscale, …) are matched by per-host patterns, shown read-only and never flushed or deleted. The whole ruleset is checked on the host (iptables-restore --test, nft -c) and applied atomically.

New hosts start in full mode; hosts added before stay in managed-chain mode until you take over all rules. See Full mode.

Kind iptables nftables firewalld ufw
Port forward (DNAT to another address/port) yes yes yes (forward-port) no
Redirect to a local port yes yes yes (forward-port) no
Masquerade (outbound NAT, gateway) yes yes yes (zone or per source) no
SNAT to a fixed address yes yes no (firewalld has no SNAT) no

When a NAT rule forwards traffic, FireHawk enables IP forwarding and persists it in /etc/sysctl.d/90-firehawk.conf (removed again when no NAT rule needs it). On ufw hosts, enabled NAT rules make the deploy fail. In full mode, NAT lives in the nat table’s chains like any other rule. See NAT and port forwarding.

Every backend gets a rule that keeps the management SSH port open before any drop: an allow in ufw, an added port in firewalld, an SSH guard rule in iptables and nftables when a policy is DROP (in full mode also on output). IPv6 DROP policies on ip6tables additionally accept ICMPv6 neighbour discovery, without which IPv6 stops working.

On iptables and nftables the boot configuration is only written after safe deploy confirmed access, so a reboot during the confirmation window also brings back the old rules. ufw and firewalld store rules permanently while applying, so a reboot inside the window keeps the new rules.

After every successful deploy and every rollback, FireHawk saves the live ruleset as the host’s boot configuration, using only the distribution’s own tooling. It never installs its own boot scripts.

Backend Distribution Packages Where the rules are stored
iptables Debian / Ubuntu iptables-persistent, ipset-persistent netfilter-persistent save: /etc/iptables/rules.v4 (and rules.v6), /etc/iptables/ipsets
iptables Alpine iptables-openrc, ipset-openrc rc-service iptables save / ipset save (and ip6tables): /etc/iptables/rules-save, /etc/ipset.d/
iptables RHEL / Rocky / Alma / Fedora iptables-services, ipset-service /etc/sysconfig/iptables (and ip6tables), /etc/sysconfig/ipset.d/; services enabled after saving
iptables openSUSE / SLES none no native iptables persistence exists: use nftables or firewalld
nftables Alpine nftables-openrc the service’s rules_file (default /etc/nftables.nft)
nftables systemd distributions nftables the file the distribution’s nftables.service loads, for example /etc/nftables.conf, /etc/sysconfig/nftables.conf or /etc/nftables/rules/main.nft; not available on openSUSE Leap 15 / SLES 15
ufw all (ufw) ufw’s own rules files, service enabled
firewalld all (firewalld) permanent zone configuration, service enabled

The ipset packages are only required when the host has ipset. IPv6 persistence is added for iptables hosts that manage IPv6.

When the tooling is missing, the deploy still applies the rules, but the host shows not persisted and the deploy log lists what is missing. The Install button on the host page (permission host.edit) installs the packages with the host’s package manager (apt, apk, dnf or zypper), saves the live rules through them, and is audited. Check re-reads the persistence status.

  • nftables: only nft-native tables are written to the boot file. Tables created through iptables-nft (for example by Docker or Kubernetes) cannot be loaded by nft and would make the whole file unloadable, so they are left out. The new file is validated with nft -c before it replaces the previous one.
  • RHEL family: if firewalld is enabled at boot, it replaces the iptables rules at the next boot; FireHawk warns about it. Disable firewalld (systemctl disable firewalld) on hosts managed with iptables.
  • Alpine: the OpenRC subpackages are installed automatically with OpenRC on most systems.
  • Debian: the packages are installed without the interactive save current rules prompts.