- Documentation
Transit Router
Best Practices
Implementing interconnectivity between independent VPCs and a data center (cross-account, same region)
Best Practices
Implementing interconnectivity between independent VPCs and a data center (cross-account, same region)
Implementing interconnectivity between independent VPCs and a data center (cross-account, same region)
This topic describes how to configure Transit Router (TR) for cross-account connectivity in the same region, allowing different Virtual Private Clouds (VPCs) to access the same on-premises data center while remaining isolated from each other.
Scenarios
A company has deployed two VPCs in Region A. Both VPCs need to share the VPN Connect or Direct Connect (DC) resources owned by another account to access an on-premises data center. The two VPCs themselves must remain isolated from each other. This scenario can be implemented using TR, as illustrated in the following diagram.
Data planning
- Select a region that is closest to the geographical location of the data center for VPN or DC. This example selects China (Beijing).
- Before configuration, plan the CIDR blocks, routes, and other parameters for the network resources shown in the topology diagram.
tip
Routes in the VPC route tables illustrated below can be manually configured or automatically synchronized. This example uses auto publishing.
Prerequisites
- You have created necessary VPCs and their subnets. For procedure, see Creating a VPC.
- You have created Elastic Compute Service (ECS) instances in the VPCs. For procedure, see Buying ECS instances.
- You have completed the following configuration based on the service type connecting to the on-premises data center. For parameters, see Data planning.
tip
The IPsec-VPN connection in this example uses dynamic routing, ensuring that your customer gateway supports BGP and that valid ASNs have been configured for associated resources and the customer gateway.
- You have obtained the IP address of the server in the data center and ensured the server is properly operational.
- You have enabled the resource sharing feature to proactively share TR capabilities. If not enabled, please contact your account manager.
Configuration procedures
tip
This example only covers required parameters. Leave other parameters at their default values.
Step 1: Configure a TR instance (Account A)
tip
When you create a TR instance, the system automatically creates a system route table for it (e.g., named tr01-rtb-sys). In this example, this system route table is used to forward traffic from vpc01 and vpc02.
- tr01-rtb-sys contains no entries, while the routes in tr01-rtb-set are listed below.
- Since the routes in tr01-rtb-sys are automatically published to the vpc01 and vpc02 route tables, routes in the vpc01 and vpc02 route tables are unchanged.
Step 2: Initiate cross-account TR sharing (Account A)
- Click Create shared unit and configure the basic information based on the table below.
- Click Next to associate sharing permissions.
- TR sharing permissions are system-defined and cannot be modified. For default supported actions, see Instructions.
- Click Next to associate shared users.
- Click Add to specify resource users.
- Click Next to confirm that the resources, associated permissions, and shared users are correct.
- Click Confirm to complete the action.
Step 3: Configure a cross-account network instance attachment (Account B)
- Accept a sharing invitation.
- In the top menu bar, select the region to which the shared TR belongs.
- Click Accept on the right of the shared unit to complete the action.
Connect to the data center via VPN
Connect to the data center via DC
tip
After the VPN attachment is created, complete the VPN configuration on the server in the on-premises data center, ensuring it is consistent with the IPsec-VPN connection settings. For parameters, see Data planning. OP
Configure the basic information, network instance, and routing information for the network instance attachment based on the table below.
Step 4: Create association forwarding (Account A)
- Click the name (tr01) of the target TR instance.
- In the zone below Basic information, select the Route Table tab.
- Select the target route table (tr01-rtb-set) and click the Associated forwarding tab.
- Click Create association forwarding and complete the configuration based on the table below.
- Attachment type: Select the intra-region attachment.
- Network instance attachment: Select based on the type of cloud resource that connects to your on-premises data center.
- Select attach-ipsec01 when connecting to the on-premises data center via VPN.
- Select attach-dcg01 when connecting to the on-premises data center via DC.
- The TR route table (tr01-rtb-sys) has learned the route entries pointing to the data center CIDR block from the DC or VPN.
- When the data center is connected via DC, tr01-rtb-sys should have learned the routes listed in the table below.
- When connecting the data center via VPN, tr01-rtb-sys should have learned the routes listed in the table below.
- The route tables of vpc01 and vpc02 have learned the routes to the data center's CIDR block from the TR, as shown in the table below.
Result validation
- Execute the ping command to connect to respective servers in vpc02 and the on-premises data center, verifying that vpc01 communicates with the data center but not with vpc02.
- Similarly, log in to the ECS instance in vpc02 and verify connectivity between vpc02 and the server in the data center.
Last updated: 2026.09.01 11:37:17