To troubleshoot an IPsec-VPN connection, use the error codes from the VPN Gateway console and the IPsec connection logs.
Background
This topic lists common IPsec-VPN connection errors and their troubleshooting methods. Use the error codes from the VPN Gateway console and the IPsec connection logs to find the corresponding solution in the summary table below and resolve the issue.
-
To learn how to view error codes for an IPsec-VPN connection, see View error codes.
-
To learn how to view the logs of an IPsec connection, see View IPsec connection logs.
View error codes
-
You cannot view error codes for an IPsec-VPN connection if it is associated with a VPN gateway created before March 21, 2019, unless the VPN gateway has been upgraded. For more information, see Upgrade a VPN gateway.
-
Error codes are available only in Chinese and English.
-
The VPN Gateway console displays health check results for an IPsec-VPN connection from the last 3 minutes. Before you view the error codes, you can reset the IPsec-VPN connection on both ends to trigger a new IPsec negotiation. Then, refresh the page to view the latest error codes.
In Alibaba Cloud, you can change the value of Effective Immediately for the IPsec connection, save the change, and then change Effective Immediately back to its original value to trigger the IPsec protocol to restart negotiation.
Single-tunnel mode IPsec-VPN connection
If your IPsec-VPN connection is in single-tunnel mode, follow these steps to view its error code.
- Log on to the VPN gateway console.
In the left navigation pane, choose .
-
In the top navigation bar, select the region where the IPsec connection is deployed.
-
On the IPsec-VPN connection page, find the target IPsec connection and view the error code in the Connection Status column.

You can click View Details next to the error code to view the detailed error message and solution in the Error Details panel. The solution provided in the Error Details panel is the same as the solution in the summary table of this topic.
Dual-tunnel mode IPsec-VPN connection
If your IPsec-VPN connection is in dual-tunnel mode, follow these steps to view the error codes for each tunnel.
- Log on to the VPN gateway console.
In the left navigation pane, choose .
-
In the top navigation bar, select the region where the IPsec connection is deployed.
-
On the IPsec-VPN connection page, find the target IPsec connection and click its ID.
-
On the Tunnel tab, view the error code of the active or standby tunnel in the Connection Status column.

You can click View Details next to the error code to view the detailed error message and solution in the Error Details panel. The solution provided in the Error Details panel is the same as the solution in the summary table of this topic.
Common errors and troubleshooting
After obtaining the error code and log information, find the corresponding troubleshooting method in the table below by matching the error code or a log keyword.
If you have diagnosed the IPsec-VPN connection by calling the DiagnoseVpnConnections API operation, refer to the API-based error code column in the table below.
|
Console error code |
API-based error code |
Error message |
Log keyword |
Troubleshooting |
|
Peer mismatch |
PeerMismatch |
The received protocol packet does not match the customer gateway information. |
|
|
|
Algorithm mismatch |
AlgorithmMismatch |
A mismatch occurred in the encryption algorithm, authentication algorithm, or DH group parameter. |
|
|
|
Encryption algorithm mismatch |
EncryptionAlgorithmMismatch |
The IPsec encryption algorithm does not match. |
|
|
|
Authentication algorithm mismatch |
AuthenticationAlgorithmMismatch |
The IKE authentication algorithm does not match. |
|
|
|
DH group mismatch |
DhGroupMismatch |
The IKE Phase 1 DH group parameter does not match. |
|
|
|
Pre-shared key mismatch |
PskMismatch |
The pre-shared key parameter does not match. |
|
|
|
Peer ID mismatch |
PeerIdMismatch |
The LocalId or RemoteId does not match or is incompatible. |
|
|
|
DPD payload order incompatibility |
DpdHashNotifyCompatibility |
DPD payload order is incompatible. |
|
When the Dead Peer Detection (DPD) feature is enabled for the IPsec connection, the default DPD payload order is |
|
DPD timeout |
DpdTimeout |
DPD message timed out. |
|
|
|
IKE version mismatch |
IkeVersionMismatch |
The IKE version or negotiation mode does not match. |
|
|
|
Negotiation mode mismatch |
NegotiationModeMismatch |
The negotiation mode does not match. |
|
|
|
NAT-T mismatch |
NatTMismatch |
NAT Traversal does not match. |
|
Verify that the NAT Traversal feature has the same status (enabled or disabled) on both the IPsec connection and the peer gateway device. If not, modify the settings to match. If the peer gateway device is behind a NAT gateway, we recommend that you enable the NAT Traversal feature on both the IPsec connection and the peer gateway device. |
|
SA lifecycle mismatch |
LifetimeMismatch |
The Lifetime parameter does not match. |
|
Verify that the SA Life Cycle (seconds) configured in the IKE Configurations and IPsec Configurations phases is identical for the IPsec connection and the peer gateway device. If not, modify the settings to match. The SA Life Cycle (seconds) values are not required to be identical. However, to ensure connection stability across different gateway vendors, we recommend that you configure the same SA Life Cycle (seconds) on both ends. |
|
Security protocol mismatch |
SecurityProtocolMismatch |
The security protocol parameter does not match. |
|
Verify that the peer gateway device uses Encapsulating Security Payload (ESP) as the security protocol. If not, change the protocol to ESP. Alibaba Cloud VPN Gateway supports only ESP for IPsec-VPN connections. Authentication Header (AH) is not supported. |
|
Encapsulation mode mismatch |
EncapsulationModeMismatch |
The encapsulation mode does not match. |
|
Verify that the peer gateway device uses tunnel mode as the encapsulation mode. If not, change the mode to tunnel mode. Alibaba Cloud VPN Gateway supports only tunnel mode for IPsec-VPN connections. transport mode is not supported. |
|
Algorithm incompatibility |
AlgorithmCompatibility |
The algorithm is incompatible. |
None |
The Authentication Algorithm configured for the IPsec connection and the peer gateway device in the IKE Configurations and IPsec Configurations phases is incompatible. We recommend that you use a different Authentication Algorithm on both ends, such as md5. |
|
Traffic selector mismatch |
TrafficSelectorMismatch |
The traffic selector CIDR block parameter does not match. |
|
|
|
PFS mismatch |
PfsMismatch |
The IPsec Phase 2 DH group parameter does not match. |
|
Verify that the status of the Perfect Forward Secrecy (PFS) feature in the IPsec Configurations phase is the same for the IPsec connection and the peer gateway device. If not, modify the settings to match.
We recommend enabling the PFS feature on both the IPsec connection and the peer gateway device. |
|
Commit bit mismatch |
CommitMismatch |
The commit bit does not match. |
None |
Check if the commit bit is enabled on the peer gateway device. If it is, disable it. The commit bit is used to ensure that the IPsec protocol negotiation is complete before protected data is sent. Alibaba Cloud VPN Gateway does not support the commit bit configuration. |
|
Proposal mismatch |
ProposalMismatch |
The proposal does not match. |
|
|
|
Negotiation failed |
NegotiationFailed |
Protocol negotiation failed. |
|
Reset the IPsec-VPN connection to trigger a new IPsec negotiation. The system will perform the check again. |
|
Phase 1 negotiation timeout |
Phase1NegotiationTimeout |
Negotiation failed due to a timeout while waiting for Phase 1 protocol packets. |
|
|
|
Phase 2 negotiation timeout |
Phase2NegotiationTimeout |
Negotiation failed due to a timeout while waiting for Phase 2 packets. |
None |
|
|
Cannot receive response packets from the peer |
NoResponse |
The peer gateway does not respond. |
|
|
|
Received delete message from peer |
ReceiveDeleteNotify |
A delete message was received from the peer. |
|
The IPsec connection received a |
|
Negotiation exception cause not diagnosed |
NoExceptionFound |
The cause of the negotiation exception was not diagnosed. |
None |
This result may occur if the IPsec-VPN connection has not started negotiation. Reset the IPsec-VPN connection on either the Alibaba Cloud side or the peer network device. On the Alibaba Cloud side, you can modify the value of Effective Immediately for the IPsec connection, save the change, and then change the value of Effective Immediately back to its original setting to trigger an IPsec protocol negotiation. Then, refresh the current page to view the result. |
Related operations
The following documents describe operations that may be useful when you troubleshoot IPsec-VPN connection issues:
-
To modify the configuration of an IPsec connection, see Modify an IPsec connection associated with a VPN gateway and Modify an IPsec connection associated with a transit router.
-
After a customer gateway is created, you can modify only its name and description. To modify other settings, follow the steps below to replace the customer gateway. The procedure varies based on the resource with which the IPsec connection is associated.
-
The IPsec connection is associated with a VPN gateway
-
Create a customer gateway and ensure that its configuration is correct. For more information, see Create a customer gateway.
-
Delete the IPsec connection. For more information, see Delete an IPsec connection.
-
Recreate the IPsec connection and associate it with the new customer gateway. For more information, see Create an IPsec connection.
-
Delete the old customer gateway. For more information, see Delete a customer gateway.
-
-
The IPsec connection is associated with a transit router or no resource
-
Create a customer gateway and ensure that its configuration is correct. For more information, see Create a customer gateway.
-
Modify the IPsec connection to associate it with the new customer gateway that you created. For more information, see Manage a single-tunnel mode IPsec connection.
-
Delete the old customer gateway. For more information, see Delete a customer gateway.
-
-
For help modifying the peer gateway device configuration, consult the device vendor.
References
DiagnoseVpnConnections: Diagnose IPsec-VPN connections.