You can troubleshoot an IPsec-VPN connection issue based on the error code and log data of the IPsec-VPN connection displayed in the VPN Gateway console.
Background information
This topic describes common IPsec-VPN issues and how to troubleshoot these issues. The VPN Gateway console displays the error codes and log data of IPsec-VPN connections. You can look up the same error codes or log data in the Common IPsec-VPN connection issues and solutions section of this topic to find the corresponding solutions.
For more information about how to view IPsec-VPN connection error codes, see the View error codes section of this topic.
For more information about how to view the logs of IPsec-VPN connections, see View the logs of an IPsec-VPN connection.
View error codes
If your IPsec-VPN connection is associated with a VPN gateway that was created before March 21, 2019 and has not been updated, you cannot view the error codes of the IPsec-VPN connection. To view the error codes, you must update the VPN gateway to the latest version. For more information, see Upgrade a VPN gateway.
You can view only Chinese and English error codes. Other languages are not supported.
The VPC Gateway console displays the error codes of IPsec-VPN connection issues that are identified within the last 3 minutes. To view the error code of the most recent IPsec-VPN connection issue, you can reset the IPsec-VPN connection on an IPsec peer to trigger an IPsec negotiation and then refresh the page.
On the Alibaba Cloud side, you can change the value of the Effective Immediately parameter for the IPsec-VPN connection, save the change, and then set the Effective Immediately parameter to the original value to trigger an IPsec negotiation.
IPsec-VPN connections in single-tunnel mode
If the IPsec-VPN connections use the single-tunnel mode, refer to the following steps to view error codes.
- Log on to the VPN gateway console.
In the left-side navigation pane, choose .
In the top navigation bar, select the region where the IPsec-VPN connection is created.
On the IPsec-VPN connection page, find the IPsec-VPN connection that you want to manage and view the error code in the Connection Status column.
You can click View Details to the right of the error code and then check the error message and solution displayed in the Error details panel. The solution displayed in the Error details panel is the same as that described in the Common IPsec-VPN connection issues and solutions section of this topic.
IPsec-VPN connections in dual-tunnel mode
If the IPsec-VPN connections use the dual-tunnel mode, refer to the following steps to view error codes.
- Log on to the VPN gateway console.
In the left-side navigation pane, choose .
In the top navigation bar, select the region where the IPsec-VPN connection is created.
On the IPsec-VPN connection page, click the ID the IPsec-VPN connection that you want to manage.
In the Connection Status column of the Tunnel tab, view the error codes of the active tunnel or standby tunnel.
You can click View Details to the right of the error code and then check the error message and solution displayed in the Error details panel. The solution displayed in the Error details panel is the same as that described in the Common IPsec-VPN connection issues and solutions section of this topic.
Common IPsec-VPN connection issues and solutions
After you obtain the error code and log data of an IPsec-VPN connection, you can look up the same error code or the keyword of the log entry in the following table to find the corresponding solution.
If you call the DiagnoseVpnConnections operation to troubleshoot IPsec-VPN connection issues, look up the error code in the API-based error code column in the following table.
Console-based error code | API-based error code
| Error message | Keyword of the log entry | Solution |
The peer does not match. | PeerMismatch | The packet received does not match the customer gateway information. |
|
|
The algorithm does not match. | AlgorithmMismatch | The encryption algorithm, authentication algorithm, or DH group parameter does not match. |
|
|
The encryption algorithm does not match. | EncryptionAlgorithmMismatch | The encryption algorithm of the IPsec-VPN connection does not match. |
|
|
The authentication algorithm does not match. | AuthenticationAlgorithmMismatch | The authentication algorithm of IKE does not match. |
|
|
The DH group does not match. | DhGroupMismatch | The Phase 1 DH group parameter of IKE does not match. |
|
|
The pre-shared key does not match. | PskMismatch | The pre-shared key does not match. |
|
|
PeerID does not match. | PeerIdMismatch | The LocalID or RemoteID parameter does not match or is incompatible. |
|
|
DPD payload sequence is incompatible. | DpdHashNotifyCompatibility | DPD payload sequence is incompatible. |
| In scenarios where the Dead Peer Detection (DPD) feature is enabled, the default payload sequence is |
DPD timed out. | DpdTimeout | DPD packets timed out. |
|
|
The IKE version does not match. | IkeVersionMismatch | The IKE version or negotiation mode does not match. |
|
|
The negotiation mode does not match. | NegotiationModeMismatch | The negotiation mode does not match. |
|
|
NAT-T does not match. | NatTMismatch | NAT traversal does not match. |
| Make sure that the IPsec-VPN connection and customer gateway device use the same NAT traversal setting. If the customer gateway device is a backend device of a NAT gateway, we recommend that you enable NAT traversal for the IPsec-VPN connection and customer gateway device. |
SA Lifetime does not match. | LifetimeMismatch | The Lifetime parameter does not match. |
| Make sure that the SA lifecycle (seconds) of the IPsec-VPN connection in the IKE configuration and IPsec configuration is the same as that of the customer gateway device. The IPsec-VPN connection and customer gateway device can use different SA lifecycle (seconds) values. However, to ensure the stability of the IPsec-VPN connection when customer gateway devices from different manufacturers are used, we recommend that you configure the IPsec-VPN connection and customer gateway device to use the same SA lifecycle (seconds) value. |
The security protocol does not match. | SecurityProtocolMismatch | The security protocol does not match. |
| Make sure that the customer gateway device uses Encapsulating Security Payload (ESP) as the security protocol. VPN Gateway supports only the ESP protocol for IPsec-VPN connections. Authentication Header (AH) is not supported. |
The encapsulation mode does not match. | EncapsulationModeMismatch | The encapsulation mode does not match. |
| Make sure that the encapsulation mode of the customer gateway device is set to tunneling. VPN Gateway supports only the tunneling mode for IPsec-VPN connections. The transmission mode is not supported. |
The algorithm is incompatible. | AlgorithmCompatibility | The algorithm is incompatible. | N/A | If the authentication algorithm in the IKE configuration and IPsec configuration of the IPsec-VPN connection and customer gateway device is incompatible, select another authentication algorithm, such as md5. |
Protected Data Flow does not match. | TrafficSelectorMismatch | The Protected Data Flows parameter does not match. |
|
|
PFS does not match. | PfsMismatch | The Phase 2 DH group parameter does not match. |
| Make sure that the IPsec-VPN connection and customer gateway device use the same Perfect Forward Secrecy (PFS) setting in the IPsec configuration.
We recommend that you enable PFS for the IPsec-VPN connection and customer gateway device. |
The commit bit does not match. | CommitMismatch | The commit bit does not match. | N/A | Make sure that commits are disabled for the customer gateway device. Commits can ensure that IPsec negotiations are complete before the protected data flows are transmitted. VPN Gateway does not support commits. |
The proposal does not match. | ProposalMismatch | The proposal does not match. |
|
|
Negotiation failed. | NegotiationFailed | Negotiation failed. |
| Reset the IPsec-VPN connection to trigger an IPsec negotiation. The system checks the negotiation configuration again. |
Phase 1 negotiations timed out. | Phase1NegotiationTimeout | Phase 1 packets cannot be received and negotiation timed out. |
|
|
Phase 2 negotiations timed out. | Phase2NegotiationTimeout | Phase 2 packets cannot be received and negotiation timed out. | N/A |
|
Response packets cannot be received from the peer. | NoResponse | The peer gateway does not respond. |
|
|
The delete packet is received from the peer. | ReceiveDeleteNotify | The delete packet from the peer is received. |
| If the IPsec-VPN connection receives a |
The reason for the negotiation exception is not found. | NoExceptionFound | The reason for the negotiation exception is not found. | N/A | The IPsec-VPN connection may not have started an IPsec negotiation. Reset the IPsec-VPN connection on the Alibaba Cloud side or customer gateway device. On the Alibaba Cloud side, you can change the value of the Effective Immediately parameter for the IPsec-VPN connection, save the change, and then set the Effective Immediately parameter to the original value to trigger an IPsec negotiation. Then, refresh the page and check the negotiation result. |
What to do next
This section provides references for the operations that you may perform when you troubleshoot IPsec-VPN connection issues.
You can modify the configurations of an IPsec-VPN connection. For more information, see the Modify the configurations of an IPsec-VPN connection and Modify the configurations of a tunnel sections of the "Create and manage IPsec-VPN connections in dual-tunnel mode" topic.
You can modify only the name and description of a customer gateway after the customer gateway is created. If you want to modify the configuration of the customer gateway when you troubleshoot an IPsec-VPN connection issue, perform the following steps. The steps may vary based on the type of resource associated with the IPsec-VPN connection.
A VPN gateway is associated with the IPsec-VPN connection
Recreate a customer gateway to use the modified configuration. For more information, see the Create a customer gateway section of the "Create and manage a customer gateway" topic.
Delete the IPsec-VPN connection. For more information, see the Delete an IPsec-VPN connection section of the "Create and manage IPsec-VPN connections in dual-tunnel mode" topic.
Recreate an IPsec-VPN connection and associate the connection with the newly created customer gateway. For more information, see the Create an IPsec-VPN connection section of the "Create and manage IPsec-VPN connections in dual-tunnel mode" topic.
Delete the previous customer gateway. For more information, see the Delete a customer gateway section of the "Create and manage a customer gateway" topic.
A transit router is associated with the IPsec-VPN connection or no resource is associated with the connection
Recreate a customer gateway to use the modified configuration. For more information, see the Create a customer gateway section of the "Create and manage a customer gateway" topic.
Associate the IPsec-VPN connection with the newly created customer gateway. For more information, see the Modify an IPsec-VPN connection section of the "Create and manage IPsec-VPN connections associated with transit routers" topic.
Delete the previous customer gateway. For more information, see the Delete a customer gateway section of the "Create and manage a customer gateway" topic.
If you want to modify the configuration of the customer gateway device when you troubleshoot an IPsec-VPN connection issue, contact the manufacturer of the customer gateway device.
References
DiagnoseVpnConnections: You can call the DiagnoseVpnConnections operation to troubleshoot IPsec-VPN connection issues.