You can use Cloud Enterprise Network (CEN) to connect VPCs across regions. This topic uses a VPC in US (Virginia) and a VPC in Indonesia (Jakarta) as an example.
Scenario
Assume that you have two VPCs in different regions:
|
VPC1 |
VPC2 |
|
|
To connect the VPCs, create a CEN instance, attach each VPC to the transit router in its region, and create an inter-region connection between the transit routers. This configuration enables the VPCs to communicate with each other over a private network.
When planning your network resources, ensure that the following requirements are met:
-
The CIDR blocks of the VPCs that you want to connect do not overlap.
-
For zone-level disaster recovery in regions where Enterprise Edition transit routers support multiple zones, you must create at least two vSwitches in different zones within each VPC.
Procedure
Step 1: Create a CEN instance
-
Log on to the Cloud Enterprise Network console. In the left-side navigation pane, click CEN Instance. On the Instances page, click Create CEN Instance.
-
In the Create CEN Instance dialog box, enter
cen-inter-regionin the Name field, and then click Confirm. -
After the The CEN instance is created message appears, click View Details.
Step 2: Create source and destination transit routers
-
On the CEN instance details page, click Create Transit Router.
-
In the Create Transit Router dialog box, select US (Virginia) for Region, keep the default settings for other options, and then click Confirm.
-
After the transit router is created in the US (Virginia) region, create another transit router in the Indonesia (Jakarta) region.
-
The two transit routers that you created are displayed on the CEN instance details page.
Step 3: Create an inter-region connection
-
In the Actions column of the US (Virginia) transit router, click Create Connection, and then select Inter-region.
-
On the Create Inter-region Connection page, configure the following parameters:
-
Region: Select US (Virginia).
-
Network Connection Name:
inter-region-attachment. -
Peer Region: Select Indonesia (Jakarta).
-
Bandwidth Allocation Mode: Select Pay-By-Data-Transfer. If you select this mode, you are charged for data transfer by Cloud Data Transfer (CDT).
Keep the default settings for the other options and click OK.
-
-
The The connection is created. message indicates that the transit routers in the two regions are connected.
Step 4: Attach VPCs to the transit routers
-
On the CEN instance details page, click the instance ID or name, and then click the Intra-region Connections tab.
-
On the Intra-region Connections tab, click Create Intra-region Connection.
-
On the Create Intra-region Connection page, configure the following parameters:
-
Instance Edition: Select Virtual Private Cloud (VPC).
-
Region: Select US (Virginia).
-
Network Connection Name: Enter
attach1. -
Network Instance: Select
VPC1.
Keep the default settings for the other options and click OK.
NoteTo ensure multi-zone disaster recovery, the system automatically selects the two vSwitches in the VPC. If the VPC has a vSwitch in only one zone, you must create at least one more vSwitch in a different zone.
-
-
The The connection is created. message indicates that
VPC1is attached to the transit router. -
Repeat the preceding steps to attach
VPC2to its transit router. For this connection, select Indonesia (Jakarta) for Region, enterattach2for Attachment Name, and selectVPC2for Network Instance.
Step 5: Configure route entries
Configure the required route entries to access MaxCompute.
-
Run the
nslookupcommand to query the IP addresses of the source VPC endpoint, the public data transmission VPC endpoint, and the exclusive data transmission VPC endpoint:nslookup service.{src-region-id}-vpc.maxcompute.aliyun-inc.com nslookup service.{src-region-id}.maxcompute.aliyun-inc.com # If you use DataWorks to add a MaxCompute project across regions, you must also configure this endpoint. nslookup dt.{src-region-id}-vpc.maxcompute.aliyun-inc.com nslookup dt-exclusive.{src-region-id}-vpc.maxcompute.aliyun-inc.com -
Configure route entries in the route table of the destination VPC.
-
Log on to the VPC console. In the left-side navigation pane, choose Route Tables.
-
Click the ID of the destination route table to open its details page.
-
On the Route Entry List tab, click the Custom Route tab, and then click Add Route Entry.
-
In the Add Route Entry dialog box, configure the following parameters:
-
Destination CIDR Block: Enter the IP addresses from the previous step.
-
Next Hop Type: Select Transit Router.
-
-
-
Configure the route table of the source transit router.
ImportantTo use DataWorks to add a MaxCompute project across regions, configure the route tables of the transit routers in both the source and destination regions.
-
Log on to the Cloud Enterprise Network console. In the left-side navigation pane, click CEN Instance.
-
On the Instances page, click the ID of the CEN instance. On the instance details page, click the name of the source transit router.
-
Click the Route Tables tab, and then click Add Route Entry.
-
On the Add Route Entry page, configure the following parameters:
-
Destination CIDR Block: Enter the IP addresses from the previous step.
-
Next Hop: Select the source transit router.
-
-
Related documents
-
For more information about how to connect VPCs across regions, see Inter-region VPC communication.
-
For more information about how to connect VPCs that belong to different accounts, see Cross-account VPC communication.