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?

  1. AWS will route all traffic by using VIF 1.
  2. AWS will route all traffic by using VIF 2. Source Reference Answer
  3. AWS will use both VIFs for routing by using a round-robin policy.
  4. AWS will use flow control to balance the traffic between the two VIFs.

Community Votes

B
100%

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)

Akshay0403 👍 5 Selected: B
AWS 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.
AzureDP900 👍 1 Selected: B
B 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 👍 1
B 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
strike3test 👍 3 Selected: B
B. 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:
AXH 👍 2
B, most specific prefix wins!

Comments & Corrections

No comments yet — spotted an error or have a note? Share it below.

Log in to comment, report an error, or add a note about this question.

Submitted for moderation before publishing. Keep it helpful and respectful.

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 →

← Back to ANS-C01 Study Guide