Pcornel
Browse topics
Options
Recent
Favorites
Linux · Technical reference

Firewall Troubleshooting

Direct 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.

When to use this

Use it when a connection times out or is refused and the firewall is suspected.

First 30 seconds

1. Service listening? ss -ltnp.

2. Capture: tcpdump -ni <if> port <p> — packets arrive? replies leave?

3. Rule counters: nft list ruleset (counter) / iptables -L -n -v — which rule matches?

4. Trace: nft add rule inet filter input meta nftrace set 1 + nft monitor trace.

5. Fix the rule and persist.

Operational verification

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

Evidence · next step

For Firewall → Firewall Troubleshooting, continue with the first unproven Topic check: Pin exact symptom/time, network namespace, address family, five-tuple, expected direction, interfaces and whether the flow is local INPUT/OUTPUT or routed FORWARD. If that boundary is healthy, advance to the adjacent check: Snapshot routes/listeners plus complete effective firewall ruleset, active manager/backend, counters/logging and relevant conntrack/NAT state before mutation. Preserve the same host/time/identity scope and rerun the original workload before accepting recovery.

Continue only after interpreting the current observation.
Context & applicabilityCommon mistakes · platform/version boundaries
Platform / version applicability
linux
applies
Structured applicability is explicit Topic metadata; it does not infer compatibility beyond the stored rows.
At a glance

Operational reference

Fast context before you go deeper.

Platformlinux
Key commandjournalctl -k | grep -i 'nft\|DROP'
Scope / prerequisiteUse it when a connection times out or is refused and the firewall is suspected.
What next?3 suggested next steps
Evidence1
On this pageJump to a specific section
Operational workflow

Verification & Troubleshooting

Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.

5 steps Observe → verify → isolate → change minimally → repeat the original test.
ObservedRecord what the original test actually shows

Capture the concrete output, symptom, packet, log or counter before changing anything.

Step 1 Operational evidence path Verify boundary

symptom/time + exact flow → namespace/link/address/route/listener prerequisites → manager/backend → hook/rule order + counters/trace → conntrack/NAT → capture ingress/egress → first failing step → minimal change → original + regression tests

Healthy evidence: the exact flow is reproducible, the first failing step is confirmed with synchronized rule/capture evidence, the smallest persistent change restores intended behavior and regression policy remains correct.

Step 2 Verification and output interpretation Verify boundary

Existing fast checks for this Topic. - Pin exact symptom/time, network namespace, address family, five-tuple, expected direction, interfaces and whether the flow is local INPUT/OUTPUT or routed FORWARD.

  • Snapshot routes/listeners plus complete effective firewall ruleset, active manager/backend, counters/logging and relevant conntrack/NAT state before mutation.
  • Reproduce once with simultaneous ingress/egress capture and targeted rule trace/counters to identify the first missing packet or unexpected verdict/translation.
  • Change one demonstrated cause through the authoritative manager, read back effective state, repeat the original transaction and verify adjacent denied/allowed regression cases.

Verification chain. symptom/time + exact flow → namespace/link/address/route/listener prerequisites → manager/backend → hook/rule order + counters/trace → conntrack/NAT → capture ingress/egress → first failing step → minimal change → original + regression tests

Step 3 Commands Verify boundary
nft monitor trace
journalctl -k | grep -i 'nft\|DROP'
ss -tulpn
Step 4 Failure modes and next checks Narrow the fault

Suspicious evidence: operators flush/disable before capture, inspect the wrong namespace/backend, rely on absent logs, change multiple rules at once, or stop after temporary connectivity without verifying persistence and policy regressions.

Step 5 Common mistakes Narrow the fault
  • Testing from the host itself (traffic goes via OUTPUT/loopback).
Evidence references

Evidence · 1 on this Topic

Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.

observation · 1
Key points

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.

Key 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
ReferenceWhat it is1 section · depth on demand

Core model

Start with one exact original transaction and time window. Capture the five-tuple plus namespace/interfaces and show link/address/route/listener prerequisites, identify the authoritative firewall manager/backend, snapshot the complete ruleset and conntrack state, then reproduce with synchronized packet capture and rule trace/counters to locate the first divergence from expected policy.

ReferenceImportant terms & boundaries5 sections · depth on demand

What this shows and what it does not

Firewall troubleshooting is resolved only when the first failed policy/enforcement boundary is demonstrated, the intended effective ruleset is persistent, the original workload succeeds and negative/adjacent policy checks show no unintended exposure.

In depth

See the whole ruleset with counters and handles

# nft -a list ruleset | less
table inet filter {
	chain input {
		type filter hook input priority filter; policy drop;
		ct state established,related accept # handle 4
		iif "lo" accept # handle 5
		tcp dport 22 ip saddr 10.0.0.0/8 accept # handle 6
		tcp dport { 80, 443 } counter packets 1842 bytes 120344 accept # handle 7
		counter packets 312 bytes 18720 log prefix "input-drop " drop # handle 9
	}
}

The nft manual covers list ruleset, counters as statements and named objects, and tracing (meta nftrace with nft monitor trace). -a prints rule handles for precise deletion or insertion.

Trace one packet through all chains

# nft add table inet trace_dbg
# nft 'add chain inet trace_dbg pre { type filter hook prerouting priority -350; }'
# nft add rule inet trace_dbg pre ip saddr 10.0.10.55 tcp dport 8443 meta nftrace set 1
# nft monitor trace
trace id 6a1f inet filter input packet: iif "eth0" ip saddr 10.0.10.55 ... tcp dport 8443
trace id 6a1f inet filter input rule counter packets 313 bytes 18780 log prefix "input-drop " drop (verdict drop)
# nft delete table inet trace_dbg

The trace names the table, chain and rule that gave the verdict — no guessing.

Who else manages the firewall?

ManagerCheckNote
firewalldfirewall-cmd --state, --list-all --zone=<zone>Rewrites nftables tables; change via firewalld
ufwufw status verboseUses iptables-nft backend
Dockernft list table ip nat / iptables -t nat -SAdds its own chains; published ports bypass INPUT rules (forwarded)
Kubernetes / CNIMany chainsDo not edit by hand

Common causes of "the port is blocked"

CauseClue
Service listens only on localhostss -ltnp shows 127.0.0.1:8443
Rule in the wrong family/tableip vs inet vs ip6 table
Rule added after a drop ruleOrder in nft -a list
Rule lost at rebootNot saved (/etc/nftables.conf, firewall-cmd --runtime-to-permanent)
Traffic forwarded (container/VM), not inputLook at forward chain

*The nftables rule counters and trace identifiers illustrate packet classification, not a recorded firewall traversal.*

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.

How it works at runtime

Firewall Troubleshooting is part of Firewall → Firewall Troubleshooting. Firewall Troubleshooting is the Linux workflow for separating routing, namespace, manager/backend, rule-order, conntrack/NAT and application failures when a flow appears blocked or unexpectedly permitted, while preserving evidence before broad flush/disable changes destroy the failure point.

Topic-specific state model. Firewall Troubleshooting is the Linux workflow for separating routing, namespace, manager/backend, rule-order, conntrack/NAT and application failures when a flow appears blocked or unexpectedly permitted, while preserving evidence before broad flush/disable changes destroy the failure point.

Interpretation rule. - Disabling the firewall makes it work ≠ identifies the bad rule; it only narrows the problem to policy/enforcement and can erase useful state.

  • No firewall log ≠ firewall did not drop the packet; logging may be absent, rate-limited or attached to different rules.
  • Zero counter on one candidate rule ≠ firewall is uninvolved; the packet may hit another namespace, family, hook or earlier rule.
  • Temporary connectivity after flush ≠ durable fix and may create unintended exposure.

Method

Firewall troubleshooting:

1. Is the service listening on the right address? ss -tlnp | grep :443 (127.0.0.1 vs 0.0.0.0).

2. Which tool manages rules? firewalld/UFW/nft/iptables/Docker.

3. Do packets arrive? tcpdump -ni eth0 port 443.

4. Watch counters while testing: nft list ruleset -a (counters), iptables -L -v -n.

5. Trace a packet through rules:

nft add rule inet filter input tcp dport 443 meta nftrace set 1
nft monitor trace
firewall-cmd --set-log-denied=all; journalctl -k | grep -i 'REJECT\|DROP'

6. Remember cloud security groups and network firewalls in front of the host.

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.

Limits and how it fails

Primary failure point. Firewall troubleshooting is resolved only when the first failed policy/enforcement boundary is demonstrated, the intended effective ruleset is persistent, the original workload succeeds and negative/adjacent policy checks show no unintended exposure.

ReferenceConfiguration & state1 section · depth on demand

Configuration, persistence and lifecycle

Distribution/platform context. Firewall Troubleshooting owns cross-firewall fault isolation. Continue to Linux Networking, DNS, service/process, Security or application Topics when evidence shows the first failure lies outside firewall enforcement.

Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Technical verification history

Verification history & basis

When and against what this Topic was checked. Later text edits do not count as a new check.

2026-09-14 · vendor doclinux current

Authoritative/upstream documentation reviewed for bounded claims in Firewall → Firewall Troubleshooting. Documentation verification only; this is not observed lab or production Evidence.

Basis: https://wiki.nftables.org/wiki-nftables/index.php/Main_Page · confidence 94%
Technical changelog & impact

What changed and what may be affected

Recent technical edits are separated from ordinary page timestamps. Relationship impact is advisory: it identifies nearby canonical references to review, not automatic breakage.

Terminology layer

Terms & aliases

Hover a linked term for a quick definition; click it to open its glossary entry. Aliases are other names that find this Topic in search.

Aliases that resolve here
linux firewall troubleshootingnftables troubleshootingiptables troubleshootingfirewall packet dropped linux
Embedded reference data

Quick lookup tables

Firewall Troubleshooting operational reference

Topic-specific lookup boundaries, proof limits and next-step Evidence for Firewall Troubleshooting.

Lookup boundaryTopic-specific referenceOperational use
Scope / effective stateFirewall Troubleshooting is the Linux workflow for separating routing, namespace, manager/backend, rule-order, conntrack/NAT and application failures when a flow appears blocked or unexpectedly permitted, while preserving evidence before broad flush/disable changes destroy the failure boundary.Establish exactly what this Topic owns before crossing into another subsystem.
Fast verificationPin exact namespace + five-tuple + interfaces/direction → prove route/listener prerequisites → identify manager/backend → snapshot full ruleset + hook priorities/default policies → reproduce with counters/trace + packet capture → correlate conntrack/NAT → change one demonstrated cause → read back effective state → repeat original workload + negative regression flow.Use the shortest evidence path first; a fast check is a boundary test, not blanket proof.
Verification chainsymptom/time + exact flow → namespace/link/address/route/listener prerequisites → manager/backend → hook/rule order + counters/trace → conntrack/NAT → capture ingress/egress → first failed boundary → minimal change → original + regression testsTrace requested/configured state through effective state to the observed workload result.
Failure boundaryFirewall troubleshooting closes only when the first failed policy/enforcement boundary is demonstrated, the intended effective ruleset is persistent, the original workload succeeds and negative/adjacent policy checks show no unintended exposure.Stop broad troubleshooting at the first boundary that is not supported by evidence.
Positive evidenceCorrelated Linux firewall evidence can establish this proof path: symptom/time + exact flow → namespace/link/address/route/listener prerequisites → manager/backend → hook/rule order + counters/trace → conntrack/NAT → capture ingress/egress → first failed boundary → minimal change → original + regression testsUse this observation only for the specific claim it actually supports.
Evidence limitIt does not independently prove behavior outside the captured namespace, family, five-tuple, interface/direction, manager/backend, ruleset generation, conntrack/NAT state, time window or application scope. Firewall troubleshooting closes only when the first failed policy/enforcement boundary is demonstrated, the intended effective ruleset is persistent, the original workload succeeds and negative/adjacent policy checks show no unintended exposure.Do not promote a local success signal into end-to-end or adjacent-dependency proof.
Next troubleshooting checkContinue from the first unproven firewall boundary: preserve the current ruleset/state, capture the exact packet path and rule verdict, change only the demonstrated cause through the authoritative manager, read back effective policy, then repeat the original workload and regression flows.Continue to the next unresolved boundary while preserving the original test condition.

Firewall Troubleshooting · operational reference

Compact Linux state, persistence, verification and boundary reference for fast lookup.

Reference boundaryFirewall Troubleshooting
Topic pathFirewall → Firewall Troubleshooting
Runtime stateFirewall Troubleshooting is the Linux workflow for separating routing, namespace, manager/backend, rule-order, conntrack/NAT and application failures when a flow appears blocked or unexpectedly permitted, while preserving evidence before broad flush/disable changes destroy the failure boundary.
Fast checks- Pin exact symptom/time, network namespace, address family, five-tuple, expected direction, interfaces and whether the flow is local INPUT/OUTPUT or routed FORWARD. - Snapshot routes/listeners plus complete effective firewall ruleset, active manager/backend, counters/logging and relevant conntrack/NAT state before mutation. - Reproduce once with simultaneous ingress/egress capture and targeted rule trace/counters to identify the first missing packet or unexpected verdict/translation. - Change one demonstrated cause through the authoritative manager, read back effective state, repeat the original transaction and verify adjacent denied/allowed regression cases.
Verification chainsymptom/time + exact flow → namespace/link/address/route/listener prerequisites → manager/backend → hook/rule order + counters/trace → conntrack/NAT → capture ingress/egress → first failed boundary → minimal change → original + regression tests Boundary chain: local authoritative state → adjacent dependency → effective/programmed state → original workload/request → return/regression → explicit Evidence boundary. Boundary chain: local authoritative state → adjacent dependency → effective/programmed state → original workload/request → return path or regression → explicit Evidence boundary.
Failure boundaryFirewall troubleshooting closes only when the first failed policy/enforcement boundary is demonstrated, the intended effective ruleset is persistent, the original workload succeeds and negative/adjacent policy checks show no unintended exposure.
Persistence ruleProve which configuration source owns the state, then prove that the running consumer loaded or generated the intended state.
Confirmation

Confirm action

Continue?