Skip to content
Skills Library
DevOps & cloud · Tool integration

ipsec

/ipsec

Expert coverage of IPsec/IKEv2 VPN across all platforms: IKEv2 negotiation, ESP, crypto suite selection, CNSA 1.0/2.0 compliance, vendor-specific configuration (Cisco, PAN-OS, FortiOS, StrongSwan), DMVPN, ADVPN, VTI, troubleshooting, and interoperability. Use for \"IPsec\", \"IKEv2\", \"site-to-site VPN\", \"crypto map\", \"VTI\", \"DMVPN\", \"ADVPN\", \"IKE proposal\", \"ESP\", \"DH group\", \"PFS\", \"NAT-T\", \"DPD\". Do NOT use for cross-vendor comparison, platform selection, or category-wide architecture -- use the `vpn` skill.

Licence
MIT
Last repository change
23.09.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
3
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 23.09.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

Expert coverage of IPsec/IKEv2 VPN across all platforms: IKEv2 negotiation, ESP, crypto suite selection, CNSA 1.0/2.0 compliance, vendor-specific configuration (Cisco, PAN-OS, FortiOS, StrongSwan), DMVPN, ADVPN, VTI, troubleshooting, and interoperability. Use for \"IPsec\", \"IKEv2\", \"site-to-site VPN\", \"crypto map\", \"VTI\", \"DMVPN\", \"ADVPN\", \"IKE proposal\", \"ESP\", \"DH group\", \"PFS\", \"NAT-T\", \"DPD\". Do NOT use for cross-vendor comparison, platform selection, or category-wide architecture -- use the `vpn` skill.

Triggers from the description

IPsec\IKEv2\site-to-site VPN\crypto map\VTI\DMVPN\ADVPN\IKE proposal\
Original author description

Expert coverage of IPsec/IKEv2 VPN across all platforms: IKEv2 negotiation, ESP, crypto suite selection, CNSA 1.0/2.0 compliance, vendor-specific configuration (Cisco, PAN-OS, FortiOS, StrongSwan), DMVPN, ADVPN, VTI, troubleshooting, and interoperability. Use for \"IPsec\", \"IKEv2\", \"site-to-site VPN\", \"crypto map\", \"VTI\", \"DMVPN\", \"ADVPN\", \"IKE proposal\", \"ESP\", \"DH group\", \"PFS\", \"NAT-T\", \"DPD\". Do NOT use for cross-vendor comparison, platform selection, or category-wide architecture -- use the `vpn` skill.

How it works

  1. How to Approach Tasks
  2. Crypto Suite Recommendations (2025/2026)
  3. Vendor Configuration Patterns
  4. Deployment Topologies
  5. Troubleshooting
  6. Best Practices
  7. Common Pitfalls
  8. Reference Files
Original SKILL.md headings · 152 lines, 896 words
SKILL.md preview
---
name: ipsec
description: "Expert coverage of IPsec/IKEv2 VPN across all platforms: IKEv2 negotiation, ESP, crypto suite selection, CNSA 1.0/2.0 compliance, vendor-specific configuration (Cisco, PAN-OS, FortiOS, StrongSwan), DMVPN, ADVPN, VTI, troubleshooting, and interoperability. Use for \"IPsec\", \"IKEv2\", \"site-to-site VPN\", \"crypto map\", \"VTI\", \"DMVPN\", \"ADVPN\", \"IKE proposal\", \"ESP\", \"DH group\", \"PFS\", \"NAT-T\", \"DPD\". Do NOT use for cross-vendor comparison, platform selection, or category-wide architecture -- use the `vpn` skill."
license: MIT
---

# IPsec/IKEv2

This skill covers IPsec/IKEv2 VPN across all major platforms. Areas of expertise include:

- IKEv2 protocol mechanics (IKE_SA_INIT, IKE_AUTH, CREATE_CHILD_SA)
- ESP encapsulation (tunnel mode, transport mode)
- Crypto suite selection (CNSA 1.0 current, CNSA 2.0 post-quantum transition)
- Vendor-specific configuration: Cisco IOS-XE, Cisco ASA, Cisco FTD, PAN-OS, FortiOS, StrongSwan
- Route-based VPN (VTI) vs policy-based (crypto map)
- Dynamic VPN architectures (DMVPN, ADVPN)
- NAT Traversal (NAT-T), DPD, PFS, anti-replay
- Multi-vendor interoperability troubleshooting

## How to Approach Tasks

1. **Classify**: Configuration, troubleshooting, algorithm selection, or architecture design
2. **Identify platforms**: Which vendors are involved? Multi-vendor interop requires careful proposal matching
3. **Load context** from `references/` for deep protocol knowledge and best practices
4. **Analyze** with protocol-level understanding (not just config templates)
5. **Recommend** with platform-specific CLI and caveats

## Crypto Suite Recommendations (2025/2026)

### CNSA 1.0 (Use Today)
```
IKE: AES-256-GCM + PRF_HMAC_SHA2_384 + ECP-384 (Group 20)
ESP: AES-256-GCM-16 + PFS Group 20
```

### CNSA 2.0 (Transition by 2033)
```
IKE: AES-256-GCM + PRF_HMAC_SHA2_384 + ML-KEM-1024 + ECP-384 (hybrid)
ESP: AES-256-GCM-16 + PFS (ML-KEM or ECP-384)
```

### Avoid
- DH Groups 1, 2, 5, 22, 23, 24 (broken/weak)
- MD5 or SHA-1 for integrity/PRF
- DES or 3DES, IKEv1

## Vendor Configuration Patterns

### Route-Based VPN (VTI) -- Preferred
VTI creates a routable tunnel interface. Supports dynamic routing (OSPF, BGP) over tunnel. Simpler than crypto maps.

**Cisco IOS-XE:**
```
crypto ikev2 proposal PROP
  encryption aes-cbc-256
  integrity sha384
  group 20

crypto ikev2 profile PROFILE
  match identity remote address <peer-ip>
  authentication remote pre-share
  authentication local pre-share
  keyring local KEYRING
  dpd 30 5 periodic

crypto ipsec transform-set TS esp-aes-gcm-256
  mode tunnel

crypto ipsec profile IPSEC-PROF
  set transform-set TS
  set ikev2-profile PROFILE
  set pfs group20

interface Tunnel1
  ip address 10.255.0.1 255.255.255.252
  tunnel source GigabitEthernet0/0
  tunnel destination <peer-ip>
  tunnel mode ipsec ipv4
  tunnel protection ipsec profile IPSEC-PROF
```

**PAN-OS:** IKE Crypto Profile + IKE Gateway + IPsec Crypto Profile + IPsec Tunnel (tunnel.x interface). See `references/architecture.md` for full config.

**FortiOS:** `config vpn ipsec phase1-interface` + `config vpn ipsec phase2-interface`. Route-based by default (creates tunnel interface).

**StrongSwan:** `swanctl.conf` with connections/children blocks. See `references/architecture.md`.

### Policy-Based VPN (Crypto Map) -- Legacy
Uses ACLs to define "interesting traffic." Harder to scale. No dynamic routing over tunnel.

## Deployment Topologies

### Point-to-Point
Two gateways, fixed peers, static or BGP routing. Simplest topology.

### Hub-and-Spoke
Central hub with per-spoke tunnels. Spoke-to-spoke via hub unless shortcuts.

### DMVPN (Cisco)
mGRE + IPsec + NHRP + dynamic routing:
- Phase 1: All traffic via hub
- Phase 2: Spoke-to-spoke shortcuts via NHRP redirect
- Phase 3: NHRP shortcut routing; direct spoke-to-spoke after discovery
- Scales to thousands of spokes

### ADVPN (Fortinet/Juniper)
Hub notifies spokes of better paths via IKEv2 extensions:
- Hub: `set auto-discovery-sender enable`
- Spoke: `set auto-discovery-receiver enable`
- Spokes establish direct IPsec SAs after hub-facilitated discovery
- ADVPN 2.0 (FortiOS 7.6+): Enhanced shortcut management for multiple underlays

## Troubleshooting

### Phase 1 Failures
- **Proposal mismatch**: Most common. Verify both sides have overlapping encryption + integrity + DH group + PRF.
- **Auth failure**: PSK case-sensitive mismatch, cert untrusted, wrong identity type (FQDN vs IP)
- **Reachability**: UDP/500 and UDP/4500 must be open. ESP (protocol 50) for non-NAT-T.
- **Clock skew**: >5 minutes breaks certificate validation. NTP critical.

### Phase 2 Failures
- **PFS mismatch**: One side requires PFS (DH group), other sends PFS=none. Fails silently or TS_UNACCEPTABLE.
- **Traffic selector mismatch**: Subnet disagreement between peers. Check local/remote selectors.
- **Anti-replay drops**: Increase replay window to 512 or 1024 for high-throughput or asymmetric routing.

### Debug Commands by Vendor

**Cisco IOS-XE:** `debug crypto ikev2 protocol` / `show crypto ikev2 sa` / `show crypto ipsec sa`
**Cisco ASA:** `debug crypto ikev2 protocol 255` / `show crypto ikev2 sa` / `show vpn-sessiondb l2l`
**FortiOS:** `diagnose debug application ike -1` + `diagnose vpn tunnel list` + `diagnose vpn ike gateway list`
**PAN-OS:** `show vpn ike-sa` / `show vpn ipsec-sa` / `test vpn ike-sa gateway <name>`
**StrongSwan:** `swanctl --list-sas` / `swanctl --log` / `journalctl -u strongswan`

## Best Practices

1. **Use IKEv2 exclusively** -- Disable IKEv1/ISAKMP where not required
2. **Route-based (VTI) over policy-based (crypto map)** for dynamic routing and simpler management
3. **Enable NAT-T on all configurations** even if NAT not currently present
4. **Certificate auth over PSK** for large deployments (>10 tunnels)
5. **Enable PFS on all Child SAs** -- DH Group 20 or higher
6. **DPD on all tunnels** -- 30-60s interval, restart action
7. **Unique traffic selectors per Child SA** for simpler troubleshooting
8. **Test DPD behavior** -- Simulate peer failure to verify cleanup and re-initiation

## Common Pitfalls

1. **AEAD with integrity algorithm**: When using AES-GCM (AEAD), do NOT include a separate integrity algorithm in the same IKE proposal. Include an explicit PRF instead.
2. **Crypto map vs VTI mixing**: Don't mix both approaches on the same interface or for the same peer.
3. **NAT-T keepalive timeout**: If NAT device has aggressive timeout, increase keepalive frequency or enable keepalives on both sides.
4. **IKEv1/IKEv2 mismatch**: Some legacy peers require IKEv1. Verify compatibility before assuming IKEv2.
5. **Certificate EKU**: Server certs need serverAuth, client certs need clientAuth in Extended Key Usage.

## Reference Files

- `references/architecture.md` -- Protocol details, IKEv2 exchange mechanics, ESP/AH, vendor configs (Cisco IOS-XE, ASA, PAN-OS, FortiOS, StrongSwan), deployment topologies.
- `references/best-practices.md` -- Algorithm recommendations (CNSA 1.0/2.0), lifetime settings, DPD, anti-replay, general VPN design principles.
Files in this package (3)
  • SKILL.md 7 KB
  • references/architecture.md 5 KB
  • references/best-practices.md 3 KB

Versions

The database has no other skills named ipsec.

Database snapshot: 13.11.2026 · package version 4153e2dce485 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 90vpn
    Cross-platform comparison and architecture guidance for all VPN technologies: IPsec/IKEv2, WireGuard, SSL VPN, remote access VPN, site-to-site VPN, crypto algorithm selection, and VPN architecture design. Use for \"VPN comparison\", \"VPN architecture\", \"site-to-site VPN\",…
  • 85azure-vpn-gateway
    Expert knowledge for Azure VPN Gateway development including troubleshooting, best practices, decision making, architecture & design patterns, limits & quotas, security, configuration, integrations & coding patterns, and deployment. Use when configuring S2S/P2S tunnels, BGP/NAT,…
  • 100vpn-wireguard-openvpn-ipsec
    Use this skill when establishing encrypted site-to-site and point-to-point tunnels using modern WireGuard and IPsec protocols.
  • 100cisco-asa
    Expert coverage of Cisco ASA (Adaptive Security Appliance): security levels, ACLs, MPF, multiple context mode, failover HA, clustering, VPN (site-to-site and AnyConnect/Secure Client), NAT, and ASDM. Use for \"Cisco ASA\", \"ASA firewall\", \"security level\", \"ASDM\", \"ASA…
  • 100srx-ipsec-hub-spoke
    Design, configure, audit, and troubleshoot Juniper SRX static route-based IPsec hub-and-spoke. Use when handling per-spoke IKE gateways, one st0 per spoke, static routes, anti-recursion, centralized source NAT, VPN-to-untrust policy, or hub hairpinning. Use AutoVPN for changing…
  • 100srx-advpn
    Design, configure, audit, and troubleshoot Juniper SRX ADVPN spoke-to-spoke IPsec shortcuts. Use when handling suggester or partner roles, multipoint st0, OSPF p2mp, certificates, PKI, shortcut lifecycle, or “No public key found” IKE_AUTH failures. Use AutoVPN for hub backhaul…

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.