Pcornel
Browse topics
Options
Recent
Favorites
Networking · Technical reference

Verification · IPsec

Direct answer

Verify IPsec with show crypto ikev2 sa (or show crypto isakmp sa), show crypto ipsec sa (encaps/decaps counters increasing on both sides) and show interfaces tunnel, then test with traffic that must use the tunnel.

When to use this

Use it after building an IPsec tunnel, or when traffic does not pass through it.

First 30 seconds

1. Verify IPsec: IKE up, child SAs, counters both ways, routing into the tunnel.

2. One-way counters mean return routing or selector issues.

3. Check NAT-T and firewall.

4. Check lifetimes and rekeys.

5. Compare configs on both peers.

Operational verification

IKE SA → IPsec SAs → routing → encaps/decaps

Context & applicabilityCommon mistakes · platform/version boundaries
Platform / version applicability
Protocol standard + deployed implementation
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.

PlatformProtocol standard · Cisco IOS / IOS XE · IOS/IOS XE
Key commandshow crypto ikev2 sa
Scope / prerequisiteUse it after building an IPsec tunnel, or when traffic does not pass through it.
Show · 3Reference · 1
What next?3 suggested next steps
Catalog command links4
Evidence0
On this pageJump to a specific section
Verification

Show Commands

Read-only Cisco show commands for confirming state, narrowing a fault and interpreting the current boundary.

How to read the output

show interfaces tunnel <id>

Look first: line/protocol state, errors/discards, rate, duplex/speed, last input/output

Healthy: State and counters align with expected traffic and physical conditions.

Warning: CRC/input errors, drops, resets, queue drops or unexpected negotiation.

Does not prove: An interface counter is a symptom until correlated with path/time/workload.

Operational workflow

Verification & Troubleshooting

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

4 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 Known-good, broken and when it is fixed Verify boundary

Known-good means the expected IKEv2 peer/session is established, matching IPsec SAs exist for the intended traffic, encapsulation and decapsulation counters increase with the controlled original flow, and the application succeeds in both required directions. Broken evidence includes no IKE SA, missing CHILD_SA, selector mismatch, one-sided counter increments or tunnel state inconsistent with routing. The limit of what it shows is that show crypto state shows negotiated/protected packet handling only within its scope, but it does not show inner routing, application authorization or reverse-path correctness unless the workload test also closes.

Step 2 Verification and output interpretation Verify boundary

Healthy evidence includes the expected peer identity, negotiated IKE/IPsec state, increasing encapsulation and decapsulation counters, absence of persistent decrypt/auth/replay errors and correct route/selector mapping. Re-run counters around a known test flow rather than trusting lifetime totals. A ping can be useful as a controlled stimulus but does not replace application-level validation.

Step 3 Verification & troubleshooting Narrow the fault

1. Verify peer underlay reachability and time/identity.

2. Verify IKE negotiation.

3. Compare selectors and proposals.

4. Generate controlled traffic.

5. Check encrypt/decrypt counters, drops, MTU and both directions.

Step 4 Native failure isolation and next-check logic Narrow the fault

Start with the exact protected source/destination flow and verify underlay reachability to the peer. If IKEv2 is absent, branch to peer reachability, identity, proposals, certificates/PSK and time; if IKE is up but IPsec SAs are missing, inspect CHILD_SA negotiation/selectors and policy. If SAs exist but traffic fails, generate the original flow and watch encaps/decaps counters in both directions; one-sided counter movement points toward selector, return-route, peer or policy asymmetry. For VTI/GRE-over-IPsec, also verify tunnel/routing state without assuming interface up shows encryption success.

Command lookup Jump straight to Cisco syntax
Key points
  • IKE SA and IPsec child SA are separate evidence boundaries
  • Proxy identities/selectors must agree at both peers
  • ESP commonly carries protected data; NAT traversal can encapsulate it in UDP 4500
  • Encaps and decaps counters must be interpreted with generated interesting traffic and the return path.
Key checks
  • show crypto ikev2 sa — IKE
  • show crypto ipsec sa — IPsec
  • show crypto session detail — summary
  • debug crypto ikev2 error — failures (lab)
ReferenceHow it works1 section · depth on demand

How it works

IPsec verification separates IKE/control-plane Security Association state from ESP data-plane protection. IKEv2 can be established while CHILD_SA selectors, transforms, routing or peer policy prevent protected traffic; conversely, stale counters can make an old SA look active. Direction matters because inbound and outbound SPI/counters are independent. For route-based designs, tunnel-interface state adds another boundary but still depends on underlay reachability and the selected protected path.

ReferenceImportant terms & boundaries4 sections · depth on demand

In depth

Verifying IPsec: IKE first, then the IPsec SAs, then traffic

Troubleshoot in the order the tunnel is built: the IKE SA must be up before the IPsec (Child) SAs exist, and the SAs must exist before traffic is encrypted. RFC 4303 identifies each ESP SA by its SPI at the receiver, so a working tunnel shows one inbound and one outbound SPI per SA pair, with counters increasing in both directions.

R1# show crypto ikev2 sa
 IPv4 Crypto IKEv2  SA
Tunnel-id Local                 Remote                fvrf/ivrf            Status
1         198.51.100.2/500      203.0.113.2/500       none/none            READY
      Encr: AES-GCM, keysize: 256, PRF: SHA384, Hash: None, DH Grp:20, Auth sign: PSK, Auth verify: PSK
      Life/Active Time: 86400/41522 sec
R1# show crypto ipsec sa interface Tunnel100
interface: Tunnel100
    Crypto map tag: Tunnel100-head-0, local addr 198.51.100.2
   protected vrf: (none)
   local  ident (addr/mask/prot/port): (0.0.0.0/0.0.0.0/0/0)
   remote ident (addr/mask/prot/port): (0.0.0.0/0.0.0.0/0/0)
   current_peer 203.0.113.2 port 500
    #pkts encaps: 1882231, #pkts encrypt: 1882231, #pkts digest: 1882231
    #pkts decaps: 1794410, #pkts decrypt: 1794410, #pkts verify: 1794410
    #send errors 0, #recv errors 0
     inbound esp sas:
      spi: 0x8C1F22A1(2350850721)
        transform: esp-gcm 256 ,
        in use settings ={Tunnel, }
        sa timing: remaining key lifetime (k/sec): (4607612/2311)
        replay detection support: Y
     outbound esp sas:
      spi: 0x4D02B7E3(1292023779)
R1# show crypto session detail
R1# debug crypto ikev2

What to look for

CheckHealthy
IKEv2 SA statusREADY
#pkts encaps and #pkts decapsBoth rising
#send errors, #recv errors0, or not increasing
Inbound and outbound SPIsBoth present
Replay detectionY (RFC 4303 allows anti-replay only together with integrity)
Remaining key lifetimeCounting down; rekeys before reaching 0

Common faults

SymptomLikely cause
No IKE SAUDP 500/4500 blocked, wrong peer address, no matching proposal
IKE fails at authenticationPre-shared key or certificate mismatch; identity doesn't match the profile
IKE up, no IPsec SATransform set or traffic selectors don't match
Encaps rising, decaps zeroThe peer isn't sending back: its routing, its NAT, or ESP blocked on the path
Decaps rising, encaps zeroLocal routing doesn't send traffic into the tunnel
Replay errorsPacket reordering across QoS queues or paths; widen the replay window

Anti-replay (RFC 4303)

The receiver keeps a sliding window and drops duplicates and packets older than the window. The minimum window is 32 packets and the recommended default 64. QoS that reorders packets between priority and best-effort queues can push valid packets outside a small window.

Documented example, not captured output.

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

Method

IPsec verification checks each layer of the VPN in turn.

1. IKE SA: show crypto ikev2 sa — status READY.

2. IPsec SAs: show crypto ipsec sa — both inbound and outbound SPIs present.

3. Counters: #pkts encaps and #pkts decaps both increasing during traffic.

4. Routing: the destination network routes into the tunnel (VTI) or matches the crypto ACL.

5. End-to-end test: ping/traceroute from inside networks, not only from the router.

ObservationMeaning
encaps rising, decaps zeroRemote side not sending back, or ESP blocked
No IPsec SAsTraffic selector/proposal mismatch
IKE SA flappingLifetime/DPD/authentication issues
Large packets failMTU/MSS
Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.

State model and protocol mechanics

IPsec verification is a layered evidence exercise: underlay routing must reach the peer, IKE must establish keying state, the IPsec/child SA must match intended traffic, counters must show data-plane use, and overlay routing/application checks must confirm the protected path is actually useful.

Limits and common misconceptions

No single “up” flag shows the VPN end to end. IKE up without a child SA is incomplete, child SA up without counter increments may mean no matching traffic, outbound increments without inbound increments suggests a return or peer-side issue, and bidirectional counters still do not show the application works. Treat verification as correlated evidence, not a binary tunnel lamp.

ReferenceConfiguration & state1 section · depth on demand

Design and configuration model

Use a stable verification order instead of relying on one command. Start with peer reachability and route resolution, then inspect IKE, IPsec SAs, negotiated parameters, lifetimes and counters. For route-based VPNs, include tunnel interface and routing-table state. For policy-based designs, include selectors/ACLs. Capture both directions because one-sided encryption can coexist with a broken return path.

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 docProtocol standard + deployed implementation RFC 4301

Authoritative/upstream documentation reviewed for bounded claims in Virtualization & Overlays → IPsec → Verification. Documentation verification only; this is not observed lab or production Evidence.

Basis: https://www.rfc-editor.org/rfc/rfc4301.html · confidence 94%
Embedded reference data

Quick lookup tables

Verification · operational reference

Compact state and interpretation boundaries for fast lookup.

State / evidenceInterpretation
UnderlayPeer reachable
IKEControl/key state
IPsec SAProtected data state
CountersTraffic actually using SA
Confirmation

Confirm action

Continue?