Establishing VPC Peering Between VPCs - Route Configuration | AWS Certified Advanced Networking - Specialty Exam

Route Configuration for VPC Peering Connection

Prev Question Next Question

Question

You have 2 VPCs VPCA(172.16.0.0/16) and VPCB(10.0.0.0/16)

You are planning to establish VPC connecting peering.

Which of the following routes must be added to the route table for both VPCs to ensure communication across VPCs? 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.

Options A and D are incorrect because the route entry is invalid.

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 establish VPC peering between VPCA and VPCB, the route tables for both VPCs need to be updated to enable routing traffic across the peering connection.

When a VPC peering connection is established between two VPCs, the IP ranges of the VPCs become routable between them. This means that instances in one VPC can communicate with instances in the other VPC using private IP addresses.

To enable communication across the VPC peering connection between VPCA and VPCB, two routes must be added to the route table for each VPC.

The routes that must be added to the route table for VPCA are:

  • A route of 10.0.0.0/16 with a target of pcx-1122 (the ID of the VPC peering connection)
  • A route of 172.16.0.0/16 with a target of pcx-1122

The routes that must be added to the route table for VPCB are:

  • A route of 172.16.0.0/16 with a target of pcx-1122
  • A route of 10.0.0.0/16 with a target of pcx-1122

These routes ensure that traffic can flow between the VPCs across the VPC peering connection.

The reason why both VPCs need to have the same two routes added to their respective route tables is because each VPC has its own route table, and the route table controls the routing of traffic within the VPC. When a VPC peering connection is established, the IP addresses of the peered VPC become routable across the connection, but the routing of traffic within each VPC is still controlled by its own route table. Therefore, to enable traffic to flow across the peering connection, each VPC's route table needs to be updated with the appropriate routes.