An administrator configures a route table named `RT-Prod` and associates it with `Subnet-1` () in `VNet-1` (). `VNet-1` is peered with `VNet-2` ().
The route table `RT-Prod` contains the following two user-defined routes:
* Route1: Destination prefix , Next hop type: Virtual appliance, Next hop IP address:
* Route2: Destination prefix , Next hop type: Virtual Network Gateway
A virtual machine in `Subnet-1` sends a packet to a destination IP address of in `VNet-2`.
Which next hop will the traffic use to reach the destination?
- The virtual network gatewayCevap
- BThe virtual appliance at 10.1.1.4
- CThe virtual network peering connection
- DThe virtual network local routing
Cevap
The traffic will use the virtual network gateway.
The correct answer is the virtual network gateway because Azure's routing engine uses the Longest Prefix Match (LPM) algorithm. The destination IP address matches Route2 () with a 24-bit match, which is more specific than the 16-bit match of Route1 () and the VNet Peering system route (). Therefore, Route2 is selected, and its next hop is the virtual network gateway.
Adım Adım Çözüm
Anahtar Kavram
Azure routes traffic based on the Longest Prefix Match (LPM) algorithm across all system and user-defined routes. Only when prefixes are identical does the route source priority (UDR > BGP > System) resolve the conflict.