ipdetecto.com logo
ipdetecto.com
My IPSpeed
Knowledge Hub
HomeKnowledge HubLinux Firewall Commands
© 2026 ipdetecto.com
support@ipdetecto.comAboutContactPrivacyTermsllms.txt
Basics
5 MIN READ
Apr 19, 2026

Linux Firewall Commands

Inspect and manage host firewalls: nftables, iptables-legacy views, UFW status, and Docker interaction.

Linux packet filtering lives in netfilter; userspace tools differ by distro. nft rulesets replace many iptables setups on modern systems. iptables -L -n -v or nft list ruleset show current filters. ufw status verbose summarizes UFW’s abstraction—remember Docker and Kubernetes may insert their own chains. ss -ltnp shows what is listening before you open ports.

ToolCommand ideaUse case
nftablesnft list rulesetAuthoritative view on nft-based hosts
UFWufw status numberedUbuntu-friendly rule list with indices
firewalldfirewall-cmd --list-allRHEL/Fedora zone overview

Related

iptables vs UFW, UFW guide, iptables explained, ss and netstat

Frequently Asked Questions

Q.Why do UFW rules not match what I expect?

Other tools insert higher-priority chains—check raw nft or iptables counters and Docker’s FORWARD rules.

Q.What is the difference between iptables and nftables?

nftables is the newer unified CLI with atomic updates; iptables interfaces remain on many systems via compatibility layers.

Q.How do I list open ports and firewall rules together?

Use ss -ltnp to see listeners, then compare with nft or iptables INPUT/FORWARD policies.

Q.Why does Docker break my UFW expectations?

Docker publishes NAT rules that bypass host INPUT—tune DOCKER-USER chains or bind policies explicitly.

Q.What does conntrack have to do with firewalls?

Stateful rules rely on connection tracking—exhaustion or wrong zones can drop RELATED traffic.

Q.How can I log dropped packets?

Add LOG targets in nft or iptables with rate limits—then correlate with journald or syslog.

Q.When should I use firewalld zones?

On laptops and servers needing dynamic interface trust levels with rich rules tied to zones.

Q.How do I persist rules across reboots?

Use distro-specific save mechanisms or native nftables includes—avoid only manual edits without persistence.
TOPICS & TAGS
nftablesiptablesufwlinux firewallfirewalld