Get your free beta license ↗
Firewall and bans · nftables

Firewall rules you add by hand disappear

Last updated 30 Nov 2026
Summary

A firewall rule you add with nft or iptables works for a while and then disappears. Rules you add through UrbeStack stay because it writes the entire nftables table from its own records.

Symptoms

A rule you add with nft add rule or iptables disappears after a reboot or a firewall change in UrbeStack.

Cause

UrbeStack keeps the firewall rules in its own records. At every firewall change, it replaces the entire inet urbestack table with the rules from those records.

At boot, nftables loads the table from UrbeStack's file. That file contains none of the rules you added by hand.

Resolution

  1. Add the rule through UrbeStack. Set --kind to one of these values.

    • port opens a port.
    • allow allows an IP address or network everywhere.
    • deny refuses an IP address or network everywhere.
    • closed closes a port while its daemon continues to listen on it.
  2. To deny a network, run the following command.

    urbestack-firewall-rule-add --kind deny --value 198.51.100.0/24 --note 'scanner'
  3. List the rules UrbeStack has recorded.

    urbestack-firewall-rule-list
  4. Show the table nftables currently holds.

    nft list table inet urbestack
  5. A rule you add through UrbeStack appears in the table with its note, as in comment "allowed in the panel: ...".