How-To: Coexisting with Custom Firewalls (UFW / firewalld)
This guide explains how TTP isolates its nftables ruleset to operate alongside active host firewalls such as UFW, firewalld, or custom nftables / iptables-nft configurations.
1. TTP Table Isolation Architecture
TTP constructs all redirection rules inside a dedicated, isolated nftables table named inet ttp:
table inet ttp {
chain prerouting {
type filter hook prerouting priority dstnat; policy accept;
...
}
chain output {
type route hook output priority mangle; policy accept;
...
}
}
Because inet ttp operates as an independent namespace with distinct netfilter hook priorities (dstnat and mangle), TTP does not flush, modify, or overwrite pre-existing firewall tables (such as ip filter, inet firewalld, or ip ufw).
2. Coexisting with UFW (Uncomplicated Firewall)
If UFW is active on your host system:
- You do not need to disable UFW before starting TTP.
- Start TTP normally:
- To inspect both UFW rules and TTP redirection rules simultaneously:
# View UFW status
sudo ufw status
# View active TTP nftables redirection table
sudo nft list table inet ttp
When TTP stops (sudo ttp stop), only the inet ttp table is flushed and removed. UFW rules remain intact and active.
3. Coexisting with firewalld (Fedora / RHEL)
On systems running firewalld:
firewalldmanages its ownnftablestables (inet firewalld).- TTP attaches its hooks alongside
firewalld. - If
firewalldreloads (sudo firewall-cmd --reload), the FSM Watchdog automatically detects any potential netfilter chain resets and repairs theinet ttptable within seconds.
Verify coexistence using sudo ttp status:
4. Manual Rule Inspection
To inspect the raw netfilter ruleset and verify table separation: