Virtual Private Cloud (VPC) Peering
Connect two VPCs for communication using private IP addresses
Last updated
Connect two VPCs for communication using private IP addresses
Last updated
© DuploCloud, Inc. All rights reserved. DuploCloud trademarks used herein are registered trademarks of DuploCloud and affiliates
VPC peering is a networking connection between two VPCs enabling traffic to be routed between them. When you use VPC peering, instances in the VPCs communicate with each other as if they are in the same network. The VPCs can be in different regions (also known as Inter-Region VPC peering connections).
VPC peering facilitates the transfer of data. For example, if you have more than one AWS account, you can peer the VPCs across those accounts and create a file-sharing network.
This procedure describes how to peer two VPCs, using subnet routes, and how to manage the peering connections and routes. For detailed steps on setting up VPC peering in Duplo, refer to the Duplo documentation.
Enable VPCs for peering:
We will be referring following steps to peer 2 VPCs VPC-A and VPC-B.
In the DuploCloud Portal, navigate to Administrator -> Infrastructure. The Infrastructure page displays. In this example, the Infrastructures are named VPC-A and VPC-B.
From the Name column, select the first Infrastructure (VPC-A) for which to enable peering. VPC-A and its defined subnet routes are displayed.
Click the Peering tab and the VPC Peering page displays.\
From the Choose VPC list box, select a VPC that you want to peer with VPC-A. In this example, we select VPC-B.
Select the Is Peered checkbox.
Click Save. \
Click on Peer again.
Follow similar from the above-listed steps 2 to 6 for VPC-B Infrastructure.
Now that your two VPCs (VPC-A and VPC-B) are connected, define the subnet routes that the VPCs use for communication.
To begin, on the VPC Peering page for the first VPC that you set up (VPC-A), click Peer again. The Infrastructure page displays.
Select the Infrastructure (VPC-A) containing the first VPC that you enabled for peering.
Click the Peering tab and the VPC Peering page displays.
Select the Choose VPC list box. The second VPC (VPC-B) displays in the list box and the Is Peered checkbox is selected, indicating that you previously connected the first VPC (VPC-A) with the second VPC (VPC-B) for peering.
Select the subnet routes that you want to define for VPC peering communication between the two VPCs (VPC-A and VPC-B). In this example, we select the checkboxes for subnet routes vpc-B-a-private and vpc-B-a-public. \
Click Save.
Click Peer again and repeat the numbered procedure above to peer the VPC-B Infrastructure.
Confirm that your two VPCs are enabled for peering, are connected with each other, and have subnet routes defined for communication.
In the DuploCloud Portal, navigate to Administrator -> Infrastructure. The Infrastructure page displays.
Select one of the Infrastructures containing a VPC that you previously enabled for peering and for which you defined subnet routes. In this example, we select VPC-A.
Click the Peering tab and the VPC Peering page displays.
Select the Choose VPC list box to confirm that VPC-B is peered with VPC-A and uses the subnet routes you defined. The name of the second VPC (VPC-B) displays in the list box and the Is Peered checkbox is selected. The subnet routes that you selected are displayed as checked.\
Click Save.
To maintain accessibility, add Security Group rules for Tenant VPC zones:
In the DuploCloud Portal, navigate to Administrator -> Infrastructure.
Select the Infrastructure from the Name column.
Click the Security Group Rules tab. \
Click Add. The Add Tenant Security pane opens.\
Define the rule for your Port Range and click Add.
Delete subnet routes that you defined for VPC peer-to-peer communication:
In the DuploCloud Portal, navigate to Administrator -> Infrastructure. The Infrastructure page displays.
Select one of the Infrastructures containing a VPC that you previously enabled for peering and for which you defined subnet routes. Continuing the example above, in this case, we select VPC-A.
Click the Peering tab. The VPC Peering page displays for VPC-A.\
Select the Choose VPC list box. The peered VPC (VPC-B) displays and the Is Peered checkbox is selected along with the associated subnet routes defined for communication.
Clear the checkboxes of the subnet routes you want to remove in the Select Subnets column. Using the CTRL key, you can select multiple checkboxes and clear them with a single click. In this example, we remove the subnet route vpc-b-A-private by clearing its checkbox.\
Click Save. The subnet route vpc-b-A-private has been removed for VPC-A/VPC-B peering.
Optionally, confirm the deletion by verifying peering between associated PVCs.
Delete the peering connection between VPCs:
In the DuploCloud Portal, navigate to Administrator -> Infrastructure. The Infrastructure page displays.
Select one of the Infrastructures containing a VPC that you previously enabled for peering and for which you defined subnet routes. Continuing the example above, in this case, we select VPC-A.
Click the Peering tab. The VPC Peering page displays for VPC-A.\
Select the Choose VPC list box. The peered VPC (VPC-B) displays and the Is Peered checkbox is selected along with the associated subnet routes defined for communication.
Clear the Is Peered checkbox. \
Click Save. The Select Subnets list no longer displays and the peering connection between VPC-A and VPC-B has been removed.
Optionally, confirm the deletion by verifying peering between associated VPCs.