How Transit Gateway Handles Overlapping CIDR Blocks
A company uses AWS Transit Gateway to connect multiple VPCs and an on-premises network via VPN. The on-premises network advertises a route for 10.0.0.0/8. One VPC has a CIDR of 10.0.1.0/24. How does Transit Gateway handle the overlapping route?
Quick Answer
The correct answer is that Transit Gateway uses the longest prefix match, so the more specific 10.0.1.0/24 route from the VPC takes precedence over the on-premises 10.0.0.0/8 advertisement. This happens because Transit Gateway evaluates route tables based on prefix length, not attachment type or administrative distance, meaning the narrower CIDR always wins regardless of whether the source is a VPC or a VPN. On the AWS Certified Advanced Networking Specialty ANS-C01 exam, this concept tests your understanding of how Transit Gateway resolves overlapping CIDR blocks in hybrid networks, a common scenario where an on-premises network advertises a supernet that conflicts with a VPC subnet. A frequent trap is assuming that VPN routes are preferred or that Transit Gateway summarises routes, but the key is remembering that longest prefix match is the sole tiebreaker. Memory tip: think of it like a zip code—a more specific five-digit code (10.0.1.0/24) always overrides a broader three-digit code (10.0.0.0/8).
⚠ Common exam trap
Test-takers frequently assume BGP-learned routes are always preferred over directly attached VPC routes, but Transit Gateway strictly uses longest prefix match, not route source priority.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
The Transit Gateway uses the longest prefix match; the VPC route 10.0.1.0/24 is more specific.
AWS Transit Gateway uses the longest prefix match (LPM) rule to select the most specific route when multiple routes overlap. In this case, the on-premises network advertises 10.0.0.0/8 via BGP, while the VPC has a directly attached CIDR of 10.0.1.0/24. Since /24 is more specific than /8, traffic destined for 10.0.1.0/24 is routed to the VPC, not the on-premises network.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
The Transit Gateway uses the longest prefix match; the VPC route 10.0.1.0/24 is more specific.
Why this is correct
Longest prefix match determines forwarding.
- ✗
The Transit Gateway prefers the on-premises route because it is learned via BGP.
Why it's wrong here
No preference based on source; longest prefix wins.
- ✗
The Transit Gateway drops traffic to 10.0.1.0/24 due to conflict.
Why it's wrong here
No blackhole, it forwards to the more specific.
- ✗
The Transit Gateway summarises the on-premises route to 10.0.0.0/16.
Why it's wrong here
No summarisation.
Visual reference
Go deeper
Related to this question
About these practice questions
This ANS-C01 question is part of Courseiva's 1,621-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →
Same concept, more angles
1 more way this is tested on ANS-C01
These questions test the same concept from different angles. Work through them to make sure you can recognise it however the exam phrases it.
Variation 1. A company is using AWS Transit Gateway to connect multiple VPCs and on-premises networks. They have a VPC with a CIDR of 10.0.0.0/16 attached to the transit gateway. They also have a Direct Connect virtual interface attached to the transit gateway. The on-premises network can reach some VPCs but not the VPC with CIDR 10.0.0.0/16. The transit gateway route table has a static route for the on-premises CIDR and a route propagation from the VPC attachment. What is the most likely issue?
hard- A.The transit gateway has reached the maximum number of attachments
- ✓ B.The VPC CIDR overlaps with the on-premises CIDR
- C.The transit gateway route table does not have a route to the on-premises network
- D.The VPC attachment is not associated with the transit gateway route table
Why B: The most likely issue is that the VPC CIDR (10.0.0.0/16) overlaps with the on-premises CIDR. When CIDR blocks overlap, the transit gateway cannot distinguish between destinations in the VPC and on-premises, leading to routing conflicts. This explains why the on-premises network can reach other VPCs with non-overlapping CIDRs but not this VPC. The static route for the on-premises CIDR and the propagated route from the VPC attachment both exist in the transit gateway route table, but the overlap causes the transit gateway to forward traffic inconsistently or drop it. Options A, C, and D are incorrect: A) The transit gateway has no such attachment limit; C) The route table does have a route to the on-premises network via the static route; D) The VPC attachment is associated and propagating routes.
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This ANS-C01 practice question is part of Courseiva's free Amazon Web Services certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the ANS-C01 exam.