Use it when configuring, checking or troubleshooting IPsec in VPN.
IPsec · VPN
IPsec is an IP-layer security architecture using policies, security associations and protocols such as ESP or AH to protect selected IPv4/IPv6 traffic in transport or tunnel mode, commonly with IKEv2 key management.
1. IPsec provides IP-layer encryption with IKE for keys.
2. ESP for confidentiality/integrity.
3. Tunnel mode for VPNs.
4. Strong proposals.
5. NAT-T for NAT.
IKE → SAs → ESP packets
Context & applicabilityCommon mistakes · platform/version boundaries
An IPsec SA shows negotiated protection parameters, but it does not show the intended traffic matches the policy or reaches its destination.
Suspicious evidence: IKE only, selector mismatch, wrong mode, obsolete algorithms, replay drops, sequence exhaustion, NAT-T blocked, IPv6 parity gap or cleartext bypass policy.
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
security policy/selectors → IKE peer/auth → child SA algorithms/keys → ESP/AH processing → outer IP path → decapsulation/policy → inner flow
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.
- IPsec ≠ encryption always; AH does not encrypt.
- IKE SA established ≠ IPsec data SA established.
- Tunnel or SA up ≠ protected application traffic succeeds.
- Cryptographic negotiation ≠ correct identity, selector, route or application outcome.
show crypto session— IPsec sessionsip xfrm state— Linux SAsip xfrm policy— Linux policies
ReferenceWhat it is1 section · depth on demand
Components
| Component | Role |
|---|---|
| IKE (v1/v2) | Authenticates peers, negotiates algorithms, creates keys |
| SA | One-way set of keys and algorithms, identified by SPI |
| ESP | Encrypts and authenticates packets (protocol 50) |
| AH | Authentication only (protocol 51), rarely used |
| Modes | Tunnel (whole packet) / transport (payload) |
| NAT-T | ESP in UDP 4500 through NAT |
ReferenceImportant terms & boundaries2 sections · depth on demand
What this shows and what it does not
An IPsec SA shows negotiated protection parameters, but it does not show the intended traffic matches the policy or reaches its destination.
In depth
IPsec is a suite of protocols that secures IP traffic at the network layer. IKE negotiates keys and security associations, ESP encrypts and authenticates packets, and AH (rarely used) authenticates without encryption. It works transparently for all applications, which makes it the standard for site-to-site VPNs.
Components at a glance:
| Component | Function |
|---|---|
| IKEv2 (UDP 500/4500) | Authenticate peers, negotiate algorithms, derive keys |
| ESP (IP 50 or UDP 4500 with NAT-T) | Protect data |
| SAs | Agreed parameters per direction |
| SPD (policy) | Which traffic is protected |
| Modes | Tunnel (gateways) or transport (hosts) |
Prefer route-based VPNs (VTI) with IKEv2, AES-GCM, strong DH groups, PFS and certificate authentication.
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 → IPsec. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://www.rfc-editor.org/rfc/rfc4301 · 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
VPN → IPsec proof map
Fast scope, effective-policy, runtime-evidence and closure boundaries for VPN → IPsec.
| 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 |