Skip to content

Static Routes (UDRs)

🎯 Lab Objective

In this hands-on lab, you will learn how to:

  • Understand User Defined Routes (UDRs) and their purpose in Azure networking
  • Create and configure route tables to control network traffic flow
  • Troubleshoot routing issues using Azure portal tools
  • Implement custom routing scenarios with network virtual appliances
  • Use effective routes to diagnose routing problems
  • Fix misconfigured static routes that break connectivity

Scenario: Your application VM cannot reach external resources due to a misconfigured static route pointing to an incorrect gateway IP address. You need to diagnose and fix the routing issue.


πŸ—οΈ Pre-Provisioned Environment

The following Azure resources have been pre-deployed with intentional misconfigurations:

Resource Overview

Resource TypeResource NameConfigurationPurpose
Resource GroupStaticRoute-Lab-RGContains all lab resourcesLogical container
Virtual NetworkRouteLabVNetAddress space: 10.0.0.0/16Network foundation
App SubnetAppSubnetRange: 10.0.1.0/24Application tier
Gateway SubnetGatewaySubnetRange: 10.0.2.0/24Network gateway tier
App VMAppVMWindows Server 2019Application server
Gateway VMGatewayVMUbuntu with IP forwardingNetwork virtual appliance
Route TableAppSubnet-RouteTableMisconfigured routesCustom routing

Network Architecture

RouteLabVNet (10.0.0.0/16)
β”œβ”€β”€ AppSubnet (10.0.1.0/24)
β”‚ └── AppVM (Windows Server)
β”‚ └── Route Table (❌ Incorrect next hop)
└── GatewaySubnet (10.0.2.0/24)
└── GatewayVM (Ubuntu NVA)
└── IP: 10.0.2.4 (Correct gateway)
Route Table Issue:
β”œβ”€β”€ Route: 0.0.0.0/0 β†’ 10.0.2.100 (❌ Wrong IP)
└── Should be: 0.0.0.0/0 β†’ 10.0.2.4 (βœ… Correct IP)

VM Details

VMPrivate IPPublic IPOperating SystemRole
AppVM10.0.1.4DynamicWindows Server 2019Application server
GatewayVM10.0.2.4DynamicUbuntu 20.04 LTSNetwork virtual appliance

πŸš€ Lab Tasks

Task 1: Verify Connectivity Issue

Step 1: Connect to Application VM

  1. Navigate to StaticRoute-Lab-RG resource group
  2. Click on AppVM
  3. Click Connect β†’ RDP
  4. Use credentials:
    • Username: azureuser
    • Password: LabPassword123!

Step 2: Test Network Connectivity

Once connected to AppVM, open Command Prompt and run:

Terminal window
# Test connectivity to GatewayVM
ping 10.0.2.4
# Test internet connectivity (should fail due to routing)
ping 8.8.8.8
# Test DNS resolution
nslookup google.com
# Check local routing table
route print

Step 3: Document the Issue

Expected Behavior:

  • ❌ Ping to GatewayVM (10.0.2.4) should fail or timeout
  • ❌ Internet connectivity should fail
  • ❌ External DNS resolution may fail
  • βœ… Local subnet connectivity should work

πŸ“ Note: Record specific error messages and response times for analysis.


Task 2: Inspect Route Table Configuration

Step 1: Navigate to Route Table

  1. In Azure Portal, go to StaticRoute-Lab-RG
  2. Click on AppSubnet-RouteTable
  3. In the left menu, click Routes

Step 2: Analyze Current Routes

Examine the configured routes:

Route NameAddress PrefixNext Hop TypeNext Hop IPStatus
Default-Route0.0.0.0/0Virtual Appliance10.0.2.100❌ Incorrect
Local-VNet10.0.0.0/16VNet Local-βœ… Correct

Step 3: Identify the Problem

Issues to look for:

  • Next Hop IP: Is 10.0.2.100 the correct IP?
  • Actual Gateway IP: GatewayVM is at 10.0.2.4
  • Route Priority: Are there conflicting routes?

Step 4: Check Route Table Association

  1. Click Subnets in the left menu
  2. Verify: AppSubnet is associated with this route table
  3. Confirm: Route table is actively applied

Task 3: Use Effective Routes for Diagnosis

Step 1: View Effective Routes

  1. Navigate to AppVM
  2. Click Networking in the left menu
  3. Click on the Network Interface name
  4. Click Effective routes

Step 2: Analyze Route Evaluation

Review the effective routes table:

SourceAddress PrefixNext Hop TypeNext Hop IPState
User0.0.0.0/0VirtualAppliance10.0.2.100Active
Default10.0.0.0/16VNet-Active

Step 3: Understand Route Precedence

Route evaluation order:

  1. User-defined routes (highest priority)
  2. BGP routes (dynamic routing)
  3. System routes (default Azure routes)

πŸ” Analysis: The user-defined route with incorrect next hop is overriding default routing.


Task 4: Fix the Route Configuration

Step 1: Get Correct Gateway IP

  1. Navigate to GatewayVM
  2. Click Networking
  3. Copy the Private IP address: 10.0.2.4

Step 2: Update Route Table

  1. Go back to AppSubnet-RouteTable
  2. Click Routes
  3. Click on the Default-Route (or problematic route)
  4. Edit the route:
SettingCurrent ValueCorrect Value
Route nameDefault-RouteDefault-Route
Address prefix0.0.0.0/00.0.0.0/0
Next hop typeVirtual applianceVirtual appliance
Next hop address10.0.2.10010.0.2.4
  1. Click Save

Step 3: Verify Route Update

  1. Refresh the Routes page
  2. Confirm: Next hop IP now shows 10.0.2.4
  3. Status: Route should show as Active

⏱️ Propagation Time: Route changes typically take 1-2 minutes to propagate.


Task 5: Validate the Fix

Step 1: Test Connectivity from AppVM

Return to AppVM and test connectivity:

Terminal window
# Wait for route propagation
timeout /t 60
# Test connectivity to GatewayVM
ping 10.0.2.4
# Test internet connectivity
ping 8.8.8.8
# Test DNS resolution
nslookup google.com
# Verify routing table
route print

Step 2: Expected Results After Fix

Post-fix behavior:

  • βœ… Ping to GatewayVM (10.0.2.4) should succeed
  • βœ… Internet connectivity should work (if GatewayVM allows forwarding)
  • βœ… DNS resolution should function

Step 3: Verify Effective Routes

  1. Go back to AppVM β†’ Networking β†’ Network Interface
  2. Click Effective routes
  3. Confirm: Default route now shows correct next hop 10.0.2.4

Task 6: Advanced Route Testing

Step 1: Test Route Tracing

From AppVM, use advanced diagnostics:

Terminal window
# Trace route to internet
tracert 8.8.8.8
# Test specific port connectivity
telnet 8.8.8.8 53
# Check ARP table
arp -a

Step 2: Test from Gateway VM

  1. Connect to GatewayVM via SSH:
Terminal window
ssh azureuser@[GatewayVM-Public-IP]
# Password: LabPassword123!
  1. Verify IP forwarding and routing:
Terminal window
# Check IP forwarding status
cat /proc/sys/net/ipv4/ip_forward
# View routing table
ip route show
# Monitor traffic (optional)
sudo tcpdump -i any icmp

Step 3: Create Additional Routes (Optional)

  1. In AppSubnet-RouteTable, click + Add
  2. Create a more specific route:
SettingValuePurpose
Route nameSpecific-RouteTest route precedence
Address prefix8.8.8.0/24Google DNS subnet
Next hop typeInternetDirect internet access
  1. Test: Compare routing behavior for different destinations

πŸ”§ Troubleshooting Guide

Common UDR Issues and Solutions

IssueSymptomsDiagnosisSolution
Wrong next hop IPTraffic not reaching destinationCheck effective routesUpdate route with correct IP
Route not propagatedChanges not taking effectWait 1-2 minutesRefresh and verify
Conflicting routesUnpredictable routingReview route precedenceAdjust route priorities
NVA not forwardingTraffic reaches NVA but stopsCheck IP forwardingEnable forwarding on NVA
Route table not associatedCustom routes ignoredCheck subnet associationAssociate route table

Route Troubleshooting Commands

Windows (AppVM):

Terminal window
# View local routing table
route print
# Trace network path
tracert [destination]
# Test connectivity
ping [destination]
telnet [destination] [port]

Linux (GatewayVM):

Terminal window
# View routing table
ip route show
# Check IP forwarding
cat /proc/sys/net/ipv4/ip_forward
# Monitor traffic
sudo tcpdump -i any host [ip]

πŸ§ͺ Additional Experiments

Try these optional exercises to deepen your understanding:

  1. Multiple Route Tables: Create different route tables for different subnets
  2. Route Priorities: Test overlapping routes with different specificity
  3. BGP Routes: Implement BGP routing with VPN Gateway
  4. Service Chaining: Chain multiple network virtual appliances
  5. Forced Tunneling: Route all traffic through on-premises gateway

πŸŽ“ Key Takeaways

After completing this lab, you should understand:

  • User Defined Routes (UDRs) override Azure’s default routing behavior
  • Route tables control traffic flow at the subnet level
  • Next hop types determine where traffic is forwarded
  • Effective routes show the actual routing configuration applied to NICs
  • Route precedence follows: User-defined β†’ BGP β†’ System routes
  • IP forwarding must be enabled on network virtual appliances
  • Troubleshooting routes requires systematic analysis of configuration and traffic flow

πŸ“Š Route Types and Next Hops

Next Hop Types

TypeDescriptionUse Case
Virtual Network GatewayVPN/ExpressRoute gatewayHybrid connectivity
Virtual ApplianceCustom NVAFirewall, load balancer
InternetDirect internet accessPublic services
VNet LocalWithin virtual networkInter-subnet communication
NoneDrop trafficSecurity isolation

Route Precedence

  1. User-defined routes (0-65,535 priority)
  2. BGP routes (dynamic)
  3. System routes (default Azure routing)

πŸ“š Additional Resources