Capture a baseline
Record the time, both peer addresses, the local and remote traffic selectors, and one failing source, destination, protocol and port. Take a snapshot of IKE and Child SA state, packet counters and recent logs on both peers. Generate a single test flow from a host whose address is covered by the tunnel. Comparing counter deltas during that test is more informative than comparing cumulative totals.
Check reachability and IKE
Verify that the gateway routes to the remote peer through the expected WAN interface and uses the expected source address. Check captures on both WAN interfaces for the initial UDP 500 exchange and its reply. If the request leaves one peer and never reaches the other, check intervening routing, firewall policy and NAT. If the reply leaves but never comes back, trace the return path separately.
If the peers exchange IKE packets, use the negotiation stage and logs to narrow the cause. IKE_SA_INIT negotiates the IKE proposal and key exchange. IKE_AUTH verifies peer identity and credentials and normally negotiates the first Child SA. Compare the configured identities and check certificate validity, trust and clock synchronization or verify that the expected preshared key is configured on both sides through your approved process.
When NAT is detected, check that UDP 4500 passes both ways for IKE and UDP-encapsulated ESP. When ESP travels without UDP encapsulation, check that the path allows IP protocol 50.
Check Child SAs
An established IKE SA only confirms the control channel. Confirm that both peers installed inbound and outbound Child SAs covering the failing traffic. Compare the negotiated traffic selectors with the actual test flow, viewing local and remote from each peer’s perspective. If negotiations fail, compare the ESP transforms and any Diffie–Hellman requirements for Child SA creation or rekey. Look for errors such as TS_UNACCEPTABLE or NO_PROPOSAL_CHOSEN in the exchange where they occur.
Trace traffic in both directions
- Check that the test packet reaches the local gateway. Confirm that its route and policy select the tunnel and that NAT leaves the source and destination consistent with the negotiated selectors.
- Check whether the local outbound encryption counter and remote inbound decryption counter increase. If only the local counter rises, compare captures of ESP or UDP 4500 and inspect the remote gateway’s IPsec drop counters.
- If the remote gateway decrypts the packet, check its security policy and route to the destination. Trace the application’s reply through the remote gateway and back through the tunnel. Asymmetric routing can leave the forward path working while replies take a different gateway.
Check MTU and rekeying
If small packets work while larger transfers stall, test packet sizes across the path. IPsec and NAT traversal add overhead. Check for dropped ICMP messages needed by Path MTU Discovery, including IPv4 Fragmentation Needed or IPv6 Packet Too Big. Base tunnel MTU changes on the measured path. TCP MSS clamping only affects TCP.
If traffic breaks on a regular interval, compare outage times with Child SA and IKE SA rekey events on both peers. Check whether new SAs are installed and carrying traffic before old SAs expire.
Worked example
A test connection from 192.0.2.10 to 198.51.100.20 on TCP 443 times out. Both SAs are established. The local encryption counter increases and the remote decryption counter rises by the same amount. A capture on the remote LAN shows the server receiving the SYN and sending its reply to a different gateway. Check the remote LAN’s return route to 192.0.2.0/24, then repeat the test and confirm counter increases in both directions.
Explore IKE and IPsec in the VPN Simulator.