Using a Connection to Access Multiple VPCs¶
Scenarios¶
You can access multiple VPCs using one connection. If you have requested a connection between your on-premises data center (172.16.0.1/24) and VPC A (192.168.0.1/24) and want to access VPC B (192.168.0.1/24), you can create a VPC peering connection to connect the two VPCs, so that your data center can access VPC B. For details, see Figure 1.
Note
Before creating a VPC peering connection, if your connection is requested through email or call, you need to notify the customer manager of the network segments that are to be connected to VPC B. If your connection is created in self-service mode, you need to add the network segments that are to be connected to VPC B to the CIDR Block parameter of the virtual gateway.
Procedure¶
Create the peering connection peering-001 between VPC A and VPC B. If VPC A and VPC B belong to the same tenant, see Creating a VPC Peering Connection in Creating a VPC Peering Connection with Another VPC in Your Account. If VPC A and VPC B belong to different tenants, see Creating a VPC Peering Connection in Creating a VPC Peering Connection with a VPC in Another Account.
Add routes for the VPC peering connection. If VPC A and VPC B belong to the same tenant, see Adding Routes for the VPC Peering Connection in Creating a VPC Peering Connection with Another VPC in Your Account. If VPC A and VPC B belong to different tenants, see Adding Routes for the VPC Peering Connection in Creating a VPC Peering Connection with a VPC in Another Account.
Add a route that points to the remote subnet of the on-premises data center for the VPC peering connection.
When VPC A and VPC B belong to the same tenant and VPC A is the peer VPC in peering-001, you need to add a local route for the peering connection.
On the VPC Peering page, click peering-001 to view the peering connection settings.
On the displayed page, click the Local Routes tab.
Click Add Local Route. Set Destination to the remote subnet of the connection, that is, 172.16.0.1/24. The next hop address is the default value.
Click OK.
When VPC A and VPC B belong to the same tenant, and VPC A is the local VPC in peering-001, you need to add a peer route for the peer connection.
On the VPC Peering page, click peering-001 to view the peering connection settings.
On the displayed page, click the Peer Routes tab.
Click Add Peer Route. Set Destination to the remote subnet of the connection, that is, 172.16.0.1/24. The next hop address is the default value.
Click OK.
When VPC A and VPC B belong to different tenants, the tenant that has VPC B needs to perform the following operations:
On the VPC Peering page, click peering-001 to view the peering connection settings.
Click Add Local Route under the Local Routes tab. Set Destination to the remote subnet of the connection, that is, 172.16.0.1/24. The next hop address is the default value.
Click OK.