Use it when configuring, checking or troubleshooting Security Association in VPN.
Security Association
An IPsec Security Association is a unidirectional set of peer, protocol, SPI, algorithms, keys, selectors, sequence/anti-replay and lifetime state used to process protected traffic; bidirectional communication normally uses paired SAs.
1. A Security Association is a one-way set of keys/algorithms identified by SPI.
2. Two SAs per tunnel (in/out).
3. Lifetimes trigger rekey.
4. Counters show traffic.
5. Mismatch → drops.
SPI → keys/algorithms → protected packets
Context & applicabilityCommon mistakes · platform/version boundaries
An SA entry shows installed cryptographic state, but it does not show traffic use, opposite-direction state or destination acceptance.
Suspicious evidence: orphan one-way SA, zero bytes, SPI not found, mismatched keys, replay window drop, expired lifetime, duplicate stale SAs or selector narrower than route.
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 Verification path Verify boundary
policy/child negotiation → outbound SA/SPI/keys → ESP/AH packets → inbound SA lookup → replay/integrity/decrypt → inner packet → rekey/delete
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.
- One SA ≠ bidirectional protection.
- SA present ≠ packets match its selectors or keys remain synchronized.
- Tunnel or SA up ≠ protected application traffic succeeds.
- Cryptographic negotiation ≠ correct identity, selector, route or application outcome.
ip xfrm state— SAs with SPIsshow crypto ipsec sa— SPI, counters, lifetimesswanctl --list-sas— SA details
ReferenceWhat it is1 section · depth on demand
SA details
Each tunnel has at least two IPsec SAs (one per direction), each with its own SPI, keys and counters. SAs expire by time (e.g. 3600 s) or volume and are rekeyed. show crypto ipsec sa shows SPIs, encrypt/decrypt counters and errors (#pkts decrypt failed, replay errors). Mismatched traffic selectors produce SAs that do not cover the traffic.
ReferenceHow it works1 section · depth on demand
Decision and enforcement journey
Security Association is verified as a decision/enforcement journey: policy match → SA lookup/negotiation → SPI/keys/lifetime → encapsulation/anti-replay → peer decapsulation → application.
ReferenceImportant terms & boundaries2 sections · depth on demand
What this shows and what it does not
An SA entry shows installed cryptographic state, but it does not show traffic use, opposite-direction state or destination acceptance.
In depth
A Security Association (SA) in a VPN is the agreed set of parameters for protecting traffic in one direction between two peers: algorithms, keys, SPI, lifetime and traffic selectors. An IKE SA protects the control channel; IPsec (child) SAs protect data.
show crypto ipsec sa
local ident (addr/mask/prot/port): (10.20.0.0/255.255.0.0/0/0)
remote ident (addr/mask/prot/port): (10.0.0.0/255.0.0.0/0/0)
#pkts encaps: 154822, #pkts decaps: 151877
inbound esp sas: spi: 0xC81B9A2E
outbound esp sas: spi: 0x5D3A11F0
Documented example, not captured output.
If encaps increase but decaps stay at zero, traffic leaves but nothing returns — check the remote side's routing, policy and NAT. SAs are rekeyed before expiry; problems at rekey often point to PFS or lifetime mismatches.
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 VPN → Security Association. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://www.rfc-editor.org/rfc/rfc4301 · confidence 94%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
VPN → Security Association proof map
Fast scope, effective-policy, runtime-evidence and closure boundaries for VPN → Security Association.
| Boundary | Establish | Does not establish |
|---|---|---|
| Scope and intent | Exact subjects, destinations, application, direction, trust zone and expected decision | Does not prove effective path, identity, cryptography or enforcement |
| Effective control state | Resolved rule/policy, session/SA, identity/posture, translation and selected path | Object/config presence does not prove a match or packet outcome |
| Runtime evidence | Correlated client, authenticator/firewall/VPN, AAA and destination observations for one flow/time | A single log or success does not prove every packet, peer, path or failover state |
| Closure | Original allowed/denied operation behaves as intended and regression/failure tests pass | Administrative commit or tunnel-up state alone is not closure |