Connect VPCs across regions by using CEN

更新时间:
复制 MD 格式

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

image

Assume that you have two VPCs in different regions:

VPC1

VPC2

  • Region: US (Virginia)

  • IPv4 CIDR block: 10.0.0.0/16

  • vSwitch 1, in zone A, with a CIDR block of 10.0.0.0/24

  • vSwitch 2, in zone B, with a CIDR block of 10.0.1.0/24

  • ECS1 address: 10.0.0.1

  • Region: Indonesia (Jakarta)

  • IPv4 CIDR block: 172.16.0.0/16

  • vSwitch 1, in zone A, with a CIDR block of 172.16.0.0/24

  • vSwitch 2, in zone B, with a CIDR block of 172.16.1.0/24

  • ECS2 address: 172.16.0.1

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.

Important

When planning your network resources, ensure that the following requirements are met:

  1. The CIDR blocks of the VPCs that you want to connect do not overlap.

  2. 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

  1. 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.

  2. In the Create CEN Instance dialog box, enter cen-inter-region in the Name field, and then click Confirm.

  3. After the The CEN instance is created message appears, click View Details.

Step 2: Create source and destination transit routers

  1. On the CEN instance details page, click Create Transit Router.

  2. In the Create Transit Router dialog box, select US (Virginia) for Region, keep the default settings for other options, and then click Confirm.

  3. After the transit router is created in the US (Virginia) region, create another transit router in the Indonesia (Jakarta) region.

  4. The two transit routers that you created are displayed on the CEN instance details page.

Step 3: Create an inter-region connection

  1. In the Actions column of the US (Virginia) transit router, click Create Connection, and then select Inter-region.

  2. 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.

  3. 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

  1. On the CEN instance details page, click the instance ID or name, and then click the Intra-region Connections tab.

  2. On the Intra-region Connections tab, click Create Intra-region Connection.

  3. 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.

    Note

    To 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.

  4. The The connection is created. message indicates that VPC1 is attached to the transit router.

  5. Repeat the preceding steps to attach VPC2 to its transit router. For this connection, select Indonesia (Jakarta) for Region, enter attach2 for Attachment Name, and select VPC2 for Network Instance.

Step 5: Configure route entries

Configure the required route entries to access MaxCompute.

  1. Run the nslookup command 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
  2. Configure route entries in the route table of the destination VPC.

    1. Log on to the VPC console. In the left-side navigation pane, choose Route Tables.

    2. Click the ID of the destination route table to open its details page.

    3. On the Route Entry List tab, click the Custom Route tab, and then click Add Route Entry.

    4. 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.

  3. Configure the route table of the source transit router.

    Important

    To use DataWorks to add a MaxCompute project across regions, configure the route tables of the transit routers in both the source and destination regions.

    1. Log on to the Cloud Enterprise Network console. In the left-side navigation pane, click CEN Instance.

    2. On the Instances page, click the ID of the CEN instance. On the instance details page, click the name of the source transit router.

    3. Click the Route Tables tab, and then click Add Route Entry.

    4. 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

  1. For more information about how to connect VPCs across regions, see Inter-region VPC communication.

  2. For more information about how to connect VPCs that belong to different accounts, see Cross-account VPC communication.