I want to troubleshoot an AWS Site-to-Site VPN in an Amazon Virtual Private Cloud (Amazon VPC) that can't establish an Internet Key Exchange (IKE)/Phase 1 or Internet Protocol Security (IPsec)/Phase 2 connection.
Resolution
Check if traffic is down or if traffic doesn't flow
Check the status of your VPN tunnel. The status of your VPN tunnel is UP only when the statuses of both IKE/Phase 1 and IPsec/Phase 2 are UP. For dynamic VPNs, the status of border gateway protocol (BGP) must also be UP. If your VPN establishes an IKE/Phase 1 connection but the status of the IPsec/Phase 2 connection is DOWN, then your VPN tunnel is also DOWN.
If your tunnel is UP but traffic doesn't flow, then troubleshoot your VPN that uses an AWS Transit Gateway, or a Virtual Private Gateway.
If the status of your tunnel is DOWN, then the status of either IKE/Phase 1 or IPsec/Phase 2 is DOWN.
Check the statuses of IKE/Phase 1 and IPsec/Phase 2
Turn on Site-to-Site VPN logs. Use the logs to check the status of each phase. Check the phase statuses on the customer gateway device. Then, troubleshoot the failed connection based on the phase that doesn't connect.
Troubleshoot IKE/Phase 1 failures
Check the customer gateway device
On your customer gateway device, check the following configurations:
Check the Startup action
If the tunnel's Startup action is Start, then take the following actions:
- If the VPN endpoint is the VPN tunnel IKE initiator, then check that the Phase 1 and Phase 2 parameters on the customer gateway device and AWS match.
- For pre-shared key authentication, check that the local ID and the public IP address of the customer gateway device on AWS match.
- For certificate authentication, check that the local ID of the customer gateway device is the subject of the certificate.
Confirm that traffic moves through required ports
If the customer gateway is behind a NAT device, then use mytraceroute (MTR) to confirm that traffic moves through the required ports:
- Check that User Datagram Protocol (UDP) packets can pass between the network and the VPN endpoints on port 500. If NAT-traversal is active, then also check port 4500.
- Check that the intermediate internet service provider (ISP) allows traffic on port 500. If you use NAT-traversal, then check that the ISP allows traffic on port 4500.
For more information, see How do I troubleshoot packet loss on my AWS VPN connection?
Important: For customer gateways that aren't behind port address translation (PAT) devices, it's a best practice to deactivate NAT-traversal. If you activated acceleration for a Site-to-Site VPN connection, then confirm that NAT-traversal is active on the customer gateway device.
Troubleshoot IPsec/Phase 2 failures when IKE/Phase 1 is UP
Check the following configurations:
- Compare the customer gateway device settings with the Site-to-Site VPN configuration file to check that you correctly configured the Phase 2 parameters. For a customer gateway device with non-default options, use the AWS VPC console to check the Phase 2 parameters.
- Confirm that you correctly configured the supported Phase 2 parameters for IKEv1 and IKEv2 on the customer gateway device.
- Check that Diffie-Hellman Perfect Forward Secrecy (PFS) is active and uses Diffie-Hellman groups for key generation.
- Check that the VPN connection options for the remote and local IP addresses match the security associations on the customer gateway device. For more information, see How do I troubleshoot connection problems between an AWS VPN endpoint and a policy-based VPN?
Troubleshoot other issues that cause VPN connectivity failure
If the issue persists, then take the following actions:
- Review your Site-to-Site VPN logs for errors that correspond with the connection error.
- Check the IPsec debug logs to determine the cause of the failure and how to troubleshoot it.
Related information
Modify Site-to-Site VPN tunnel options
Downloadable static routing configuration files for an Site-to-Site VPN customer gateway device
Downloadable dynamic routing configuration files for Site-to-Site VPN customer gateway device