After creating an IPsec-VPN connection, you must also configure a route on both the cloud gateway and the on-premises gateway. This ensures bidirectional traffic flow between the cloud and on-premises networks, enhancing rapid route convergence and network communication quality.
- Cloud gateway route: On the VPN gateway or Transit Router (TR) associated with the IPsec-VPN connection, configure routes for the connection peer (an on-premises data center or another VPC).
- On-premises gateway route: To connect an on-premises data center with a Virtual Private Cloud (VPC) via VPN Connect, configure VPN-specific settings on the data center gateway.
Due to the wide variety of on-premises firewall models and their varying configurations, this documentation covers only the VPN configuration for common models.
tip
Route configuration is not required for SSL-VPN connections.
Route types
IPsec-VPN connections support both static and dynamic routing propagation modes. Choose the mode that best suits your scenario.
Route recommendations and limits
IPsec-VPN connection via VPN gateway
IPsec-VPN connection via TR
- In dynamic routing mode, we recommend using Destination Routing Mode. If the routing mode for the IPsec-VPN connection is Protected Data Flows and Dynamic routing is selected, only dynamic routes within the Protected Data Flows CIDR block take effect. Routes outside this block are ignored.
- In the scenario where multiple IPsec-VPN connections are created on the same VPN gateway, we recommend using the same propagation mode for all connections under this VPN gateway. That is, use either all static or all dynamic routing for all IPsec-VPN connections.
- Avoid propagating the following types of routes, as they will consume the route quota of the VPN gateway and may be rejected by VPC.
- Dynamic routes with a destination CIDR of 0.0.0.0/n, including 0.0.0.0/0.
- Dynamic routes that have the same CIDR block as the subnet range of the VPN gateway's host VPC.
- Avoid propagating loop routes with AS_PATH containing the VPN gateway's ASN.
- The VPN gateway supports only dynamic equal-cost multi-path routing (ECMP) routes, but not static ECMP routes.
- A single TR instance or VPN gateway supports ECMP routing across up to 16 IPsec-VPN connections.
- The VPN gateway can receive routes with an AS_PATH length up to 29 and send routes with an AS_PATH length up to 30.
- The VPN gateway's route table supports a maximum of 200 routes by default. Routes exceeding this limit will be discarded. If the default quota cannot satisfy your needs, go to the Quota center to increase the corresponding quota. For procedure, see Quota management.
- Sending a massive number of dynamic routes may cause the BGP session to drop. If the number of dynamic routes sent over an IPsec-VPN connection exceeds 1,000 (via a VPN Gateway) or 5,000 (via a TR), the BGP session will terminate abruptly. It will not recover even after the excess routes are withdrawn. To send a massive number of dynamic routes, submit a ticket.
- In scenarios with a small number of instance routes, we recommend configuring static routes. You need to manually configure routes on the TR.
- In scenarios with a large number of instance routes, we recommend configuring auto-learned routes. The TR route table will automatically generate entries with the next hop of the network instance.
- Route match sequence: Static route > Auto-learned route. Among auto-learned routes, prefer routes with the shortest AS_PATH length. Learn more
- Avoid propagating the following routes that may be rejected by the TR:
- A route whose destination CIDR block is exactly the same as that of an existing entry in the route table.
- A route whose destination CIDR block is a multicast CIDR block (224.0.0.0 to 239.255.255.255 or FF00::/8).
- A route whose AS_PATH contains the ASN of this TR.
- A route whose AS_PATH length exceeds 30.
- Each network instance attachment can be configured with only one associated forwarding route table.
- To configure association forwarding or route learning when creating a cross-account attachment, you can select only the system route table. The TR route table can be modified by the Sharer solely.
- You can add a maximum of 2,000 routes to a single TR route table, and can create up to 20 tables (including the system route table) for a single TR instance. Learn more
Route propagation and configuration requirements
IPsec-VPN connection via VPN gateway
IPsec-VPN connection via TR
Route configuration guide
IPsec-VPN connection via VPN gateway
IPsec-VPN connection via TR
TR route table consists of a series of route entries and supports associated forwarding, route learning, and static routing. This allows quick addition of routes and flexible control of traffic direction in and out of the TR. For more information, see TR Route Table overview.
On-premises gateway route
- The gateway device in your on-premises data center supports the IKE V1 or IKE V2 protocol.
- The gateway device in your data center has a static Elastic IP Address (EIP).
- The CIDR blocks of your data center must not overlap with those of the VPC where the VPN gateway to be communicated with is located.
For your convenience, we introduce two configuration methods. You can select the one that best suits your scenario.
Manual configuration
File configuration