Question

Difficulty: EasyVirtual Network Connectivity and Routing

You are designing the routing for a subnet in an Azure virtual network named `vnet-prod-spoke` (10.20.0.0/1610.20.0.0/16). You need to route all outbound internet traffic from the subnet to a firewall virtual appliance located in a peered virtual network. Traffic within `vnet-prod-spoke` (10.20.0.0/1610.20.0.0/16) must continue to route directly between subnets without passing through the firewall. Which route should you add to the User-Defined Route (UDR) table associated with the subnet?

  1. A
    A route for 10.20.0.0/1610.20.0.0/16 with the next hop type set to None, and a route for 0.0.0.0/00.0.0.0/0 pointing to the firewall's private IP address.
  2. B
    A Network Security Group (NSG) outbound security rule that redirects traffic destined for the Internet service tag to the firewall's private IP address.
  3. A route for 0.0.0.0/00.0.0.0/0 with the next hop type set to Virtual appliance and the next hop IP address set to the firewall's private IP address.Answer
  4. D
    A route for 10.20.0.0/1610.20.0.0/16 and a route for 0.0.0.0/00.0.0.0/0, both with the next hop type set to Virtual appliance and the next hop IP address set to the firewall's private IP address.

Answer

A route for 0.0.0.0/00.0.0.0/0 with the next hop type set to Virtual appliance and the next hop IP address set to the firewall's private IP address.
The correct option is to define a route for 0.0.0.0/00.0.0.0/0 with the next hop set to the virtual appliance's private IP. Azure routes traffic by evaluating all available routes and selecting the one with the longest prefix match. The system-defined route for the local VNet prefix (10.20.0.0/1610.20.0.0/16) is more specific than the user-defined route for 0.0.0.0/00.0.0.0/0. Therefore, any traffic destined within `vnet-prod-spoke` will match the system route and route directly, while all other traffic destined for the internet will fall back to the 0.0.0.0/00.0.0.0/0 UDR and be forwarded to the firewall.

Step-by-Step Solution

1
Identify the target IP range for internet-bound traffic.
The target prefix is 0.0.0.0/00.0.0.0/0.
This prefix represents all traffic destined outside the virtual network.
2
Configure the next hop type and IP address for the internet route in the route table.
Set next hop type to Virtual appliance and provide the firewall's private IP address.
This routes all traffic matching the 0.0.0.0/00.0.0.0/0 route through the firewall appliance.
3
Analyze how Azure's longest prefix match (LPM) handles local virtual network traffic (10.20.0.0/1610.20.0.0/16).
Since 10.20.0.0/1610.20.0.0/16 is a longer prefix than 0.0.0.0/00.0.0.0/0, the default system route for the local virtual network takes precedence.
By omitting an explicit UDR for 10.20.0.0/1610.20.0.0/16, internal traffic automatically bypasses the firewall and routes directly.

Key Concept

Azure routing precedence and longest prefix match (LPM)
Rate this question