Updated on 2024-09-06 GMT+08:00

Overview

Scenario

There are two VPCs in a region. The two VPCs need to access each other and share the same Direct Connect connection to communicate with an on-premises data center.

For this to work, you can create an enterprise router in the region, and attach the two VPCs and the virtual gateway of the Direct Connect connection to the enterprise router. The enterprise router can forward traffic among the attached VPCs and the virtual gateway, and the two VPCs can share the Direct Connect connection.

Figure 1 Networking between an on-premises data center and VPCs

You can share an enterprise router with different accounts to attach VPCs of these accounts to the same enterprise router for communications.

If you need to set up a hybrid cloud network, it is recommended that you use Enterprise Router and Direct Connect Global DC Gateway. For details, see Setting Up a Hybrid Cloud Network Using Enterprise Router and Direct Connect Global DC Gateway.

From May 2024, Enterprise Router and Direct Connect Virtual Gateway cannot be used together to set up a hybrid cloud network. Existing networks that are set up using Enterprise Router and Direct Connect Virtual Gateway are not effected.

Operation Process

Figure 2 shows the process of using an enterprise router to connect an on-premises data center with VPCs.

Figure 2 Flowchart for connecting an on-premises data center with VPCs
Table 1 Steps for connecting an on-premises data center with VPCs

No.

Procedure

Description

1

Network and Resource Planning

Plan required CIDR blocks and the number of resources.

2

Creating Resources

  1. Create an enterprise router.
  2. Create two VPCs and two ECSs.
  3. Create a Direct Connect connection to connect an on-premises data center to the cloud over a line you lease from a carrier.

3

Configuring Networks

  1. Create VPC attachments for the enterprise router:
    1. Attach the two VPCs to the enterprise router.
    2. In the route tables of the VPCs, add routes for traffic to route through the enterprise router.
  2. Create a virtual gateway attachment for the enterprise router:
    1. Create a virtual gateway and attach it the enterprise router. A virtual gateway attachment is automatically added to the enterprise router.
    2. Create a virtual interface to associate the virtual gateway with the Direct Connect connection.
    3. Configure routes on the network device in the on-premises data center.

4

Verifying Connectivity Between the On-premises Data Center and VPCs

Log in to an ECS and run the ping command to verify the network connectivity between the on-premises data center and VPCs.