Pcornel
Browse topics
Options
Recent
Favorites
Networking · Technical reference

NGFW Stateful Firewall

Direct answer

A stateful firewall checks only the first packet of a connection against its rules. If allowed, it records the connection in a table, and every later packet of it — both directions — passes on that entry. Unsolicited packets from outside match no entry and are dropped.

When to use this

Use it when replies are dropped although the request is allowed, connections die after being idle, or traffic takes different firewalls out and back.

First 30 seconds

1. show conn address <client ip> — is there a connection for the flow?

2. None → packet-tracer the first packet: denied by which rule?

3. Connection exists, replies missing → show asp drop; compare traceroute both ways for an asymmetric path.

4. Works, then stops after silence → idle timeout; raise it for that service or use keepalives.

5. Rule changed, old behaviour remains → clear the connections for that flow.

Operational verification

first packet arrives on the expected interface → rule allows it → connection entry created → replies arrive at the same firewall → matched to the entry → refreshed by traffic → removed at close or idle timeout

Context & applicabilityCommon mistakes · platform/version boundaries
Platform / version applicability
Cisco IOS / IOS XE
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.

PlatformCisco IOS / IOS XE
Scope / prerequisiteUse it when replies are dropped although the request is allowed, connections die after being idle, or traffic takes dif…
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.

1 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 Stateful firewall problems Narrow the fault
  • Asymmetric routing: return traffic through another firewall without state.
  • Idle timeouts shorter than application keepalives (database or SSH sessions drop).
  • Session table full during scans or DDoS.
  • ALG/inspection breaking protocols (SIP, FTP) — disable unneeded inspection.
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
Command lookup Jump straight to Cisco syntax
Key points

Replies need a connection entry, not a rule. Asymmetric routing breaks it: the second firewall has no entry. Idle connections time out (TCP default one hour on ASA). Removing a rule does not end connections already in the table.

Key checks
  • show conn address <ip> (ASA / FTD) — connections for a host, with flags and idle time.
  • show conn detail — what the flags mean, per connection.
  • packet-tracer input <if> tcp <src> <sport> <dst> <dport> detailed — which rule and NAT a new connection would hit.
  • show asp drop — why packets were dropped (for example no connection, or a TCP state error).
  • show running-config timeout — idle timeouts.
ReferenceWhat it is1 section · depth on demand

How the state table works

1. An inside host opens a session; the first packet is checked against the rule base.

2. If allowed, the firewall creates a state entry (source/destination IP and port, protocol, TCP state, timeout).

3. Return packets that match the entry are allowed without a rule.

4. The entry is removed on FIN/RST or after an idle timeout.

Asymmetric routing breaks this: if return traffic arrives on a different firewall, there is no state entry and it is dropped. Troubleshoot with the firewall's connection table (for example show conn on ASA) and packet tracer tools.

ReferenceWhy it matters1 section · depth on demand

How it works

A stateful firewall keeps a connection table. The first packet of a flow is checked against the policy; if allowed, an entry is created and return packets matching it are permitted automatically. Packets that match no state and no rule are dropped. Asymmetric routing breaks this, because the firewall never sees one direction.

ReferenceImportant terms & boundaries1 section · depth on demand

In depth

Zone-based firewall on IOS XE — minimal stateful policy

zone security INSIDE
zone security OUTSIDE
!
class-map type inspect match-any IN-TO-OUT-CM
 match protocol tcp
 match protocol udp
 match protocol icmp
policy-map type inspect IN-TO-OUT-PM
 class type inspect IN-TO-OUT-CM
  inspect
 class class-default
  drop log
!
zone-pair security IN-TO-OUT source INSIDE destination OUTSIDE
 service-policy type inspect IN-TO-OUT-PM
!
interface GigabitEthernet0/0/0
 zone-member security INSIDE
interface GigabitEthernet0/0/1
 zone-member security OUTSIDE

inspect creates a session entry; return traffic from OUTSIDE is allowed because it matches the session — no OUTSIDE→INSIDE policy is needed for it.

Default behaviour to remember

TrafficWithout explicit policy
Between two interfaces in the same zoneAllowed
Between interfaces in different zonesDropped
Between a zone member and an interface in no zoneDropped
To/from the router itself (self zone)Allowed — until a zone-pair with self is configured, then only what that policy permits

The last row is the common outage: adding a self zone-pair for management can cut routing protocol and IPsec traffic to the router unless those are included.

Action meanings

ActionEffect
inspectStateful: session created, return traffic allowed
passStateless: allowed one way only; return needs its own policy
dropDiscard (optionally log)

Verify

show zone-pair security
show policy-map type inspect zone-pair IN-TO-OUT sessions
show policy-firewall stats zone

The sessions view shows each tracked flow with its state; a flow missing there while packets are dropped points to the class-map not matching. Asymmetric routing, where return traffic arrives on an interface in another zone or on another router, breaks stateful inspection — keep both directions through the same firewall.

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.
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 docCisco IOS / IOS XE Current documentation reviewed 2026-09-14

Authoritative/upstream documentation reviewed for bounded claims in Network Devices → Next-Generation Firewall → Stateful firewall. Documentation verification only; this is not observed lab or production Evidence.

Basis: https://www.cisco.com/c/en/us/support/ios-nx-os-software/ios-xe-17/series.html · confidence 94%
Confirmation

Confirm action

Continue?