AWS VPC Peering Connection - Route Configuration

How to Configure Routes for VPC Peering

Prev Question Next Question

Question

You have 2 VPC's VPCA(172.16.0.0/16) and VPCB(10.0.0.0/16)

You are planning on establishing VPC connecting peering.

Which of the following routes need to be added to the route table for both VPC's to ensure communication across VPC's.

Choose 2 answers from the options given below.

Assume that the Target for the VPC Peering connection has an ID of pcx-1122

Answers

Explanations

Click on the arrows to vote for the correct answer

A. B. C. D.

Answer - B and C.

An example is given on the AWS documentation on this as per the snapshots below.

And this also gives the Route table configurations.

For more information on this example , one can visit the below URL:

http://docs.aws.amazon.com/AmazonVPC/latest/PeeringGuide/peering-configurations-full-access.html
Two VPCs Peered Together

You have a VPC peering connection (pcx-11112222) between VPC A and VPC B, which are in the same
AWS account, and do not have overlapping CIDR blocks.

& <= &

172160016 ro00016

To enable communication between two VPCs, you need to establish a VPC peering connection between them. After creating the VPC peering connection, you need to update the route tables of each VPC to route traffic to the other VPC.

In this scenario, you have two VPCs, VPCA and VPCB, with CIDR blocks 172.16.0.0/16 and 10.0.0.0/16, respectively. To enable communication between these two VPCs, you need to add two routes to each VPC's route table.

The first route you need to add is the CIDR block of the other VPC. In this case, VPCA needs a route to 10.0.0.0/16 and VPCB needs a route to 172.16.0.0/16.

The second route you need to add is the VPC peering connection target. The VPC peering connection target is a unique identifier for the VPC peering connection that you created between the two VPCs. In this case, the VPC peering connection target has an ID of pcx-1122.

Therefore, the correct answers are:

A. In the Route table for VPCA add a route of 10.0.0.0/16 and Target as pcx-1122 D. In the Route table for VPCB add a route of 172.16.0.0/16 and Target as pcx-1122

By adding these routes to the route tables of each VPC, traffic can be routed between the VPCs using the VPC peering connection.