AWS Direct Connect: Which VIF Wins When Both Advertise 172.16.1.0/24?
A company has a data center in the us-west-1 Region with a 10 Gbps AWS Direct Connect dedicated connection to a Direct Connect gateway. There are two private VIFs from the same data center location in us-west-1 that are attached to the same Direct Connect gateway. VIF 1 advertises 172.16.0.0/16 with an AS_PATH attribute value of 65000. VIF 2 advertises 172.16.1.0/24 with an AS PATH attribute value of 65000 65000 65000. How will AWS route traffic to the data center for traffic that has a destination address within the 172.16.1.0/24 network range?
Community Votes
100% of anonymous learners picked answer B. Votes are pick records left by other test-takers — they are not the verified answer.
Community Insight
The exam tests whether you know longest prefix match is evaluated before AS_PATH; the trap is focusing on the shorter AS_PATH of VIF 1.
In AWS Direct Connect, BGP uses the longest prefix match to choose the more specific route, so VIF 2's /24 beats VIF 1's /16 even with a longer AS_PATH. Community consensus is answer B: AWS routes traffic using VIF 2.
Choosing VIF 1 because its AS_PATH is only 65000, forgetting that BGP selects the most specific prefix (172.16.1.0/24) before comparing path length.
Community Discussion (5 comments)
Comments & Corrections
No comments yet — spotted an error or have a note? Share it below.
Expert Analysis
Why the Answer Is Correct
AWS Direct Connect and BGP route selection follow the longest prefix match rule first. VIF 1 advertises 172.16.0.0/16, while VIF 2 advertises 172.16.1.0/24, which is a subset of that /16. For destination addresses inside 172.16.1.0/24, the /24 is more specific than the /16, so AWS installs and forwards using VIF 2. The AS_PATH length difference is irrelevant at this stage because BGP compares prefix length before AS_PATH attributes (or local preference, etc.). Community comments [1] and [2] directly support this logic.Why the Other Options Are Wrong
Option A is the most common trap: VIF 1 has a shorter AS_PATH (65000) and a larger prefix, leading some to think BGP will choose it for all traffic. However, for 172.16.1.0/24 destinations, the more specific /24 route from VIF 2 is preferred, so AWS will not use VIF 1 for those destinations. Options C and D describe load-balancing or flow-control behaviors that do not apply to this BGP best-path selection scenario. AWS Direct Connect does not round-robin between VIFs merely because the same gateway is used; BGP selects exactly one best route per prefix. Comment [5] summarizes the community consensus: 'most specific prefix wins!'.Community Comment Notes
Comments [1] and [2] correctly explain the longest-prefix-match logic and directly support answer B. Comment [3] contains confusion about AS_PATH priority, but still votes B because it sees the more specific route; its reasoning should be ignored if it suggests AS_PATH length controls this decision. Comment [4] incorrectly interprets the AS_PATH as an origin attribute, but the decisive factor remains prefix length. Comment [5] states the core takeaway clearly: 'B, most specific prefix wins!'.Official Reference
Exam Strategy
For Direct Connect/BGP questions, always check prefix length before any other BGP attribute. If one advertised prefix is a subnet of another, the more specific /24 wins even if the other uses AS_PATH prepending. In the exam, use the 'longest prefix match' rule first; only compare AS_PATH when prefixes are identical.
Related Analysis
Practice All ANS-C01 Questions
Access 137 questions with complete answers and detailed explanations.
View Full ANS-C01 Practice Test →