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.

**Figure 1** Accessing multiple VPCs over one connection

Figure 1 Accessing multiple VPCs over one connection

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

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

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

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

    **Figure 2** VPC A being the peer VPC

    Figure 2 VPC A being the peer VPC

    1. On the VPC Peering page, click peering-001 to view the peering connection settings.

    2. On the displayed page, click the Local Routes tab.

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

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

    **Figure 3** VPC A being the local VPC in the peering connection

    Figure 3 VPC A being the local VPC in the peering connection

    1. On the VPC Peering page, click peering-001 to view the peering connection settings.

    2. On the displayed page, click the Peer Routes tab.

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

    4. Click OK.

    When VPC A and VPC B belong to different tenants, the tenant that has VPC B needs to perform the following operations:

    1. On the VPC Peering page, click peering-001 to view the peering connection settings.

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

    3. Click OK.