Question 624 of 1,170
Implement and Manage Virtual NetworkingmediumMultiple ChoiceObjective-mapped

Quick Answer

The answer is that the peering route is selected because Azure applies the longest prefix match rule, and the peering route for 10.2.0.0/16 is more specific than the user-defined route for 0.0.0.0/0. When a VM sends traffic to 10.2.2.7, Azure evaluates all available routes—including user-defined routes, system routes, and peering routes—and chooses the route with the most specific prefix, meaning the one with the highest number of matching bits. In this case, the /16 peering route is a far more precise match than the catch-all /0 default route, so traffic is directed through VNet peering rather than the virtual appliance. On the AZ-104 exam, this scenario tests your understanding of route selection priority and the common trap that a user-defined default route does not override a more specific peering route. Remember the key rule: specificity always wins, regardless of route source. A helpful memory tip is “more bits, more rights”—the route with the longer prefix (more bits) always takes precedence.

AZ-104 Implement and Manage Virtual Networking Practice Question

This AZ-104 practice question tests your understanding of implement and manage virtual networking. Match the stated requirement to the specific cloud service, access model, or configuration option — many options are valid in isolation but not for this scenario. A key principle to apply: azure routing prioritizes the longest-prefix match for destination IP addresses.. Once you have made your selection, read the full explanation to reinforce the concept and understand why each distractor is designed to mislead on exam day.

A route table on a subnet contains this user-defined route: - 0.0.0.0/0 -> Virtual appliance 10.0.0.4 The subnet is peered to another VNet with address space 10.2.0.0/16. A VM in the subnet sends traffic to 10.2.2.7, and Network Watcher shows the next hop as Virtual network peering instead of the appliance. What explains this result?

Question 1mediummultiple choice
Review the full subnetting walkthrough →

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 peering route is more specific than the default route, so it is selected first.

Azure uses the longest prefix match to determine the next hop for traffic. The user-defined route (UDR) for 0.0.0.0/0 is a default route, while the peering route for 10.2.0.0/16 is more specific. Since 10.2.2.7 falls within the 10.2.0.0/16 range, the peering route is preferred over the default route, directing traffic through the VNet peering instead of the virtual appliance.

Key principle: Azure routing prioritizes the longest-prefix match for destination IP addresses.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • User-defined routes never apply to peered networks.

    Why it's wrong here

    User-defined routes do apply to traffic in a subnet, but they can lose to a more specific route for the destination prefix.

  • The peering route is more specific than the default route, so it is selected first.

    Why this is correct

    Azure uses the longest-prefix match first. The destination 10.2.2.7 falls within the peered VNet prefix 10.2.0.0/16, which is more specific than 0.0.0.0/0. A default route to a virtual appliance does not override a more specific route. To force traffic to the appliance, you need a matching UDR for the peered address range, not only a catch-all default route.

    Related concept

    Azure routing prioritizes the longest-prefix match for destination IP addresses.

  • NSG rules always override any route table entry.

    Why it's wrong here

    NSGs filter traffic after routing decisions and do not determine the next hop. They cannot replace route selection behavior.

  • Peering only works when both VNets are in the same region.

    Why it's wrong here

    VNet peering can be global, so the region does not explain the route selection result shown by Network Watcher.

Common exam traps

Common exam trap: answer the scenario, not the keyword

The trap here is that candidates assume a default route (0.0.0.0/0) always forces all internet-bound or cross-VNet traffic through a virtual appliance, forgetting that more specific routes—such as those from VNet peering—override the default route based on prefix length.

Trap categories for this question

  • Command / output trap

    VNet peering can be global, so the region does not explain the route selection result shown by Network Watcher.

Detailed technical explanation

How to think about this question

Azure routing uses the system route for VNet peering, which is automatically added with an address prefix matching the peered VNet's address space. When a UDR for 0.0.0.0/0 exists, it only applies to traffic that does not have a more specific route; the peering route for 10.2.0.0/16 is more specific (longer prefix length of /16 vs /0), so it takes precedence. This behavior follows the principle of longest prefix match, which is fundamental to IP routing and is enforced by the Azure fabric controller.

KKey Concepts to Remember

  • Azure routing prioritizes the longest-prefix match for destination IP addresses.
  • System routes for peered VNets are automatically created and are more specific than 0.0.0.0/0.
  • A 0.0.0.0/0 UDR acts as a default route for unmatched traffic.
  • To override a system route for a peered VNet, a UDR with equal or greater specificity is required.

TExam Day Tips

  • Watch for words such as best, first, most likely and least administrative effort.
  • Review why wrong options are wrong, not only why the correct option is correct.

Key takeaway

Azure routing prioritizes the longest-prefix match for destination IP addresses.

Real-world example

How this comes up in practice

An e-commerce site experiences heavy traffic on Black Friday and near-zero traffic during off-peak weeks. Rather than provisioning permanent large VMs, the team uses auto-scaling groups that add capacity automatically under load and reduce it overnight. Questions like this test whether you understand elasticity, availability zones, and cloud compute scaling patterns.

What to study next

Got this wrong? Here's your next step.

Review azure routing prioritizes the longest-prefix match for destination IP addresses., then practise related AZ-104 questions on the same topic to reinforce the concept.

Related practice questions

Related AZ-104 practice-question pages

Use these pages to review the topic behind this question. This is how one missed question becomes focused revision.

Practice this exam

Start a free AZ-104 practice session

Short sessions build daily habit. Longer sessions build exam-day stamina. Try a timed session to simulate real conditions.

FAQ

Questions learners often ask

What does this AZ-104 question test?

Implement and Manage Virtual Networking — This question tests Implement and Manage Virtual Networking — Azure routing prioritizes the longest-prefix match for destination IP addresses..

What is the correct answer to this question?

The correct answer is: The peering route is more specific than the default route, so it is selected first. — Azure uses the longest prefix match to determine the next hop for traffic. The user-defined route (UDR) for 0.0.0.0/0 is a default route, while the peering route for 10.2.0.0/16 is more specific. Since 10.2.2.7 falls within the 10.2.0.0/16 range, the peering route is preferred over the default route, directing traffic through the VNet peering instead of the virtual appliance.

What should I do if I get this AZ-104 question wrong?

Review azure routing prioritizes the longest-prefix match for destination IP addresses., then practise related AZ-104 questions on the same topic to reinforce the concept.

What is the key concept behind this question?

Azure routing prioritizes the longest-prefix match for destination IP addresses.

About these practice questions

Courseiva creates original exam-style practice questions with explanations and wrong-answer analysis. It does not publish real exam questions, exam dumps, or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

Same concept, more angles

2 more ways this is tested on AZ-104

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 route table contains these entries: 10.0.0.0/8 with next hop Virtual appliance, and 10.1.1.0/24 with next hop Virtual network gateway. Which next hop will Azure use for traffic to 10.1.1.5?

medium
  • A.Virtual appliance, because the broader 10.0.0.0/8 route was created first.
  • B.Virtual network gateway, because the /24 route is more specific than the /8 route.
  • C.Internet, because Azure always prefers the default system route for public addresses.
  • D.None, because Azure ignores overlapping route entries in the same table.

Why B: Azure uses the most specific route prefix (longest prefix match) to determine the next hop for traffic. For destination 10.1.1.5, the route 10.1.1.0/24 (prefix length 24) is more specific than 10.0.0.0/8 (prefix length 8), so the next hop Virtual network gateway is selected, regardless of the order in which routes were created.

Variation 2. A subnet has a user-defined route for 0.0.0.0/0 that sends traffic to a network virtual appliance at 10.1.0.4. The same virtual network is peered to a hub VNet that has a system route for 10.50.16.0/20. A VM in the subnet sends traffic to 10.50.18.25. Which next hop will Azure use?

hard
  • A.Internet, because the default route overrides more specific routes.
  • B.Network virtual appliance at 10.1.0.4, because user-defined routes always win over system routes.
  • C.Virtual network peering, because the /20 peering route is more specific than 0.0.0.0/0.
  • D.None, because Azure disables routing when a subnet has both peering and a UDR.

Why C: Azure uses the most specific route (longest prefix match) to determine next hop. The destination 10.50.18.25 falls within the 10.50.16.0/20 range of the peering route, which is more specific than the 0.0.0.0/0 UDR. Therefore, the traffic is routed via the virtual network peering, not the NVA.

Keep practising

More AZ-104 practice questions

Last reviewed: Jun 11, 2026

Question Discussion

Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.

Loading comments…

Sign in to join the discussion.

This AZ-104 practice question is part of Courseiva's free Microsoft 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 AZ-104 exam.