To troubleshoot routing issues in Azure, Network Watcher Next Hop calculates which route wins for a specific destination IP, while Effective Routes lists all active routes applied to a Virtual Machine’s Network Interface (NIC).
Prerequisites
- Network Watcher must be enabled in the Azure region where your Virtual Machine (VM) resides.
- You need Network Contributor or Reader permissions on the target VM and NIC.
1.Run Next Hop Diagnostics:Identify the Win Route.
First, check where a packet from your source VM will actually travel when attempting to reach the destination IP.
Option A: Via Azure Portal
- Search for Network Watcher in the top search bar.
- Under Network diagnostic tools, select Next hop.
- Choose your Subscription, Resource Group, Virtual Machine, and target Network Interface.
- Enter the Source IP address (the private IP of your VM NIC) and the Destination IP address you are trying to reach.
- Click Next hop.
Option B: Via Azure CLI
Bash
az network watcher show-next-hop \ --resource-group myResourceGroup \ --vm myVm \ --nic myVmVMNic \ --source-ip 10.0.0.4 \ --dest-ip 10.1.0.5 \ --out table
Verification: The tool will output the Next hop type, Next hop IP address, and Route Table ID.
VirtualAppliance: Traffic is correctly hitting an Azure Firewall or NVA.VirtualNetwork: Traffic stays within local/peered VNet subnets.Internet: Traffic bypasses local appliances and goes directly to the web.None: Traffic is being intentionally dropped (blackholed) due to a missing route or misconfigured0.0.0.0/0UDR.
2.View Effective Routes for the NIC:Inspect Full Routing Table.
If Next Hop returns unexpected results (like None or Internet when you expected a firewall), inspect the underlying complete route table evaluation.
Option A: Via Azure Portal
- Navigate to your Virtual Machine and select Networking under Settings.
- Click on the attached Network Interface (NIC) name.
- Under Help or Settings, select Effective routes.
Option B: Via Azure CLI
Bash
az network nic show-effective-route-table \ --resource-group myResourceGroup \ --name myVmVMNic \ --output table
Verification: Review the generated table. Look for:
- Address Prefixes: Ensure your destination IP falls within an active prefix.
- State: Verify routes show as
Active. Invalid IP addresses or detached gateways will mark routes asInvalid. - Source: Identifies whether a rule originates from a
Defaultsystem route, aUserDefined Route (UDR), or aVirtualNetworkGateway(BGP).
3.Isolate and Fix the Misconfiguration:Resolution.
Compare the destination IP against the evaluated routes to correct the issue:
- If Next Hop is
None: A UDR with a destination prefix matching your traffic hasNext Hop Type = None, or an RFC 1918 default blackhole route is active without a Gateway/UDR overriding it. Edit the associated Route Table to specify a valid Next Hop. - If Next Hop is
Internetinstead of NVA: The Route Table containing your0.0.0.0/0UDR is either not associated with the source VM’s subnet, or a more specific system/BGP route is taking precedence due to Longest Prefix Match. - If Next Hop is correct (
VirtualAppliance) but traffic still fails: The routing layer is functioning properly. Switch to IP Flow Verify in Network Watcher to check if a Network Security Group (NSG) or Firewall policy is blocking the port/protocol.