You can use Cloud Enterprise Network (CEN) to establish network communications between virtual private clouds (VPCs) in different regions.
Scenario
As shown in the figure, two VPCs have been created.
VPC1 | VPC2 |
|
|
You can create a CEN to connect the two VPCs to the transit routers in their respective regions, and establish an inter-region connection between the transit routers to achieve communication between VPCs.
When you plan your network, ensure that:
The CIDR blocks of the VPCs do not overlap.
To achieve zone-level disaster recovery, create vSwitches in at least two different zones in regions where the Enterprise Edition transit routers support more than one zone.
Procedure
Step 1: Create a CEN instance
| |
| |
|
Step 2: Create two transit routers
| |
| |
| |
|
Step 3: Create an inter-region connection
| |
Keep the other parameters as their defaults, and click OK. Note When you select pay-by-data-transfer, the fee is settled by Cloud Data Transfer (CDT). Enable the CDT service if it is not activated. | |
|
Step 4: Attach the VPC to the transit router
| |
Keep the other parameters as their defaults, and click OK. Note To achieve cross-zone disaster recovery, the system automatically selects the two zones under the current VPC. If your VPC has only one vSwitch, you need to create at least one more vSwitch in a different zone. | |
| |
| |
|
Step 5: Verify connectivity
Before proceeding, ensure that the security group rules of both ECS instances permit ICMP protocol access. For more details, see View security group rules and Add security group rules.
Log on to ECS1 and run the ping command to access ECS2:
ping 172.16.0.1
A successful ping
command as shown in the figure confirms that the connection between VPC1 and VPC2 is working.
Route description
In this example, CEN automatically completes association forwarding and route learning to achieve VPC communication by creating VPC connections and selecting advanced features:
CEN automatically adds three custom route entries, 10.0.0.0/8, 172.16.0.0/12, and 192.168.0.0/16, to the system route tables of VPC1 and VPC2, with the next hop being the VPC connection. The two VPCs send traffic to the transit router through these three route entries.
The two transit routers automatically learn route entries from the system route tables and send traffic from transit routers to the peer VPC.
The following section shows the route entries of the transit routers and VPCs in this example to illustrate the routing principles. You can view the route entries in the console:
To view the route entries of the transit routers, see View routes of an Enterprise Edition transit router.
To view the route entries of the VPCs, see Create and manage a route table.
Transit router 1
System route entries of the transit router in the China (Hangzhou) region are as follows:
Destination CIDR block | Next hop | Route type |
10.0.0.0/24 |
| Automatic learning |
10.0.1.0/24 |
| Automatic learning |
172.16.0.0/24 |
| Automatic learning |
172.16.1.0/24 |
| Automatic learning |
Transit router 2
System route entries of the transit router in the China (Shanghai) region are as follows:
Destination CIDR block | Next hop | Route type |
10.0.0.0/24 |
| Automatic learning |
10.0.1.0/24 |
| Automatic learning |
172.16.0.0/24 |
| Automatic learning |
172.16.1.0/24 |
| Automatic learning |
VPC1
System route entries of VPC1 are as follows:
Destination CIDR block | Next hop | Route type |
10.0.0.0/24 | Local | System |
10.0.1.0/24 | Local | System |
10.0.0.0/8 |
| Custom |
172.16.0.0/12 |
| Custom |
192.168.0.0/16 |
| Custom |
VPC2
System route entries of VPC2 are as follows:
Destination CIDR block | Next hop | Route type |
172.16.0.0/24 | Local | System |
172.16.1.0/24 | Local | System |
10.0.0.0/8 |
| Custom |
172.16.0.0/12 |
| Custom |
192.168.0.0/16 |
| Custom |
If the CIDR blocks that you plan do not belong to the three private CIDR blocks, 10.0.0.0/8, 172.16.0.0/12, or 192.168.0.0/16, you need to manually add routes for other VPCs in each VPC's route table.
For example, if the CIDR block of VPC1 is 11.0.X.X/8 and that of VPC2 is 22.0.X.X/8, you must add the following custom route entries in the route tables of VPC1 and VPC2:
Route table | Destination CIDR block | Next hop | Route type |
VPC1 | 22.0.X.X/8 | attach1 | Custom |
VPC2 | 11.0.X.X/8 | attach2 | Custom |
Related steps
Connect VPCs in more than two regions: If you need to create connections for VPCs in more than two regions, follow the steps in this topic. Create a transit router in each region, establish a connection between each pair of regions, and attach the VPCs to the transit router in the corresponding region. Make sure the CIDR blocks of VPCs do not overlap.
Quality of Service (QoS) bandwidth control: To manage inter-region traffic, you can classify and mark business traffic, and allocate bandwidth accordingly to enhance network quality and usage. For more information, see Use traffic scheduling to limit bandwidth for inter-region connections.
Traffic analysis: Transit routers capture traffic information of inter-region connections and generate flow logs. You can analyze inter-region traffic transmission by querying flow logs. For more information, see Configure a flow log.
Topology visualization: CEN generates a topology diagram based on your actual resources. To view the topology, go to the details page of the CEN instance and view it under the Network Topology tab.
FAQs
How is inter-region connection charged?
You can choose either the pay-by-data-transfer or subscription modes. In the subscription mode, you purchase bandwidth plans and allocate bandwidth to connections. For more information, see Billing rules.
What is the maximum bandwidth for an inter-region connection?
If you choose Pay-By-Data-Transfer as the bandwidth allocation mode, the maximum bandwidth is limited by quota constraints. For more information, see CEN quotas.
If you choose Allocate from Bandwidth Plan, the maximum bandwidth is the value specified in your bandwidth plan. For more details, see Work with a bandwidth plan.