Use it to protect routed traffic across an untrusted underlay with policy-based crypto maps or route-based tunnel interfaces.
IPsec
A site-to-site IPsec VPN authenticates peers and protects selected traffic with negotiated IKE and IPsec security associations.
1. show crypto session — UP-ACTIVE?
2. Down → peers reach each other on UDP 500/4500 and ESP? show crypto ikev2 sa — any SA?
3. IKE fails → proposals and pre-shared key/certificate must match.
4. IKE up, no IPsec SA → traffic selectors (crypto ACL) must mirror each other.
5. show crypto ipsec sa — encaps rise but decaps do not → the far end or return path.
peer reachable → IKE proposal agreed → authentication → IKE SA → IPsec SA with mirrored selectors → interesting traffic encrypted → decrypted at the far end → reply returns
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.
Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
Verification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 First 30 seconds Verify boundary
Immediate answer: Separate peer reachability, IKE SA, IPsec SA/selectors and encrypt/decrypt counters with controlled interesting traffic.
Verification chain: Interesting traffic → IKE authentication → IPsec SA/selectors → encrypt → underlay → decrypt → routed delivery
Stop condition: IKE established does not show the required traffic matches a child SA or decrypts successfully.
Step 2 Verification and output interpretation Verify boundary
Verify peer reachability, IKE state, child/IPsec SAs, inbound/outbound packet counters and the route that selects protected traffic. Counter increments on both sides provide stronger evidence than an SA listed as established. Confirm selectors or route-based policy match the intended traffic and inspect drops/replay/authentication counters when packets do not progress. Application success remains beyond IPsec itself.
Step 3 Step-by-step troubleshooting Narrow the fault
Boundary rule: IKE established does not show the required traffic matches a child SA or decrypts successfully.
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.
Subtopics
Go one level deeper into this subject.
A site-to-site VPN connects whole networks through an encrypted tunnel between two gateways, so hosts communicate without VPN software of their own.
Subtopic Remote Access VPN conceptsRemote access VPN connects individual users (for example with Cisco Secure Client using IPsec/IKEv2 or SSL/TLS) to the corporate network, with user authentication and assigned addresses.
Subtopic IKEInternet Key Exchange (IKE) authenticates IPsec peers and negotiates the keys and parameters (SAs) for the tunnel, using UDP 500 and UDP 4500 with NAT traversal.
Subtopic IKEv2IKEv2 is the current IKE version: fewer messages, built-in NAT traversal and dead peer detection, EAP support, and on IOS FlexVPN configuration with proposals, policies, keyrings and profiles.
Subtopic IPsec SAAn IPsec security association (SA) is a one-way agreement on keys, algorithms and SPI for protecting traffic; each tunnel has a pair, visible with show crypto ipsec sa.
Subtopic ESPEncapsulating Security Payload (ESP, IP protocol 50) is the IPsec protocol that encrypts and authenticates the payload; it is used in almost all IPsec VPNs.
Subtopic IPsec EncryptionIPsec encryption protects confidentiality with symmetric ciphers such as AES-GCM or AES-CBC, using keys negotiated by IKE.
Subtopic IPsec IntegrityIPsec integrity (HMAC-SHA or AES-GCM) detects any change to protected packets and, with sequence numbers, rejects replayed packets.
Subtopic IPsec ProfileAn IPsec profile (crypto ipsec profile <name>) groups the transform set and IKEv2 profile and is applied to a tunnel interface with tunnel protection ipsec profile <name>.
Subtopic GRE over IPsecGRE over IPsec reference for overlay/underlay separation, GRE multiprotocol transport, IPsec protection, MTU overhead, routing and verification boundaries.
Subtopic VerificationVerify 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.
- 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.
show crypto session— tunnel state per peer.show crypto ikev2 sa/show crypto isakmp sa— IKE SA state.show crypto ipsec sa— SAs, traffic selectors and encaps/decaps counters.show crypto ikev2 proposal/show crypto ipsec transform-set— algorithms offered.debug crypto ikev2— negotiation errors (briefly).
ReferenceImportant terms & boundaries4 sections · depth on demand
In depth
IPsec: authenticated, encrypted IP traffic between peers
IPsec protects IP packets between two peers. Two parts work together: IKE (RFC 7296) authenticates the peers and negotiates keys, and ESP (RFC 4303) protects the traffic. RFC 4303 lists ESP's services as confidentiality, data origin authentication, connectionless integrity, anti-replay protection and limited traffic-flow confidentiality.
Building blocks
| Element | Role |
|---|---|
| IKE SA | Protected control channel between the peers (RFC 7296) |
| Child SA / IPsec SA | One-way ESP SAs that protect traffic, created under the IKE SA |
| SPI | 32-bit value in each ESP packet that identifies the SA at the receiver |
| ESP | IP protocol 50: encryption, integrity and anti-replay |
| Transport vs tunnel mode | Protect the payload only, or the whole original packet inside a new IP header |
Ports and protocols
| Traffic | Protocol |
|---|---|
| IKE | UDP 500 |
| IKE and ESP through NAT | UDP 4500 (NAT traversal; ESP is encapsulated in UDP) |
| ESP | IP protocol 50 |
R1# show crypto session
Crypto session current status
Interface: Tunnel100
Profile: SITE-B
Session status: UP-ACTIVE
Peer: 203.0.113.2 port 500
Session ID: 1
IKEv2 SA: local 198.51.100.2/500 remote 203.0.113.2/500 Active
IPSEC FLOW: permit ip 0.0.0.0/0.0.0.0 0.0.0.0/0.0.0.0
Active SAs: 2, origin: crypto map
R1# show crypto ikev2 sa
R1# show crypto ipsec sa
Ways to apply IPsec on Cisco IOS XE
| Method | Traffic selection |
|---|---|
| Crypto map on the physical interface | Crypto ACL (policy-based) |
Static VTI (tunnel mode ipsec ipv4) | Routing into the tunnel (route-based) |
| GRE over IPsec (tunnel protection on a GRE tunnel) | Routing; GRE adds multicast and multiprotocol support |
| DMVPN, FlexVPN | Hub-and-spoke and spoke-to-spoke at scale |
Choosing algorithms
Use IKEv2 and AES-GCM (combined encryption and integrity) with a strong Diffie-Hellman group, such as group 19, 20 or 21. Avoid DES, 3DES, MD5 and DH groups 1, 2 and 5.
Documented example, not captured output.
Quick reference
IPsec protects IP traffic with authentication, integrity and encryption. IKE (preferably IKEv2) authenticates the peers and negotiates keys; ESP then protects the data. It is used for site-to-site VPNs and remote access.
| Component | Role |
|---|---|
| IKEv2 SA | Authenticated control channel |
| Child SA (IPsec SA) | Protects data, one per direction |
| ESP (IP 50) | Encryption + integrity |
| NAT-T (UDP 4500) | ESP inside UDP through NAT |
| Proposals | AES-GCM, SHA-256/384, DH group 19/20/21 |
Prefer route-based VPNs (VTI) over crypto maps; routing decides what enters the tunnel and dynamic routing can run over it.
State model and protocol mechanics
IPsec protects IP traffic with negotiated security associations that define authentication, integrity and encryption parameters. IKE establishes and maintains keying/control state, while ESP commonly carries protected data. The forwarding path therefore depends on both ordinary IP reachability and valid cryptographic policy/state.
Limits and common misconceptions
An established IKE session does not show an IPsec child SA protects the desired flows, and an IPsec SA does not show bidirectional routing. Encryption counters can increase while the remote side lacks a return route. IPsec also adds overhead that affects effective MTU. Separate underlay reachability, key negotiation, data-plane SA, route selection and application behavior.
ReferenceConfiguration & state1 section · depth on demand
Design and configuration model
Design peers, identities, proposals, authentication, protected traffic selectors or route-based interfaces, lifetimes and routing together. Use modern cryptographic algorithms and IKEv2 where supported by the environment. Keep underlay reachability to the peer independent from overlay route selection; a VPN cannot establish reliably if the endpoint path depends recursively on the tunnel being built.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in Virtualization & Overlays → IPsec. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://www.rfc-editor.org/rfc/rfc4301.html · confidence 94%Official Cisco vendor documentation reviewed for bounded reference claims: IPsec/VTI security association and routed tunnel boundaries. This is documentation-based technical verification, not lab or production-runtime proof. Deployment-specific applicability and runtime outcome remain separate evidence.
Basis: https://www.cisco.com/c/en/us/td/docs/routers/ios-xe/security-vpn/security-vpn/m_sec-ipsec-virt-tunnl-0.html · confidence 94%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.
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.
Quick lookup tables
IPsec / Site-to-Site VPN evidence chain
Configuration, operational state, counters and downstream proof remain separate.
| Boundary | Question | Evidence | Does not prove |
|---|---|---|---|
| Definition | What is configured or intended? | running configuration / controller policy | live operation |
| Local state | Is the feature active at the expected scope? | show crypto ipsec sa | remote success |
| Counters | Did controlled traffic or an event reach this stage? | scoped counters/timestamps | complete return path |
| Next boundary | What consumes or transports this state? | interesting traffic → IKE authentication → IPsec SA/selectors → encrypt/ESP → underlay → decrypt → routed delivery | application success |
IPsec · operational reference
Compact state and interpretation boundaries for fast lookup.
| State / evidence | Interpretation |
|---|---|
| IKE SA | Key/control relationship |
| IPsec/child SA | Data protection state |
| Counters | Actual protected traffic |
| Route/selector | Which traffic enters VPN |