Pcornel
Browse topics
Options
Recent
Favorites
Networking · Technical reference

IPsec · VPN Security

Direct answer

IPsec protects IP packets with ESP (encryption and integrity) after IKE has authenticated the peers and agreed keys. It runs in tunnel mode (whole packet encapsulated) for VPNs, or transport mode between hosts.

When to use this

Use it for site-to-site VPNs, route-based tunnels (VTI, DMVPN, FlexVPN) and remote access with IKEv2.

First 30 seconds

1. show crypto session — tunnel UP-ACTIVE?

2. Down → IKE: show crypto ikev2 sa / show crypto isakmp sa; compare proposals and keys on both peers.

3. Up but no traffic → show crypto ipsec sa — encaps increasing, decaps not → the peer or return path.

4. Neither → routing or NAT sends traffic elsewhere.

5. debug crypto ikev2 briefly if negotiation fails.

Operational verification

peers reachable (UDP 500/4500, ESP) → IKE proposals match → peers authenticate → IKE SA up → IPsec SAs for the traffic → routing sends traffic into the tunnel → encrypt and decrypt counters increase

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
Scope / prerequisiteUse it for site-to-site VPNs, route-based tunnels (VTI, DMVPN, FlexVPN) and remote access with IKEv2.
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.

3 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 closure and original test Verify boundary

Layered verification for IPsec: known test tuple → expected rule/binding → programmed policy/session → counter or capture delta → protected resource/application → reverse flow/regression Close only when the original source, destination, protocol, VRF/VLAN/policy context and return path are tested.

Step 2 Branching failure-boundary diagnosis Narrow the fault

Branch packet tuple/direction → prerequisite binding/state → matching rule/sequence → hardware/session programming → hit/drop counters for the test packet → downstream service/return path.

Step 3 Common mistakes Narrow the fault
  • Weak algorithms left enabled.
  • No monitoring of tunnel state.
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

IKE uses UDP 500, and UDP 4500 when NAT is detected; ESP is IP protocol 50. Phase 1 (IKE SA) and phase 2 (IPsec SA) parameters must match. Route-based VPNs (VTI) are easier to operate than crypto-map policy VPNs.

Key checks
  • show crypto ikev2 sa — IKEv2 security associations and their state.
  • show crypto isakmp sa — IKEv1 phase 1 state (QM_IDLE is up).
  • show crypto ipsec sa — IPsec SAs, encrypt and decrypt counters.
  • show crypto session — summary of tunnels and peers.
  • show interfaces tunnel <n> — tunnel interface state for VTI/DMVPN.
ReferenceHow it works1 section · depth on demand

Mechanics and state boundaries

Separate packet classification inputs, rule/sequence ordering, state/binding dependencies, hardware programming and observed hit/drop counters. A configured permit or deny is only intent until the packet takes that path and the counter/evidence matches.

ReferenceImportant terms & boundaries2 sections · depth on demand

In depth

IPsec

IPsec secures IP traffic at the network layer. RFC 4301 lists what it provides: access control, connectionless integrity, data origin authentication, replay detection, confidentiality and limited traffic-flow confidentiality, for IPv4 and IPv6. ESP is mandatory and AH optional; RFC 4301 doesn't recommend confidentiality without integrity.

Architecture (RFC 4301)

ElementRole
Security Policy Database (SPD)Ordered policy entries: PROTECT, BYPASS or DISCARD, matched on selectors (addresses, protocol, ports)
Security Association (SA)Simplex: one direction, one protocol; two-way traffic needs a pair
SPIIdentifies the SA for unicast traffic
SA Database (SAD)Parameters of established SAs
Peer Authorization Database (PAD)Links IKE to the SPD
IKEv2Automated key management

Modes (RFC 4301)

ModeProtectsRequired when
TransportThe payload between two hostsHost-to-host
TunnelA complete inner IP packetEither end is a security gateway

Recommended choices (NIST SP 800-77 Rev. 1)

AreaRecommendation
Key exchangeIKEv2
ProtocolESP; AH no longer recommended
EncryptionAES (GCM, CTR, CBC or CCM)
IntegrityHMAC-SHA-2 or AES-GMAC
DH groups14–21
Lifetimes24 h IKE SA, 8 h IPsec SA
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.10/500      none/none            READY
      Encr: AES-GCM, keysize: 256, PRF: SHA384, Hash: None, DH Grp:20, Auth sign: RSA, Auth verify: RSA
      Life/Active Time: 86400/3611 sec
R1# show crypto ipsec sa | include spi|transform|pkts
     current outbound spi: 0xA51C2D07(2770087175)
        transform: esp-gcm 256 ,
    #pkts encaps: 48211, #pkts encrypt: 48211, #pkts digest: 48211

Two SPIs (inbound and outbound) per tunnel reflect the RFC's simplex SAs.

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.

Quick reference

IPsec provides confidentiality, integrity and authentication at the IP layer: IKE (UDP 500/4500) negotiates keys and SAs; ESP (IP protocol 50) protects data.

crypto ikev2 proposal PROP
 encryption aes-gcm-256
 prf sha384
 group 20
crypto ipsec transform-set TS esp-gcm 256
 mode tunnel
show crypto ikev2 sa detail
show crypto ipsec sa | include pkts|spi|local|remote

NAT-T encapsulates ESP in UDP 4500 when NAT is detected. Rekey lifetimes and PFS settings must match on both peers.

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 Security → VPN Security → IPsec. Documentation verification only; this is not observed lab or production Evidence.

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

Confirm action

Continue?