Free tech learning for everyone, from basics to pro

Network SecurityNetworking SecurityAdvanced

Troubleshooting IPsec VPNs: phase 1, phase 2, proposals, selectors, NAT-T and counters

In short: Most IPsec problems fall into a few stages. The peers must reach each other on UDP 500 and 4500 (or ESP). Phase 1 needs matching proposals, authentication and identities. Phase 2 needs matching transform sets and traffic selectors. Then traffic must be routed into the tunnel and excluded from NAT. Encrypt and decrypt counters show which side has the problem.

Work in stages

Where an IPsec tunnel can failReachabilityUDP 500/4500,ESPIKE phase 1proposals,auth, identityIKE phase 2transform sets,selectorsRoutingtraffic sentinto tunnel?Dataencrypt anddecrypt counters
Figure 1. Work through the stages in order. The logs on the responder usually explain a failure best.

When a tunnel will not come up, or comes up but passes no traffic, check each stage in order. Logs from the responder (the side receiving the connection) usually give the clearest error, so get access to both ends or ask the other party for their logs.

1. Can the peers reach each other?

  • Ping or traceroute between the public addresses (if ICMP is allowed).
  • IKE uses UDP 500; if either side is behind NAT, IKE and the data move to UDP 4500 (NAT traversal). Without NAT, data uses ESP (IP protocol 50). Check firewalls in the path allow these.
  • Capture on the outside interface to see whether IKE packets leave and replies come back.

2. IKE phase 1 (the IKE SA)

The peers authenticate each other and agree how to protect the negotiation. Common failures:

  • Proposal mismatch: different encryption, integrity, PRF or Diffie-Hellman group. Logs say "no proposal chosen".
  • Authentication failure: different pre-shared keys, or certificate problems (expired, untrusted CA, wrong identity).
  • Identity mismatch: one side expects the peer's IP address as its ID, the other sends a hostname or a different address (common behind NAT).
  • IKE version mismatch: one side IKEv1, the other IKEv2.
show crypto ikev2 sa
show crypto ikev2 sa detailed
debug crypto ikev2   ! briefly, on a lab or quiet device

3. Phase 2 (the IPsec SAs)

  • Transform set mismatch: different ESP encryption or integrity, or PFS group.
  • Traffic selector mismatch: in policy-based VPNs (crypto maps), the networks in each side's crypto ACL must mirror each other exactly. 10.1.0.0/16 to 10.2.0.0/16 on one side and 10.1.1.0/24 to 10.2.0.0/16 on the other will fail. Route-based VPNs (VTIs) usually use 0.0.0.0/0 selectors and avoid this.
  • Lifetime differences rarely stop a tunnel but can cause drops at rekey time on some platforms.

4. Is traffic reaching the tunnel?

  • Routing: with a VTI, is there a route for the remote subnet through the tunnel? With a crypto map, does traffic leave through the interface where the map is applied?
  • NAT exemption: if the firewall or router NATs internal traffic to the internet, VPN traffic must be excluded from that NAT, or it is translated before encryption and no longer matches the selectors.
  • Interesting traffic: policy-based tunnels only start when matching traffic is sent. Generate some from a host behind the device, not from the device itself, unless you set the source.

5. Read the counters

show crypto ipsec sa
  #pkts encaps: 1520, #pkts encrypt: 1520
  #pkts decaps: 0,    #pkts decrypt: 0
  • Encrypts rising, decrypts zero: we send, nothing comes back. The far side is not routing back into the tunnel, has a NAT problem, or ESP or UDP 4500 is blocked on the way back.
  • Both zero: traffic is not reaching the tunnel; check routing and NAT here.
  • Both rising but applications fail: look at MTU (set TCP MSS around 1350 to 1360) and at firewall rules after decryption.

Real-world example: the partner VPN that half worked

A new VPN to a supplier came up, and pings from the company to the supplier's server got no reply. show crypto ipsec sa showed encrypts rising and decrypts at zero. The supplier's firewall had a NAT rule that translated all outbound traffic to its public address, including replies meant for the tunnel. Adding a NAT exemption for the company's subnet on the supplier's side made decrypts climb immediately.

Practice

Which ports and protocols does IPsec need through firewalls?
UDP 500 for IKE, UDP 4500 for NAT traversal, and ESP (IP protocol 50) when there is no NAT.
What does "no proposal chosen" in IKE logs usually mean?
The peers have no matching encryption, integrity, PRF or Diffie-Hellman settings.
Encrypt counters rise but decrypt counters stay at zero. Where should you look?
On the return path: the remote side's routing, NAT exemption, or blocking of ESP/UDP 4500 back towards you.

Key takeaways

  • Check reachability and NAT-T first: UDP 500, UDP 4500 and ESP.
  • Phase 1 fails on proposals, keys, certificates or identities.
  • Phase 2 fails on transform sets and mismatched traffic selectors.
  • Check routing and NAT exemption, then read encrypt and decrypt counters.
Tracks your learning on this device only. See your progress on the learning paths.
Verified author✓ Valid
Issued to
Mohamed Fayas
Role
Founder of FM TecHub
Credentials
CCNABTEC HND Network EngineeringBEng (Hons) Computer Networking & Cloud Security
Issuer
FM TecHub · fmtechub.com

He writes practical, plain-English guides on networking, security and cloud.

More about the author →

Original content written by Mohamed Fayas for FM TecHub. © 2026 FM TecHub. You're welcome to share a link to this page; please don't copy the text elsewhere without permission.

Email updates: coming soon

New notes, tools and security news from FM TecHub by email, explained simply. Free. We're not collecting email addresses yet; see our privacy policy.

PortServiceStatus
SMTP/25Email updatesopening soon

Meanwhile, stay connected: