Pcornel
Linux · Linux Firewall

INPUT

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

Back to the Topic

Answer

The INPUT chain (or the input hook in nftables) filters packets addressed to the host itself — SSH, web servers and other local services.

Remember

A typical policy: accept loopback, accept established/related, allow specific services, drop the rest. Check that the service listens on the right address (ss -ltnp) before blaming the firewall.

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

ss -tulnp
nft list chain inet filter input

Verify in this order

packet for a local address → input hook → rules in order → accept → local socket

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=2814

Confirmation

Confirm action

Continue?