Troubleshoot Virtual Network Connectivity
30-second answer
When VM A can't reach B, check in order: routing, then NSGs, then name resolution, then the app. Azure Network Watcher (enabled automatically per region) has a tool for each question. Connection troubleshoot tests A to B on a port and reports the failing hop. Next hop and the NIC's effective routes show where a packet goes (next hop None means it's dropped, often because peering isn't transitive). IP flow verify and effective security rules name the NSG rule that allows or denies a flow. Also check peering state (Connected), IP forwarding on NVAs, overlapping ranges and DNS.
Simulate it » No Azure account neededExam objective: 4.1.5 Troubleshoot network connectivity. (Skills measured as of April 17, 2026)
Simulations
Feel it before you read it. No account needed, nothing leaves this page.
App1 in spoke 1 can't reach app2 in spoke 2. Search for <strong>Network Watcher</strong>.
👆 Click the glowing item in the portal to continue
Read the steps as text
- App1 in spoke 1 can't reach app2 in spoke 2. Search for Network Watcher.
- Type network watcher in the search bar and pick Network Watcher under Services.
- Network Watcher is turned on automatically per region (in NetworkWatcherRG). Start with Connection troubleshoot.
- Unreachable, and the next hop is None: there's no route. That points at routing, not an NSG.
- Next hop confirms it. Spokes are peered with the hub, not with each other, and peering isn't transitive.
- Effective routes on the NIC shows why: 10.2.0.0/16 only matches the 10.0.0.0/8 None route. Add a UDR to the hub NVA (and one back from spoke 2).
- With the routes fixed, IP flow verify checks the NSGs on app2 for that exact flow. Allowed.
- Run Connection troubleshoot again: Reachable through the NVA. Order to remember: routes (next hop, effective routes), then NSGs (IP flow verify, effective rules), then the app.
🧪 Simulation for learning. Screens are simplified versions of the Azure portal; names, prices and IDs are examples. Nothing here touches real Azure.
🖱️ Drag to rotate · scroll or pinch to zoom
Troubleshoot with Network Watcher
Network Watcher tools answer one question each. IP flow verify: which NSG rule allows or denies this flow? Next hop: where does this packet go? Connection troubleshoot: can A reach B, and if not, at which hop?
🤔 What happens if…
Read this tour as text
- VNets, subnets and a public IP. A virtual network is your private range in one region, split into subnets. Azure keeps 5 addresses in every subnet. A Standard public IP is static, zone-redundant where the region has zones, and closed to inbound traffic until an NSG opens it.
- Peering is not transitive. VNet peering joins two VNets over the Microsoft backbone. Each side has its own link, address spaces can't overlap, and the hub can share its VPN gateway (gateway transit). Peering never chains: spoke 1 and spoke 2 can't talk through the hub on their own.
- User-defined routes to the NVA. A route table on a subnet overrides system routes. Next hop Virtual appliance sends traffic to a firewall or NVA, which needs IP forwarding on its NIC. Longest prefix wins, and a user route beats a system route on the same prefix.
- NSGs, ASGs and effective rules. An NSG has rules checked by priority (100 to 4096, lowest first). Inbound traffic meets the subnet NSG first, then the NIC NSG, and both must allow. An application security group lets a rule say "to the web servers" instead of listing IPs.
- Azure Bastion. Azure Bastion lives in AzureBastionSubnet (/26 or larger) and opens RDP and SSH to VMs on their private IPs, from the portal over TLS 443 or with the native client on Standard and Premium. One Bastion in the hub serves peered spokes.
- Service endpoint vs private endpoint. A service endpoint sends a subnet's traffic to the service's public IP over the backbone, and the service firewall allows that subnet. A private endpoint gives the service a private IP in your VNet, and a privatelink private DNS zone makes the name resolve to it.
- Azure DNS: public and private zones. A public zone answers the internet once you delegate the domain to Azure's name servers. Alias records point at Azure resources such as a public IP. A private zone answers only VNets with a virtual network link, and can auto-register VM names.
- Standard load balancer and health probes. A load balancer spreads TCP/UDP flows from a frontend (public or internal) to a backend pool by load-balancing rules. A health probe pulls a VM out of rotation when it stops answering. Probes come from 168.63.129.16.
- Troubleshoot with Network Watcher. Network Watcher tools answer one question each. IP flow verify: which NSG rule allows or denies this flow? Next hop: where does this packet go? Connection troubleshoot: can A reach B, and if not, at which hop?
Contoso wants one hub VNet for shared services and two spoke VNets for apps. Build the address plan, give the hub a static public IP and a VPN gateway, peer everything, then find out the hard way that spoke 1 can't talk to spoke 2 until you route it through a firewall in the hub.
🎓 Education-only simulation. Your lab is saved in this browser, so you can leave and continue later.
😟 THE PROBLEM
"The app can't reach the database" and three teams blame each other.
😊 THE SOLUTION
Use Network Watcher to test the path hop by hop and name the exact route or rule.
- Is it routing?✓ Next hop and effective routes
- Is it an NSG?✓ IP flow verify and effective rules
- Where does it break?✓ Connection troubleshoot
Start with a question
Your parcel never arrived. Do you blame the courier, the address or the security guard?
You check in order. Did it leave the depot and which van took it? Was the address right? Did the building’s security turn the driver away? Each question has someone who knows the answer, and guessing wastes a day.
Network problems are the same. Routes decide which van, DNS decides the address and NSGs are the security guard. Azure Network Watcher gives you a tool for each, so you stop guessing and read the answer.
Explain it like I’m 10
The technical explanation
Work through the layers
| Question | Tool | What a bad answer looks like |
|---|---|---|
| Can A reach B on port X at all? | Connection troubleshoot (az network watcher test-connectivity) | Unreachable, with the hop that failed |
| Where does the packet go? | Next hop (show-next-hop), Effective routes on the NIC | None, Internet when you expected VirtualAppliance, a wrong appliance IP |
| Which NSG rule decides? | IP flow verify (test-ip-flow), Effective security rules, NSG diagnostics | Deny with the rule name, such as DenyAllInBound on the NIC NSG |
| Does the name resolve right? | nslookup from a VM in the VNet | Public IP for a private endpoint, NXDOMAIN for a private zone |
| Is it the app? | Packet capture, the VM’s own firewall and logs | Port not listening |
Network Watcher is enabled automatically in each region where you have a VNet (resources live in NetworkWatcherRG). Most tools need the VM running and the Network Watcher agent extension for packet capture and connection troubleshoot. Monitoring tools such as Connection monitor and VNet flow logs belong to the monitoring domain; here we troubleshoot one problem at a time.
Classic causes
| Symptom | Cause | Fix |
|---|---|---|
| Spoke 1 can’t reach spoke 2, next hop None | Peering isn’t transitive | Peer them, or UDRs to a hub NVA on both sides |
| Peering shows Initiated | Only one side created | Create the other link |
| Peering won’t create | Overlapping address spaces | Re-address one VNet |
| Packets die at the NVA | IP forwarding off, or no return route | Enable IP forwarding (NIC and OS), add the mirror route |
| NVA forwards into a spoke but it’s dropped | Peering doesn’t allow forwarded traffic | Allow forwarded traffic on the spoke’s peering |
| Allowed on the subnet, still blocked | NIC-level NSG | Fix or remove the NIC NSG |
| Load balancer backend Down | Probe blocked or wrong port/path | Allow AzureLoadBalancer, fix the probe |
| Private endpoint ignored | No privatelink DNS zone or VNet link | Link the zone, add a DNS zone group |
Portal and CLI
Portal: Network Watcher → Network diagnostic tools → Connection troubleshoot / IP flow verify / Next hop / Effective security rules. On a NIC: Help → Effective routes and Effective security rules. From a VM: Help → Connection troubleshoot.
az network watcher test-connectivity -g rg-net-hub --source-resource vm-app1 --dest-address 10.2.1.4 --dest-port 443
az network watcher show-next-hop -g rg-net-hub --vm vm-app1 --source-ip 10.1.1.4 --dest-ip 10.2.1.4
az network watcher test-ip-flow -g rg-net-hub --vm vm-app2 --direction Inbound --protocol TCP \
--local 10.2.1.4:443 --remote 10.1.1.4:50000
az network nic show-effective-route-table -g rg-net-hub -n nic-app1 -o table
az network nic list-effective-nsg -g rg-net-hub -n nic-app2
PowerShell: Test-AzNetworkWatcherConnectivity, Get-AzNetworkWatcherNextHop, Test-AzNetworkWatcherIPFlow, Get-AzEffectiveRouteTable.
-
1 Test
Connection troubleshoot: Unreachable, next hop None.
-
2 Route
Effective routes: 10.2.0.0/16 only matches 10.0.0.0/8 → None. Add UDRs to the hub NVA.
-
3 Forward
Still failing at the NVA: turn on IP forwarding.
-
4 Rule
IP flow verify on the target: AllowVnetInBound. Retest: Reachable.
Architect level Why Cloud Shell can't test your VNet
Cloud Shell runs in a Microsoft-managed container outside your VNet (unless you deploy it into a VNet), so nslookup or curl from it tests the public internet path, not what your VMs see. Network Watcher tools run from the VM’s NIC, which is why they give the real answer for private endpoints, private zones and UDRs.
Real-world business scenario
Wide World Importers (fictional)
- The problem
- After a firewall migration, the order API in one spoke couldn't reach the inventory database in another. The app, database and network teams spent two days each proving it wasn't their fault.
- What they used
- A runbook built on Network Watcher: connection troubleshoot from the API VM, next hop, effective routes and IP flow verify. Next hop showed VirtualAppliance to the old firewall IP; the route table still pointed there.
- Why that choice
- Each tool answers one question with evidence, so the team found the stale route in ten minutes instead of arguing.
- The result
- The route was updated, connection troubleshoot showed Reachable, and the runbook is now the first step for every connectivity ticket.
When to use it and when not to
✓ Use it when…
- Any "can't connect" ticket between VMs, PaaS endpoints or on-premises.
- Proving a route or NSG change worked before closing a change request.
- Checking why a load balancer backend or private endpoint is ignored.
✕ Think twice when…
- Testing VNet paths from Cloud Shell or your laptop.
- Changing NSGs before you know routing is fine.
- Using one-off tools for ongoing monitoring. Use Connection monitor for that.
↔ Alternatives to consider
- Connection monitor for continuous reachability and latency tests with alerts.
- VNet flow logs and Traffic analytics to see who talked to whom over time.
- Azure Monitor Network Insights for a health view across network resources.
Test yourself with exercises
5 original practice questions in the AZ-104 style. Pick your answers, then check them. You will see why each option is right or wrong. Score 75% or more and this topic is marked complete.
Interview preparation
Say your answer out loud first, then open the model answer. Interviewers care more about your reasoning than the exact words.
Beginner A VM can't reach another VM. What's the first tool you'd use?
Model answer
Connection troubleshoot in Network Watcher. It tests the real path on the port I care about and tells me whether it's reachable, and if not, which hop failed, which points me at routes or NSGs.
Intermediate What's the difference between IP flow verify and next hop?
Model answer
IP flow verify answers "is this flow allowed?" by checking NSG rules and naming the rule. Next hop answers "where does this packet go?" by checking routes and returning the next hop type, like VirtualAppliance, Internet or None. One is security, the other is routing.
Experienced developer Next hop returns None between two spokes. What does that tell you?
Model answer
There's no route to the destination, so Azure drops the packet. Between spokes that are only peered to a hub, that's non-transitive peering. I'd either peer them directly or add UDRs on both spokes to a hub NVA, turn on IP forwarding on the NVA and allow forwarded traffic on the peerings.
Scenario After adding a firewall in the hub, spoke VMs lost access to each other. Routes point at the firewall. Walk through your checks.
Model answer
Next hop from a spoke VM should say VirtualAppliance with the firewall IP. Then I check IP forwarding on the firewall's NIC if it's an NVA, the return route in the other spoke so traffic is symmetric, allow forwarded traffic on the spoke peerings, and the firewall's own rules. Connection troubleshoot then confirms which hop still fails.
Quick revision
Key points
- Order - routes, NSGs, DNS, then the app.
- Connection troubleshoot = end-to-end test with the failing hop.
- Next hop / effective routes = where the packet goes. None = dropped.
- IP flow verify / effective security rules = which NSG rule allows or denies.
- Common causes - non-transitive peering, missing IP forwarding, one-sided peering, NIC NSG, missing private DNS link.
Important terminology
- Azure Network Watcher
- A regional service with network diagnostic and monitoring tools, enabled automatically when you create a VNet in a region.
- IP flow verify
- Tests whether a single flow (protocol, local IP:port, remote IP:port, direction) to or from a VM is allowed, and names the NSG rule that decides.
- Next hop
- Shows the next hop type, next hop IP and route table for a packet from a VM to a destination IP.
- Connection troubleshoot
- Tests connectivity from a VM to another VM, IP or FQDN on a port and reports reachability, latency and the hop where it fails.
- Effective routes
- The combined system, BGP and user-defined routes applied to a NIC, with each route's state.
- NSG diagnostics
- A Network Watcher tool that evaluates NSG rules for a traffic pattern across the NSGs on its path.
Common mistakes
- Editing NSGs when the real problem is a route (next hop None).
- Forgetting the return path through a stateful firewall.
- Testing from Cloud Shell, which isn't inside your VNet.
Exam tips
- "Which NSG rule blocks the traffic?" = IP flow verify (or effective security rules).
- "Is traffic sent to the NVA?" = Next hop.
- "Test VM to FQDN on port 1433 and find the failing hop" = Connection troubleshoot.
Five quick revision questions
-
1.Which tool names the NSG rule that denied a flow?Show
IP flow verify.
-
2.What does next hop type None mean?Show
The packet is dropped because no route sends it anywhere.
-
3.Where do you see all routes applied to a VM?Show
Effective routes on its network interface.
-
4.Is Network Watcher enabled automatically?Show
Yes, per region, in the NetworkWatcherRG resource group.
-
5.Which CLI command runs connection troubleshoot?Show
az network watcher test-connectivity.
Official references
Finished this lesson? Tick it off. Your progress is saved in this browser.
Next up: Azure Monitor Metrics and Diagnostic Settings
Lesson done? Make it stick with a quick gameSort It, Match the Pairs, Lightning Round and Who Am I? Earn XP and badges.