AWS Direct Connect: Which VIF Wins When Both Advertise 172.16.1.0/24?
Short answer
B AWS will route all traffic by using VIF 2.
Question
Key Takeaways
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.
Common mistake: 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.
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
- https://docs.aws.amazon.com/directconnect/latest/UserGuide/routing-policies.html
- https://docs.aws.amazon.com/directconnect/latest/UserGuide/working-with-virtual-interfaces.html
- https://docs.aws.amazon.com/directconnect/latest/UserGuide/bgp-communities.html
These links open the official vendor documentation in a new tab.
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.
Community Votes
100% of anonymous learners picked answer B. Votes are pick records left by other test-takers — they are not the verified answer.
Discussion 5 contributions
Compiled from public community threads and reader submissions, lightly edited for clarity. Handles and vote tallies are shown as recorded, and comments reflect the views of individual contributors.
From public community threads 5
-
Akshay0403 👍 5 Answered BAWS will route traffic to the data center for addresses within the 172.16.1.0/24 network range using VIF 2 because it provides a more specific route, despite having a longer AS_PATH. Therefore, the correct answer is: B. AWS will route all traffic by using VIF 2.
-
strike3test 👍 3 Answered BB. AWS will route all traffic by using VIF 2. In AWS Direct Connect, traffic is routed based on the most specific route. In this scenario, there are two VIFs advertising routes for different portions of the 172.16.0.0/16 network: VIF 1 advertises the 172.16.0.0/16 network. VIF 2 advertises the more specific subnet 172.16.1.0/24 within the 172.16.0.0/16 network. Since VIF 2 advertises a more specific route (172.16.1.0/24), AWS will prefer this route for traffic destined for the 172.16.1.0/24 network. Therefore, the correct answer is:
-
AzureDP900 👍 1 Answered BB is right, here is why AS_PATH Attribute : The AS_PATH attribute of a private IP address indicates the path that packets must take from the internet source to their destination. In this case, both VIFs have an AS_PATH value of 65000. Priority : Since both VIFs have the same AS_PATH value, AWS will use the AS_PATH value of VIF 2 (65000 65000 65000) as a priority for routing traffic to destinations in the 172.16.1.0/24 network range. First Match Wins : When there are multiple paths available from the same source, AWS uses the first match rule that is more specific and has fewer AS_PATH attribute values. In this case, VIF 2 is a subset of VIF 1, so it will be used for routing traffic to destinations in the 172.16.1.0/24 network range.
-
AzureDP900 👍 1B is right The AS_PATH attribute value in VIF 1 only includes one value (65000), indicating that the route for 172.16.0.0/16 is directly connected to the data center and not learned from another BGP peer. In contrast, the AS_PATH attribute value in VIF 2 includes three values (65000, 65000, 65000), indicating that the route for 172.16.1.0/24 is learned from another BGP peer with an additional ASN of 65000. Because the route for 172.16.1.0/24 includes an additional ASN, it will be preferred over the route for 172.16.0.0/16 when routing traffic within the data center. Therefore, AWS will route all traffic destined for the 172.16.1.0/24 network range by using VIF 2
-
AXH 👍 2B, most specific prefix wins!
Reader comments & corrections
No reader corrections yet — spotted an error or have a note? Share it below.
Related Analysis
Practice All ANS-C01 Questions
Access 137 questions with complete answers and detailed explanations.
View Full ANS-C01 Practice Test →