1.2.1. How Packets Find Their Way
Imagine you're giving directions to a delivery driver. "Go to New York" is less specific than "Go to 123 Main St, Manhattan." Routing works the same way—more specific routes take precedence.
Route Priority in Azure:
- Most specific prefix wins (longest match)
- For equal prefixes, route type matters:
- User-defined routes (UDRs) > BGP routes > System routes
Consider this example:
| Route | Prefix | Next Hop |
|---|---|---|
| System route | 10.0.0.0/16 | VNet |
| UDR | 10.0.1.0/24 | Virtual Appliance |
| BGP route | 10.0.0.0/16 | VPN Gateway |
Traffic to 10.0.1.50 goes to the Virtual Appliance — and note why: the UDR's /24 is a longer prefix match than either /16, so it wins on specificity alone and route type never enters into it. Traffic to 10.0.2.50 matches only the two /16 routes, and there the tie is settled by type: BGP outranks the system route, so it goes to the VPN Gateway. Type precedence decides nothing until the prefixes are equal.