1

My subnet is attached to a route table with following two routes:

10.25.0.0/16, pcx-abc
10.25.0.0/16, pcx-bcd

Both of the them are vpc peerings with VPCs in two other accounts. In this case, since the CIDR block ranges are the same, when sending a packet to let's say 10.25.25.25, which route will be used?

If there is no way to properly control the traffic with the above setup (single subnet route to two CIDR blocks with same range), what is the recommended way to do it? Use two subnets and have each one of them route to a VPC peering?

Z.SP
  • 319
  • 1
  • 2
  • 12

1 Answers1

0

So first, if you have design control over the 2 “other” VPCs then use best practice of non-overlapping CIDR ranges. If you are stuck with these, you have 2 options:

  1. associate separate route tables on each subnet with route entries pointing to the specific pcx you want. This applies if the traffic should be routed based purely on the source subnet
  2. use a single route table with two routes that are specific to the destination. For example send 10.10.0.0/16 to pcx-abc but have a second more specific prefix like 10.10.10.0/24 to the other pcx. This works if u know there is a specific CIDR range and can carve out these ranges in advance and manage them going forward