All Products
Search
Document Center

VPN Gateway:Diagnose a VPN gateway

Last Updated:Apr 01, 2026

VPN Gateway integrates with Network Intelligence Service (NIS) to diagnose IPsec VPN gateways and surface actionable suggestions. The diagnostic process covers IPsec negotiation failures, route configuration issues, and gateway status problems — without affecting your running traffic.

Diagnostic items

VPN Gateway checks fall into four categories. If you use Border Gateway Protocol (BGP) dynamic routing, pay particular attention to the BGP-specific items in Configuration diagnostics and Route diagnostics.

If you use static routing (policy-based or destination-based routes) rather than BGP, you can skip the items marked as BGP-specific below.

Configuration diagnostics

Diagnostic itemWhat it checksWhat to do if it fails
Instance configuration checkWhether the VPN gateway is still being configuredWait until the gateway status changes to Active before proceeding.
Version checkWhether the VPN gateway is running the latest versionUpgrade the gateway. See Upgrade a VPN gateway.
IKE tunnel negotiation statusPhase 1 and Phase 2 negotiation status for each IPsec-VPN connectionFollow the guidance in the console, or see Troubleshoot IPsec-VPN connection issues.
VPN tunnel configuration integrityWhether required configuration items are missing from an IPsec-VPN connectionReconfigure the connection. See Create and manage IPsec-VPN connections in single-tunnel mode or Create and manage IPsec-VPN connections in dual-tunnel mode.
System network segment conflictWhether policy-based routes, destination-based routes, or BGP routes conflict with the reserved CIDR block 100.64.0.0/10Modify the conflicting CIDR blocks, or use NAT Gateway for address translation. See Use a VPC NAT gateway and a VPN gateway to connect a data center and a VPC.
BGP consistency check (BGP only)Whether Phase 2 negotiations succeeded but BGP negotiations failedCheck BGP configurations and packet transmission. See the "What do I do if Phase 2 negotiations succeeded but BGP negotiation is in the Abnormal state?" section of FAQ about IPsec-VPN connections.
Shared Phase 1 IPsec negotiationsWhether multiple IPsec-VPN connections sharing Phase 1 use identical Internet Key Exchange (IKE) configurationsAlign the configurations of all affected connections. All connections must share the same Pre-Shared Key, IKE Version, Negotiation Mode, Encryption Algorithm, Authentication Algorithm, DH Group, and SA Lifetime (Seconds). See Create and manage IPsec-VPN connections in single-tunnel mode.
Multiple IPsec-VPN connections share Phase 1 when they are all associated with the same customer gateway and use the same IKE version.

Quota limit diagnostics

Diagnostic itemWhat it checksWhat to do if it fails
VPN bandwidth usageWhether bandwidth usage has reached 80% of the upper limitUpgrade the gateway bandwidth. See Upgrade or downgrade a VPN gateway.

Cost diagnostics

Diagnostic itemWhat it checksWhat to do if it fails
Alerts for overdue paymentsWhether the VPN gateway has outstanding paymentsAdd funds to your Alibaba Cloud account.

If the VPN gateway has overdue payments, add funds to your account.

Alerts for expirationWhether the VPN gateway expires within seven daysRenew the gateway before it expires.

Route diagnostics

Diagnostic itemWhat it checksWhat to do if it fails
Unpublished routesWhether unadvertised policy-based or destination-based routes existDelete or advertise the routes based on your network requirements. See Advertise a policy-based route and Advertise a destination-based route.
BGP configuration check (BGP only)Whether a BGP-enabled IPsec-VPN connection follows recommended BGP practicesApply the following practices: (1) Do not configure policy-based or destination-based routes alongside BGP. (2) Disable the health check feature. (3) Set Routing Mode to Destination Routing Mode when using BGP dynamic routing.
VPN routing configuration integrityWhether required route configurations are missing, and whether automatic BGP route propagation is enabled for BGP connectionsAdd the missing routes or enable automatic BGP route propagation. See Configure policy-based routes, Manage destination-based routes, or the Procedure section of "Configure BGP dynamic routing".
Destination-based route conflictsWhether the destination CIDR blocks of destination-based routes overlapDelete the conflicting routes and create new ones with non-overlapping CIDR blocks. See Manage destination-based routes. Alternatively, switch to BGP — see Connect a VPC to a data center in dual-tunnel and BGP routing mode.
Policy-based route conflictsWhether the destination CIDR blocks of policy-based routes overlapDelete the conflicting routes and create new ones with non-overlapping CIDR blocks. See Configure policy-based routes. Alternatively, switch to BGP — see Connect a VPC to a data center in dual-tunnel and BGP routing mode.
BGP route conflict check (BGP only)Whether BGP route CIDR blocks overlap with each other, with destination-based routes, or with policy-based routesFollow the on-screen instructions in the console to resolve the conflicts.
VPC and VPN route matchWhether the destination CIDR block in the VPC route table entry pointing to the VPN gateway is contained within the policy-based route CIDR blockDelete the policy-based route and create a new one whose destination CIDR block contains the VPC route table entry's CIDR block. See Configure policy-based routes.

Run a diagnosis

  1. Log on to the VPN Gateway console.

  2. In the top navigation bar, select the region where the VPN gateway is deployed.

  3. On the VPN Gateways page, find the VPN gateway, then click Diagnose > Instance Diagnosis in the Diagnose column.

  4. In the Instance Diagnostics panel, review the diagnostic results.

发起诊断
If this is your first time using NIS, select Terms of Service for Standard Edition NIS and click Activate NIS free of charge to diagnose instances.
If you are a Resource Access Management (RAM) user and see a permissions error, ask your Alibaba Cloud account owner to grant you the AliyunNISFullAccess permission. See Grant permissions to a RAM user.
The first time you diagnose a VPN gateway, the system automatically creates the service-linked role AliyunServiceRoleForNis. See Service-linked roles.

The Instance Diagnostics panel has three sections:

SectionDescription
Lists detected anomalies with diagnosis details, affected resources, and suggested fixes.
Select Show All Diagnostic Items in the Diagnostic Items section to view results for all checks, including passed ones.
Click Go to the NIS console to view diagnostic records to open the NIS Overview page and review historical diagnostic reports for this gateway. See Overview.

Diagnostic example

实例诊断-IPsec-VPN

The following example shows how to diagnose a VPN gateway before using an IPsec-VPN connection to carry production traffic between an on-premises data center and a VPC.

  1. Run a diagnosis on the VPN gateway as described in Run a diagnosis.

  2. In the Instance Diagnostics panel, review the results.

发起诊断-示例1

In this example, the system detects a Phase 1 Negotiation Failed error. Click Phase 1 Negotiation Failed in the Diagnostic Result column to view the details and follow the provided guidance to fix the issue.

You can also use the error message on the IPsec Connections page for troubleshooting. If Phase 1 or Phase 2 negotiation fails, an error message appears on that page. See Troubleshoot IPsec-VPN connection issues.

发起诊断-示例1-IPsec连接错误码

In this case, the error indicates that the pre-shared key differs between the VPN gateway and the peer gateway. Set the same pre-shared key on both sides to resolve the issue.

  1. After resolving the issue, run the diagnosis again to confirm the gateway passes all checks.

发起诊断-示例1-诊断通过
  1. If the gateway passes diagnostics but you still experience connectivity issues — such as communication failures between the data center and the VPC — see FAQ about IPsec-VPN connections for further troubleshooting.