Peering and routing problems: effective routes
-
Phase 0: Before you start
-
Phase 1: The foundation
-
Phase 2: Day-to-day operations
-
Phase 3: Enterprise architecture
-
Phase 4: Troubleshooting step by step
-
Phase 5: Final project and career
Azure effective routes are the routes a network interface really ends up using: the system routes, anything learned from gateways and your own user-defined routes, all merged into one table. When traffic between VNets fails, the answer is usually sitting in that table.
Back in Phase 3 you built a hub with two spokes, peerings and route tables, and in Lesson 48 you deleted the firewall but left the spokes’ routes pointing at its address. That’s how a real network quietly ends up broken months after a change, and it’s what you’ll be troubleshooting here.
You’ll read effective routes the way an engineer does, track down a route pointing at nothing and fix it, and then run into the overlap error that blocks a new peering.
| Time | You need | Cost | By the end you can |
|---|---|---|---|
| About 50 minutes | rg-saat-hub with vnet-hub, vnet-spoke1, vnet-spoke2, the peerings and rt-spoke1 and rt-spoke2 from Phase 3, the CLI | Around 5 US cents: three small test VMs for less than an hour | Read effective routes, find traffic that’s being black-holed, and sort out overlapping address spaces before peering |
What it is, in one line
Effective routes are the merged routing table a NIC uses, and they’re the first thing to check when traffic between networks vanishes.
In Simple Words
Road signs that point to a demolished bridge
A town once had a bridge to the next village, and every road had a sign saying “To the village: take the bridge.” The bridge was pulled down last year but nobody removed the signs, so drivers follow them, reach the river and stop. There’s nothing wrong with the cars, the drivers or the village; the signs are wrong.
A user-defined route to a firewall that’s gone is that old sign. Effective routes show you every sign a VM follows, so you can spot the one that leads to the river.
Engineer's View
How effective routes are built
- Sources: Default (system routes: VnetLocal, VNetPeering, Internet, None), VirtualNetworkGateway (learned over BGP or from local network gateways) and User (the route tables on the subnet).
- Selection: the longest prefix wins, and when the prefix is the same, User beats VirtualNetworkGateway, which beats Default.
- Peering routes: the address space of each peered VNet shows up as VNetPeering, and peering isn’t transitive (Lesson 46).
- No validation: Azure will accept a VirtualAppliance route to any IP, even one where nothing exists, and traffic sent there is dropped without a word.
- Overlaps: you can’t peer two VNets whose address spaces overlap, and the request fails with VnetAddressSpacesOverlap.
- Where to read them: the Effective routes blade on the NIC, az network nic show-effective-route-table (the VM has to be running), or Network Watcher next hop for a single destination.
How it works, step by step
Here’s what happens to vm-s1’s ping to spoke 2 with the routes left over from Lesson 48:
- vm-s1 (10.41.1.4) sends to 10.42.1.4.
- Among its effective routes is a User route sending 10.42.0.0/16 to VirtualAppliance 10.40.1.4.
- Azure forwards the packet over the peering towards 10.40.1.4, which used to be Azure Firewall’s address.
- Nothing owns 10.40.1.4 now, so the packet is dropped with no error, no reset and no log entry.
- The ping times out, even though the NSGs, the peerings and the destination VM are all fine.
Black holes like this are hard to spot because each piece on its own looks healthy, and it’s only the combination that’s broken.
Before you run any command, double-check it
Read every command twice before you press Enter. Check the target: the system or account, the IDs, the names and the sizes. These commands are for learning and were tested in our lab, not on your system. At work, run the read-only list commands first, follow your change process, make sure a backup exists, and ask a second person to check anything that changes or deletes data. You run them at your own risk.
The habit that catches them: for every VirtualAppliance next hop in effective routes, prove that something lives at that IP.
A query that finds dead next hops for you
Checking one route by hand is fine in a lab, but in a real estate with dozens of route tables you’d let Resource Graph do the work. Save this as C:\azure-lab\dead-hops.kql:
resources
| where type =~ 'microsoft.network/routetables'
| mv-expand r = properties.routes
| where r.properties.nextHopType == 'VirtualAppliance'
| project routeTable = name, route = tostring(r.name), nextHop = tostring(r.properties.nextHopIpAddress)
| join kind=leftouter (
resources
| where type =~ 'microsoft.network/networkinterfaces'
| mv-expand ip = properties.ipConfigurations
| project nextHop = tostring(ip.properties.privateIPAddress), owner = name
) on nextHop
| where isempty(owner)
| project routeTable, route, nextHopRun it as a single line, since line breaks don’t survive being passed into az.cmd:
az graph query -q ((Get-Content C:\azure-lab\dead-hops.kql -Raw) -replace "`r?`n", ' ') --query "data" -o tableIt lists every route whose next hop IP isn’t on any NIC. Firewalls and internal load balancer frontends aren’t NICs, so check any hits against those before changing anything (you can add the azurefirewalls and loadbalancers types to the query later). Run it after every firewall or appliance change.
Read effective routes in the hub and spokes
1Three test VMs in the hub and spokes
Create one VM in the hub’s shared subnet and one in each spoke (takes about 6 minutes):
az group create --name rg-saat-l63 --location centralindia --tags course=saatvedha-azure lesson=63 -o none
$sub = az network vnet subnet show --resource-group rg-saat-hub --vnet-name vnet-hub --name snet-shared --query id -o tsv
az vm create --resource-group rg-saat-l63 --name vm-hub --image Canonical:ubuntu-24_04-lts:server:latest --size Standard_B1s --subnet $sub --private-ip-address 10.40.10.4 --public-ip-address '""' --nsg '""' --admin-username azureuser --generate-ssh-keys --tags course=saatvedha-azure lesson=63 -o none
$sub = az network vnet subnet show --resource-group rg-saat-hub --vnet-name vnet-spoke1 --name snet-app --query id -o tsv
az vm create --resource-group rg-saat-l63 --name vm-s1 --image Canonical:ubuntu-24_04-lts:server:latest --size Standard_B1s --subnet $sub --private-ip-address 10.41.1.4 --public-ip-address '""' --nsg '""' --admin-username azureuser --generate-ssh-keys --tags course=saatvedha-azure lesson=63 -o none
$sub = az network vnet subnet show --resource-group rg-saat-hub --vnet-name vnet-spoke2 --name snet-app --query id -o tsv
az vm create --resource-group rg-saat-l63 --name vm-s2 --image Canonical:ubuntu-24_04-lts:server:latest --size Standard_B1s --subnet $sub --private-ip-address 10.42.1.4 --public-ip-address '""' --nsg '""' --admin-username azureuser --generate-ssh-keys --tags course=saatvedha-azure lesson=63 -o none2Read vm-s1’s effective routes
Run this:
az network nic show-effective-route-table --resource-group rg-saat-l63 --name vm-s1VMNic --query "value[?nextHopType!='None'].{source:source, prefix:addressPrefix[0], nextHop:nextHopType, ip:nextHopIpAddress[0]}" -o tableYou should see something like this:
Source Prefix NextHop Ip
------- ------------ ---------------- ----------
Default 10.41.0.0/16 VnetLocal
Default 10.40.0.0/16 VNetPeering
Default 0.0.0.0/0 Internet
User 10.42.0.0/16 VirtualAppliance 10.40.1.4Read each line as “to reach this prefix, go here”. The spoke reaches its own VNet locally and the hub over peering, while spoke 2 goes through an appliance at 10.40.1.4.
3Test the paths
Ping the hub first, then spoke 2:
az vm run-command invoke --resource-group rg-saat-l63 --name vm-s1 --command-id RunShellScript --scripts 'ping -c 2 -W 2 10.40.10.4 | tail -2' --query "value[0].message" -o tsv
az vm run-command invoke --resource-group rg-saat-l63 --name vm-s1 --command-id RunShellScript --scripts 'ping -c 2 -W 2 10.42.1.4 | tail -2' --query "value[0].message" -o tsvYou should see something like this:
[stdout]
2 packets transmitted, 2 received, 0% packet loss, time 1001ms
rtt min/avg/max/mdev = 1.180/1.244/1.308/0.064 ms
[stdout]
2 packets transmitted, 0 received, 100% packet loss, time 1019msThe hub works over peering and spoke 2 doesn’t. Before you read on, see if you can explain why from the table above.


✅ Checkpoint: You can read each line of vm-s1’s effective routes, and you’ve found a path that fails.
Break It, Then Fix It
1Break it: a route to a firewall that no longer exists
This break already happened back in Lesson 48. Prove what’s living at 10.40.1.4:
az graph query -q "Resources | where type =~ 'microsoft.network/networkinterfaces' | mv-expand ip = properties.ipConfigurations | where ip.properties.privateIPAddress == '10.40.1.4' | project name" --query "data[].name" -o tsv
az network firewall list --query "[].{name:name, ip:ipConfigurations[0].privateIPAddress}" -o table
az network watcher show-next-hop --resource-group rg-saat-l63 --vm vm-s1 --source-ip 10.41.1.4 --dest-ip 10.42.1.4 -o tableYou should see something like this (the first two commands print nothing):
NextHopIpAddress NextHopType RouteTableId
------------------ ---------------- ---------------------------------------
10.40.1.4 VirtualAppliance /subscriptions/.../routeTables/rt-spoke1No NIC and no firewall owns 10.40.1.4, and still rt-spoke1 sends spoke 2 traffic there. Azure didn’t warn anyone when the firewall was deleted, and it never will.
To fix it, point both routes at an appliance that exists. Turn vm-hub into a router the way you did in Lesson 47, then update the routes:
az network nic update --resource-group rg-saat-l63 --name vm-hubVMNic --ip-forwarding true -o none
az vm run-command invoke --resource-group rg-saat-l63 --name vm-hub --command-id RunShellScript --scripts 'sysctl -w net.ipv4.ip_forward=1' -o none
az network route-table route update --resource-group rg-saat-hub --route-table-name rt-spoke1 --name to-spoke2 --next-hop-ip-address 10.40.10.4 -o none
az network route-table route update --resource-group rg-saat-hub --route-table-name rt-spoke2 --name to-spoke1 --next-hop-ip-address 10.40.10.4 -o none
az vm run-command invoke --resource-group rg-saat-l63 --name vm-s1 --command-id RunShellScript --scripts 'ping -c 2 -W 2 10.42.1.4 | tail -2' --query "value[0].message" -o tsvYou should see 2 received, and both directions now go through a router that exists.
2Break it: a new VNet that overlaps the hub
A team builds a VNet for a new app and asks for it to be peered to the hub. They picked 10.40.128.0/17 because “10.40 is our Azure range”:
az network vnet create --resource-group rg-saat-l63 --name vnet-newapp --address-prefixes 10.40.128.0/17 --subnet-name snet-app --subnet-prefixes 10.40.129.0/24 -o none
$newId = az network vnet show --resource-group rg-saat-l63 --name vnet-newapp --query id -o tsv
az network vnet peering create --resource-group rg-saat-hub --name hub-to-newapp --vnet-name vnet-hub --remote-vnet $newId --allow-vnet-access true -o noneYou’ll get an error along these lines:
(VnetAddressSpacesOverlap) Cannot create or update peering /subscriptions/.../virtualNetworks/vnet-hub/virtualNetworkPeerings/hub-to-newapp. Virtual networks /subscriptions/.../virtualNetworks/vnet-hub and /subscriptions/.../virtualNetworks/vnet-newapp cannot be peered because their address spaces overlap. Overlapping address prefixes: 10.40.128.0/17vnet-hub owns the whole of 10.40.0.0/16, so 10.40.128.0/17 sits inside it and peering can never work with this plan. Run C:\azure-lab\Test-IpPlan.ps1 from Lesson 45 to check a plan before anyone builds on it.
To fix it, since the VNet has no resources yet, re-address it to the next free spoke range (10.43.0.0/16 in the Lesson 45 plan) and then peer:
az network vnet subnet delete --resource-group rg-saat-l63 --vnet-name vnet-newapp --name snet-app
az network vnet update --resource-group rg-saat-l63 --name vnet-newapp --address-prefixes 10.43.0.0/16 -o none
az network vnet subnet create --resource-group rg-saat-l63 --vnet-name vnet-newapp --name snet-app --address-prefixes 10.43.1.0/24 -o none
az network vnet peering create --resource-group rg-saat-hub --name hub-to-newapp --vnet-name vnet-hub --remote-vnet $newId --allow-vnet-access true -o none
az network vnet peering show --resource-group rg-saat-hub --vnet-name vnet-hub --name hub-to-newapp --query peeringState -o tsvYou should see Initiated, because only one side of the peering exists, and that’s fine for this test.

3Clean up
Remove the test peering from the hub side, point the routes back at the firewall address for the Phase 3 design, and delete the test resources:
az network vnet peering delete --resource-group rg-saat-hub --vnet-name vnet-hub --name hub-to-newapp
az network route-table route update --resource-group rg-saat-hub --route-table-name rt-spoke1 --name to-spoke2 --next-hop-ip-address 10.40.1.4 -o none
az network route-table route update --resource-group rg-saat-hub --route-table-name rt-spoke2 --name to-spoke1 --next-hop-ip-address 10.40.1.4 -o none
az group delete --name rg-saat-l63 --yes✅ Checkpoint: You found a black-holed route by proving nothing lived at its next hop, fixed it, and cleared up an address overlap before peering.
This happened at work
The firewall migration that broke one subnet
A logistics company swapped a pair of third-party firewall VMs for Azure Firewall, and the cut-over plan updated the route tables for 12 spokes. About a week later, the warehouse scanning system in one spoke stopped syncing with the ERP in another spoke, and oddly it only happened at night.
It took a while to find. That spoke had a second route table, attached to a batch subnet, that nobody had put on the list, and its routes still pointed at the old firewall’s internal load balancer IP. The batch jobs only ran at night, which is why every check the team did during the day passed.
What they changed: a Resource Graph query now lists every route with a VirtualAppliance next hop and checks whether the IP belongs to a NIC, load balancer or firewall. It runs every day and raises an alert for any route pointing at nothing, and firewall changes now start from that query instead of a spreadsheet of route tables.
Common mistakes and troubleshooting
| Mistake | What you see | What to do |
|---|---|---|
| Route to a deleted appliance | Silent packet loss | Prove the next hop IP exists, then update the routes. |
| Overlapping VNet ranges | VnetAddressSpacesOverlap on peering | Re-address before you deploy resources, and work from an IP plan. |
| Reading routes on a stopped VM | Effective routes unavailable | Start the VM, or use next hop instead. |
| Missing a second route table | One subnet fails, others work | List the route tables on every subnet in the VNet. |
| Expecting transitive peering | Spoke to spoke fails without a route | Route through an appliance in the hub, or peer the spokes directly. |
| Forgetting the return path | One-way traffic | Check the effective routes on both ends. |
Interview questions
Click a question to open it. Each one is phrased the way an interviewer would ask it, and underneath you’ll find why they ask it and one way you could answer in your own words.
Fresher level
1. What are effective routes?
Why they ask this: The basic concept.
How you might answer: It’s the merged set of system, gateway and user-defined routes that a NIC uses once Azure has applied its selection rules.
2. What does a next hop of VirtualAppliance mean?
Why they ask this: Vocabulary.
How you might answer: It means traffic for that prefix goes to a specific IP, usually a firewall or router, and that device has to forward it on.
3. Can you peer VNets with overlapping ranges?
Why they ask this: A classic rule.
How you might answer: No, the peering fails with VnetAddressSpacesOverlap.
2–5 years experience
4. Spoke to spoke traffic fails but both reach the hub. What do you check?
Why they ask this: A real troubleshooting path.
How you might answer: I’d look at the effective routes on both spokes for the other spoke’s prefix and check that the next hop appliance exists and forwards traffic. Then I’d check allow forwarded traffic on the peerings, the NSGs and the return route.
5. How do you find routes that point at nothing?
Why they ask this: Operations skill.
How you might answer: With Resource Graph, I’d query every route table for VirtualAppliance next hops and compare those IPs with the private IPs of NICs, load balancers and firewalls.
6. How do you fix an overlap when the VNet already has resources?
Why they ask this: Practical judgement.
How you might answer: You can’t just change it. You’d add a new address space that doesn’t overlap and migrate the subnets and resources across, or rebuild, which is why IP planning has to come first.
Senior level
7. How would you prevent routing mistakes across 50 spokes?
Why they ask this: They want governance.
How you might answer: Route tables kept in code, Azure Virtual Network Manager routing configurations, a Policy requiring route tables on subnets, validation queries every day, and change reviews for appliance IPs.
8. How do you handle overlapping ranges after a merger?
Why they ask this: Senior design.
How you might answer: NAT on the firewalls or Azure Virtual WAN with NAT rules, re-addressing bit by bit, or private link patterns for particular services, while keeping a long-term plan to get rid of the overlaps.
9. When would you use Virtual Network Manager instead of manual peering?
Why they ask this: Scale thinking.
How you might answer: Once you have a lot of VNets. It manages hub-and-spoke or mesh connectivity, security admin rules and routing configurations from one place, and it can pick up new VNets by tag.
Quick quiz
Q1. A User route sends 10.42.0.0/16 to 10.40.1.4, which nothing owns. Result?
- Error message
- Silent drop
- Automatic reroute
- Peering fails
Show answer
B — Azure accepts the route and drops the traffic.
Q2. Which wins for the same prefix?
- Default
- User
- VirtualNetworkGateway
- Random
Show answer
B — User routes win.
Q3. Peering fails with VnetAddressSpacesOverlap. Fix?
- Restart the gateway
- Re-address one VNet
- Add an NSG rule
- Use Basic SKU
Show answer
B — The address spaces must not overlap.
Q4. Effective routes need the VM to be?
- Deallocated
- Running
- In a zone
- Windows
Show answer
B — They are read from the running NIC.
Q5. Best proof that a next hop is valid?
- The route exists
- An appliance owns that IP and forwards
- The NSG allows it
- The VM is large
Show answer
B — Something must live at that IP.
Quick recap
You can now find routing faults hiding behind components that all look healthy.
- Effective routes combine system, gateway and user routes.
- Longest prefix, then User over gateway over system.
- Routes to appliances that don’t exist drop traffic silently.
- Peering won’t accept overlapping address spaces.
- Check both directions and every route table.
Next lesson
Lesson 64: Storage account 403 errors → You fix storage account 403 errors caused by firewalls, service endpoints, SAS tokens and missing data roles.
Further reading: Azure effective routes
Want to go deeper into Azure effective routes? See Microsoft’s Diagnose a virtual machine routing problem and Virtual network traffic routing. You can also see the full plan for this course on the Azure Cloud Administration course page.
