Launch price: every exam for $29.99 a year, for the first 300 buyers. See the price

CertStreak
Menu

Implement and manage network security for connections to Azure Virtual Desktop, including user defined routes (UDRs), network security groups (NSGs), and Azure Firewall

A worked example

Complete the statement

Azure Virtual Desktop session hosts are in subnet snet-01 (10.20.1.0/24) of spoke virtual network vnet-spoke (10.20.0.0/16). vnet-spoke is peered to a hub virtual network (10.0.0.0/16) and uses the hub's VPN gateway. Over BGP, the on-premises network advertises only one prefix: 172.20.0.0/16. Azure Firewall in the hub has the private IP address 10.0.1.4.

Route table rt-01 is associated with snet-01. It has one user-defined route, 0.0.0.0/0 with next hop type Virtual appliance (10.0.1.4), and gateway route propagation is enabled. Routing on GatewaySubnet already sends return traffic for the spoke through the firewall.

Requirements:

  • Traffic from the session hosts to any address in 172.20.0.0/16 must pass through Azure Firewall.
  • Gateway route propagation on rt-01 must remain enabled.
  • You can add only one route to rt-01.

The exhibit shows the effective routes of a session host network interface.

SourceStateAddress prefixesNext hop typeNext hop IP address
DefaultActive10.20.0.0/16Virtual network–
DefaultActive10.0.0.0/16VNet peering–
Virtual network gatewayActive172.20.0.0/16Virtual network gateway10.0.255.4, 10.0.255.5
DefaultInvalid0.0.0.0/0Internet–
UserActive0.0.0.0/0Virtual appliance10.0.1.4

Complete the statement about the current routing and the route you must add.

Currently, traffic from a session host to the on-premises file server at 172.20.4.15 is sent to . To meet the requirements, add a user-defined route to rt-01 with the address prefix and next hop type Virtual appliance (10.0.1.4).

  • Blank 1: the virtual network gateway (correct answer)

    172.20.4.15 matches both the BGP route 172.20.0.0/16 and the user-defined route 0.0.0.0/0. Longest prefix match picks the /16 route, so the traffic goes to the virtual network gateway and skips the firewall. Azure Firewall: the 0.0.0.0/0 route has a shorter prefix, so it loses. Internet: the system 0.0.0.0/0 route is overridden (Invalid) and is also a shorter prefix. Dropped: no active route with next hop None covers this address.

  • Blank 2: 172.20.0.0/16 (correct answer)

    A user-defined route with the same prefix as the BGP route covers the whole on-premises range, and for identical prefixes Azure ranks a user-defined route above a BGP route. 172.20.4.0/24: this would win for the file server, but other on-premises addresses would still follow the BGP /16 route to the gateway. 172.16.0.0/12 and 172.0.0.0/8: these prefixes are shorter than the BGP /16, so longest prefix match still sends on-premises traffic to the gateway.

Why

Azure first chooses the route with the longest matching prefix, so the BGP route for 172.20.0.0/16 beats the 0.0.0.0/0 user-defined route, and on-premises traffic goes straight to the gateway. Route propagation must stay on, so the BGP route stays in the table. To override the BGP route for the entire advertised range with one route, use the same prefix. For identical prefixes, a user-defined route takes priority over a BGP route. A user-defined route for 172.20.0.0/16 that points to the firewall therefore covers every on-premises address.

Practise this topic until it's automatic.

Ten questions a day, every answer explained, and misses that come back until you beat them.

Start free