Pcornel
Browse topics
Options
Recent
Favorites
Security · Technical reference

Security Associations

Direct answer

A security association (SA) is a one-way agreement on keys, algorithms and lifetime between IPsec peers, identified by an SPI. Each tunnel has an IKE SA plus a pair of IPsec SAs.

When to use this

Use this when reading IPsec security associations.

First 30 seconds

1. SAs are unidirectional; identified by SPI + destination + protocol.

2. Lifetimes by time and bytes.

3. Rekey before expiry.

4. Stale SAs after peer reboot — DPD cleans up.

5. Count matches tunnels.

Operational verification

SPI → SA parameters → packet processing

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

PlatformNetwork security
Key commandshow crypto ipsec sa peer 198.51.100.2
Scope / prerequisiteUse this when reading IPsec security associations.
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.

2 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 Reading SA output Narrow the fault
show crypto ipsec sa peer 198.51.100.2
  #pkts encaps: 1520, #pkts encrypt: 1520
  #pkts decaps: 0,    #pkts decrypt: 0

Illustrative output, not captured Evidence. Encaps rising but decaps zero means traffic leaves but nothing comes back: check the peer's routing, its SA for the reverse direction and any ACL/NAT on the path. Both zero means traffic never matches the tunnel.

Step 2 Common mistakes Narrow the fault
  • Lifetimes and PFS settings mismatched.
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
Key points
  • An SA is one-way and identified by an SPI.
  • Each tunnel has an IKE SA and a pair of IPsec SAs.
  • Lifetimes trigger rekeying.
Key checks
  • ip xfrm state — SAs (SPI, algorithms, lifetimes)
  • show crypto ipsec sa — SA details
  • swanctl --list-sas — SA state
ReferenceImportant terms & boundaries1 section · depth on demand

In depth

A Security Association (SA) is a one-way agreement between two IPsec peers on how to protect traffic: algorithms, keys, lifetimes and the SPI (Security Parameter Index) that identifies it. Each tunnel needs at least two IPsec SAs (inbound and outbound) plus the IKE SA used to manage them.

show crypto ipsec sa peer 203.0.113.20
show crypto ikev2 sa detailed
ip xfrm state              # Linux (strongSwan/libreswan)
swanctl --list-sas

SAs expire by time or data volume and are replaced before expiry (rekey). Counters in the SA output — packets encrypted/decrypted, errors, replay failures — are the most direct way to see whether traffic flows in both directions.

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 docNetwork security current

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

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

Confirm action

Continue?