Skip to content

AWS Site-to-Site VPN tunnel intermittently goes down with FortiGate – DPD failure

0

Hi everyone,

We have an AWS Site-to-Site VPN connection with a FortiGate firewall, and the tunnel has been going down and reconnecting intermittently. The EC2 instances remain running during these incidents.

We have checked the VPN configuration on both AWS and FortiGate, including Diffie-Hellman groups, AES/SHA algorithms, and DPD timeout settings. These parameters are aligned on both sides, but the issue continues.

In the AWS VPN logs, we found this event when the tunnel was down:

Details: Peer is not responsive - Declaring peer dead DPD enabled: true NAT-T detected: false IKE Phase 1 state: down IKE Phase 2 state: down

We also noticed that nat_t_detected changes with the tunnel state. When the tunnel is down, it shows false. Once the connection is established again, it shows true.

The FortiGate logs show the following events around :

  • dpd — dpd_failure
  • tunnel-down — IPsec connection status change
  • phase2-down — IPsec Phase 2 status change
  • delete_phase1_sa — Delete IPsec Phase 1 SA
  • Subsequent Phase 1 and Phase 2 negotiation succeeds.

The logs suggest that the peer becomes unresponsive, the tunnel goes down, and negotiation subsequently starts again. However, we have not identified what causes the initial DPD failure.

We intentionally use only one of the two AWS VPN tunnels and keep the second tunnel down.

Could intermittent packet loss or WAN connectivity between FortiGate and AWS cause these DPD failures even when the IKE/IPsec parameters match? Does the nat_t_detected value changing from true to false during tunnel failure simply reflect the tunnel being down, or could it indicate an issue with NAT-T negotiation or connectivity?

What would you recommend checking next to identify whether the problem originates from FortiGate, the network path, or the AWS VPN endpoint? Are there specific FortiGate debug commands or AWS VPN metrics that could help identify why the peer stops responding?

Any suggestions would be appreciated. Thanks.

  • If my answer was helpful, I would appreciate it if you could mark it as the accepted answer.

2 Answers
1

Three additions:

  1. The FortiGate logging its own DPD failure doesn't prove loss in both directions. Loss in one direction is enough. If packets from AWS to the FortiGate are lost, AWS gets no reply to its R_U_THERE, and the FortiGate gets no reply to its own because the reply from AWS is lost on the same path. The capture on the FortiGate WAN interface shows which direction is affected.

  2. For the FortiGate side, Fortinet's troubleshooting article covers the IKE debug and sniffer commands and has a section on flapping tunnels: https://community.fortinet.com/t5/FortiGate/Troubleshooting-Tip-Troubleshooting-IPsec-site-to-site-tunnel/ta-p/195672

  3. If the FortiGate isn't behind a NAT device, Fortinet recommends disabling NAT traversal (FortiOS 6.2 cookbook): https://docs.fortinet.com/document/fortigate/6.2.0/cookbook/31670/ikev2-ipsec-site-to-site-vpn-to-an-aws-vpn-gateway

Related AWS articles:

EXPERT

answered 16 days ago

0

Yes. Packet loss on the path between the FortiGate and the AWS endpoint can cause these DPD failures, even when every IKE and IPsec setting matches. A setting mismatch would stop the tunnel from coming back. Your tunnel renegotiates straight away, so your settings are consistent with the evidence.

Site-to-Site VPN sends a DPD R_U_THERE message every 10 seconds and declares the peer dead after three messages without a response. Your FortiGate logged its own DPD failure at the same time. This means that DPD packets were lost in both directions, which points to the network path or a device on it.

The nat_t_detected field shows whether NAT-T was detected on the customer gateway. It reads false when the tunnel is down because no IKE security association exists. The change on its own isn't a fault. When it reads true, a NAT device sits in front of the FortiGate, or NAT-T is forced on the FortiGate. IKE and ESP then use UDP port 4500 through that device. If the device drops or rebuilds its UDP mapping, packets are lost in both directions at the same time. Check the following on the NAT device and the FortiGate:

  • The public IP address is static and matches the IP address of your customer gateway.
  • If you use SD-WAN or policy routes, IKE traffic always leaves through the same WAN interface.

To find the side that stops responding, capture UDP 500 and 4500 on the FortiGate WAN interface during a drop. If the AWS DPD messages arrive and the FortiGate doesn't reply, check the FortiGate itself. Look at IPS rate limits, CPU load and NPU offload. If the AWS messages don't arrive, or the FortiGate's packets leave without a reply, the cause is on the path. In that case, also capture on the NAT device and share the timestamps with your internet service provider.

On the AWS side, use the TunnelState metric to record when each drop starts and how long it lasts. For more information, see Monitor AWS Site-to-Site VPN tunnels using Amazon CloudWatch. Drops at a fixed interval point to a timer, such as a NAT mapping timeout. Random drops point to packet loss on the internet path.

It's a best practice to run both tunnels. AWS applies tunnel endpoint updates to one tunnel at a time, so a connection with both tunnels up loses only redundancy. With a single tunnel, each endpoint update or path problem becomes an outage. If you must use one tunnel, turn on tunnel endpoint lifecycle control so that you can schedule AWS managed updates.

To shorten each outage, set the DPD timeout action to Restart so that AWS starts a new IKE session itself. A longer DPD timeout also tolerates short bursts of loss. For both settings, see Configure tunnel options for AWS Site-to-Site VPN. These settings reduce the effect of the drops, but they don't fix the packet loss.

Related information:

AWS
SUPPORT ENGINEER

answered 16 days ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.