Pcornel
Linux · Linux Firewall

Firewall Troubleshooting

Cheat sheet · https://pcornel.dk/topic.php?topic=2818

Back to the Topic

Answer

Firewall troubleshooting finds whether a host firewall is dropping a flow, and which rule: check the service, the active tool, rule order and counters, then trace the packet.

Remember

Refused (RST) usually means no service or a REJECT rule; timeout means DROP or a network problem. Prove it with counters or a capture on the host. Temporarily stopping the firewall is a last-resort test, never a fix.

First checks

  • nft list ruleset — all nftables rules
  • iptables -S; iptables -t nat -S — iptables rules (if used)
  • firewall-cmd --list-all — firewalld zone settings
  • ufw status verbose — UFW rules and defaults
  • ss -tulpn — which services listen

Commands

nft
nft monitor trace
nft list table ip nat
iptables -t nat -S
ss -ltnp
nft -a list
tcpdump -ni eth0 port 443
nft list ruleset -a
iptables -L -v -n

Verify in this order

packet seen on the interface → hook and chain → matching rule identified → accept/drop decision → service response

Where it usually breaks

First mismatch in link/interface → address/namespace → route/neighbor → firewall/policy → socket/daemon → DNS/TLS/SSH/application peer path; preserve identity/native diagnostic/pre-state before mutation.

Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=2818

Confirmation

Confirm action

Continue?