When you use peering connections to link VPCs, routing configuration becomes complex and difficult to maintain as the number of VPCs grows. Migrate your VPCs from peering connections to Cloud Enterprise Network (CEN) to enable automatic route propagation, simplify network configuration, and improve the extensibility of your network architecture.
Migration Guide
The core of migration is to redirect inter-VPC traffic from peering connections to the transit router by configuring route entries. This process has three steps:
-
Create a Cloud Enterprise Network instance: Use the scenario-based creation method. It performs the following actions:
-
Automatically creates a transit router (referred to as TR below) in the region where your VPC resides.
-
Automatically creates a VPC connection to attach each VPC to the TR. In cross-region scenarios, it also automatically creates inter-region connections between TRs.
-
Automatically enables route learning (the TR automatically learns system route entries from VPCs) and route synchronization (the TR propagates its route table entries to VPCs).
NoteIn regions where the TR supports multiple zones, each VPC must have at least two vSwitches in different zones. If this condition is not met, first create vSwitches.
-
-
Configure route entries: After confirming that route entries in both the TR and VPC route tables are active, delete the route entries associated with peering connections.
-
If your VPC route table contains routes pointing to ECS instances, VPN gateway instances, HAVIPs, or similar resources, publish these routes to the TR in the CEN console based on your connectivity requirements. For details, see Publish routes to transit router.
-
Check the TR route table to confirm it contains routes to each VPC.
-
Check each VPC route table to ensure that a route entry to TR exists. In the Cloud Enterprise Network console, go to the Network Instance Route Table tab and verify that the Status of each VPC route is displayed as Rejected.
-
If no route conflicts exist, delete the route entries whose next hop is the peering connection to achieve smooth migration.
-
If route conflicts occur, choose one of the following options:
-
Transient disconnection migration: Delete the route entries whose next hop is the peering connection directly. This may cause transient traffic disruption lasting several minutes, proportional to the number of route entries in the TR.
-
Smooth migration: Add more specific routes so that routes pointing to the TR become active in the VPC route table before deleting the peering connection routes.
For example, if the VPC route table contains both “Destination CIDR block 10.0.0.0/24, next hop peering connection” and “Destination CIDR block 10.0.0.0/24, next hop TR,” follow these steps for smooth migration:
-
Add two more specific split routes:
-
“Destination CIDR block 10.0.0.0/25, next hop peering connection”
-
“Destination CIDR block 10.0.0.128/25, next hop peering connection”
-
-
Delete the route entry: “Destination CIDR block 10.0.0.0/24, next hop peering connection.”
-
Wait for the synchronized route entry to take effect: “Destination CIDR block 10.0.0.0/24, next hop TR.”
-
Delete the two specific route entries: “Destination CIDR block 10.0.0.0/25, next hop peering connection” and “Destination CIDR block 10.0.0.128/25, next hop peering connection.”
-
-
-
-
-
Validate: Confirm that VPCs can still communicate. If successful, delete the peering connection.
Scenario Example
As shown above, assume two VPCs are already connected via a peering connection and you plan to migrate them to Cloud Enterprise Network.
Each VPC contains one vSwitch, and each vSwitch hosts one ECS instance. The two ECS instances can ping each other.
The resource planning is as follows:
|
Configuration item |
VPC1 |
VPC2 |
|
Region |
China (Hangzhou) |
China (Hangzhou) |
|
CIDR block |
10.0.0.0/16 |
172.16.0.0/16 |
|
vSwitch |
Name: Zone: J CIDR block: 10.0.0.0/24 |
Name: Zone: J CIDR block: 172.16.0.0/24 |
|
ECS |
Name: IP address: 10.0.0.1 |
Name: IP address: 172.16.0.1 |
|
Custom route entry |
Destination CIDR block 172.16.0.0/16, next hop peering connection |
Destination CIDR block 10.0.0.0/16, next hop peering connection |
Preparations
During smooth migration, network connectivity between the two VPCs remains uninterrupted.
Before starting, log on to ECS1 and run the command ping 172.16.0.1 to access ECS2. Keep this command running to monitor network connectivity in real time.
If your ECS runs Windows, add the -t parameter to keep the ping command running continuously: ping -t 172.16.0.1.
Procedure
Step 1: Create a Cloud Enterprise Network instance
-
Create one additional vSwitch in each VPC. Select zone K for both, name them
vSwitch2, and assign CIDR blocks 10.0.1.0/24 and 172.16.1.0/24 respectively. This satisfies the requirement that TR VPC connections must select at least two vSwitches in different zones. -
Log on to the Cloud Enterprise Network console. Click Create CEN Instance. On the dialog that appears, select the Create Scenario-specific CEN (Recommended) tab, choose the scenario VPC Interconnection, then click Create.
-
On the page, configure the following:
-
Region: Select China (Hangzhou).
-
Zone: Select Zone J and Zone K.
-
VPC:
-
Select VPC VPC 1 and choose its two vSwitches.
-
Click Add VPC, select VPC2 as the VPC, and choose its two vSwitches.
-
-
Click Next.
-
-
On the Confirm Networking Settings and Fees page, wait a few minutes while the system generates a configuration preview. Review the resources that will be automatically created and their associated costs. After confirming everything is correct, click Start Deployment.
-
On the Start Deployment page, the system displays Deploying. Deployment takes about 5–10 minutes. Wait patiently. When complete, the system shows Network Deployed. Click View CEN Instance to see the automatically created resources. You will see a CEN instance named “create_by_cadt” and a TR named “cn-hangzhou” automatically created within it.
-
Click the TR instance ID “cn-hangzhou” to view the two automatically created intra-region connections, indicating that VPC1 and VPC2 are now attached to the TR.
Step 2: Configure route entries
-
If your VPC route tables contain routes pointing to ECS instances, VPN gateway instances, HAVIPs, or similar resources, publish these routes to the TR in the CEN console based on your connectivity needs. This example does not include such routes, so no publishing is needed.
-
Check the TR route table: Click the TR instance ID “cn-hangzhou” and switch to the Route Table tab. You will see the TR has learned routes to VPC1 and VPC2:
Route entries include the following: Destination CIDR blocks
10.0.0.0/24and10.0.1.0/24with next hop VPC1, and destination CIDR blocks172.16.0.0/24and172.16.1.0/24with next hop VPC2. -
Check VPC route tables
-
Check VPC1’s route table: Switch to the Network Instance Route Table tab, select VPC1 under Networks, and view its route table directly.
You will see that the TR has synchronized its automatically learned routes to VPC1’s route table with no conflicts (Status is Ready):
The routes
172.16.0.0/24and172.16.1.0/24have route type Cloud Enterprise Network, next hop China (Hangzhou), and type VPC, indicating they were automatically learned from the peer VPC and synchronized to VPC1’s route table. -
Check VPC2’s route table using the same steps as for VPC1.
-
Since neither VPC route table shows route conflicts, delete the route entries whose next hop is the peering connection to complete smooth migration.
Log on to the VPC console. In the navigation pane on the left, click VPC Peering Connection. At the top, select region China (Hangzhou). Click the target VPC Peering Connection ID and switch to the Route Entry List tab. For each route entry, click Delete in the Actions column.
-
Step 3: Validate
-
Observe the ping command started during preparations. If it continues to receive acknowledgements, traffic has been successfully redirected to the transit router.
-
Delete the peering connection: Log on to the VPC console. In the navigation pane on the left, click VPC Peering Connection. At the top, select region China (Hangzhou). Find the target peering connection and click Delete in the Actions column.
How to roll back
-
Follow Use VPC peering connections to enable private connectivity between VPCs to reestablish the peering connection between VPCs. Add route entries in each VPC route table with “Destination CIDR block set to the peer VPC’s CIDR block, next hop set to the peering connection,” and ensure these routes become active. If a route conflict occurs (for example, the system reports “This CIDR block already exists in this route table”), resolve it by adding more specific routes.
-
Follow Delete a Cloud Enterprise Network instance to delete VPC connections (in cross-region scenarios, also delete inter-region connections between TRs), then delete the TR instance and the CEN instance.
References
What are the differences between Cloud Enterprise Network and VPC peering connections?