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.
π Please sign in to launch lab.
ποΈ Pre-Provisioned Environment
The following Azure resources have been pre-deployed with intentional misconfigurations:
Resource Overview
Resource Type | Resource Name | Configuration | Purpose |
---|---|---|---|
Resource Group | StaticRoute-Lab-RG | Contains all lab resources | Logical container |
Virtual Network | RouteLabVNet | Address space: 10.0.0.0/16 | Network foundation |
App Subnet | AppSubnet | Range: 10.0.1.0/24 | Application tier |
Gateway Subnet | GatewaySubnet | Range: 10.0.2.0/24 | Network gateway tier |
App VM | AppVM | Windows Server 2019 | Application server |
Gateway VM | GatewayVM | Ubuntu with IP forwarding | Network virtual appliance |
Route Table | AppSubnet-RouteTable | Misconfigured routes | Custom 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
VM | Private IP | Public IP | Operating System | Role |
---|---|---|---|---|
AppVM | 10.0.1.4 | Dynamic | Windows Server 2019 | Application server |
GatewayVM | 10.0.2.4 | Dynamic | Ubuntu 20.04 LTS | Network virtual appliance |
π Lab Tasks
Task 1: Verify Connectivity Issue
Step 1: Connect to Application VM
- Navigate to StaticRoute-Lab-RG resource group
- Click on AppVM
- Click Connect β RDP
- Use credentials:
- Username:
azureuser
- Password:
LabPassword123!
- Username:
Step 2: Test Network Connectivity
Once connected to AppVM, open Command Prompt and run:
# Test connectivity to GatewayVMping 10.0.2.4
# Test internet connectivity (should fail due to routing)ping 8.8.8.8
# Test DNS resolutionnslookup google.com
# Check local routing tableroute 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
- In Azure Portal, go to StaticRoute-Lab-RG
- Click on AppSubnet-RouteTable
- In the left menu, click Routes
Step 2: Analyze Current Routes
Examine the configured routes:
Route Name | Address Prefix | Next Hop Type | Next Hop IP | Status |
---|---|---|---|---|
Default-Route | 0.0.0.0/0 | Virtual Appliance | 10.0.2.100 | β Incorrect |
Local-VNet | 10.0.0.0/16 | VNet 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
- Click Subnets in the left menu
- Verify: AppSubnet is associated with this route table
- Confirm: Route table is actively applied
Task 3: Use Effective Routes for Diagnosis
Step 1: View Effective Routes
- Navigate to AppVM
- Click Networking in the left menu
- Click on the Network Interface name
- Click Effective routes
Step 2: Analyze Route Evaluation
Review the effective routes table:
Source | Address Prefix | Next Hop Type | Next Hop IP | State |
---|---|---|---|---|
User | 0.0.0.0/0 | VirtualAppliance | 10.0.2.100 | Active |
Default | 10.0.0.0/16 | VNet | - | Active |
Step 3: Understand Route Precedence
Route evaluation order:
- User-defined routes (highest priority)
- BGP routes (dynamic routing)
- 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
- Navigate to GatewayVM
- Click Networking
- Copy the Private IP address:
10.0.2.4
Step 2: Update Route Table
- Go back to AppSubnet-RouteTable
- Click Routes
- Click on the Default-Route (or problematic route)
- Edit the route:
Setting | Current Value | Correct Value |
---|---|---|
Route name | Default-Route | Default-Route |
Address prefix | 0.0.0.0/0 | 0.0.0.0/0 |
Next hop type | Virtual appliance | Virtual appliance |
Next hop address | 10.0.2.100 | 10.0.2.4 |
- Click Save
Step 3: Verify Route Update
- Refresh the Routes page
- Confirm: Next hop IP now shows
10.0.2.4
- 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:
# Wait for route propagationtimeout /t 60
# Test connectivity to GatewayVMping 10.0.2.4
# Test internet connectivityping 8.8.8.8
# Test DNS resolutionnslookup google.com
# Verify routing tableroute 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
- Go back to AppVM β Networking β Network Interface
- Click Effective routes
- 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:
# Trace route to internettracert 8.8.8.8
# Test specific port connectivitytelnet 8.8.8.8 53
# Check ARP tablearp -a
Step 2: Test from Gateway VM
- Connect to GatewayVM via SSH:
ssh azureuser@[GatewayVM-Public-IP]# Password: LabPassword123!
- Verify IP forwarding and routing:
# Check IP forwarding statuscat /proc/sys/net/ipv4/ip_forward
# View routing tableip route show
# Monitor traffic (optional)sudo tcpdump -i any icmp
Step 3: Create Additional Routes (Optional)
- In AppSubnet-RouteTable, click + Add
- Create a more specific route:
Setting | Value | Purpose |
---|---|---|
Route name | Specific-Route | Test route precedence |
Address prefix | 8.8.8.0/24 | Google DNS subnet |
Next hop type | Internet | Direct internet access |
- Test: Compare routing behavior for different destinations
π§ Troubleshooting Guide
Common UDR Issues and Solutions
Issue | Symptoms | Diagnosis | Solution |
---|---|---|---|
Wrong next hop IP | Traffic not reaching destination | Check effective routes | Update route with correct IP |
Route not propagated | Changes not taking effect | Wait 1-2 minutes | Refresh and verify |
Conflicting routes | Unpredictable routing | Review route precedence | Adjust route priorities |
NVA not forwarding | Traffic reaches NVA but stops | Check IP forwarding | Enable forwarding on NVA |
Route table not associated | Custom routes ignored | Check subnet association | Associate route table |
Route Troubleshooting Commands
Windows (AppVM):
# View local routing tableroute print
# Trace network pathtracert [destination]
# Test connectivityping [destination]telnet [destination] [port]
Linux (GatewayVM):
# View routing tableip route show
# Check IP forwardingcat /proc/sys/net/ipv4/ip_forward
# Monitor trafficsudo tcpdump -i any host [ip]
π§ͺ Additional Experiments
Try these optional exercises to deepen your understanding:
- Multiple Route Tables: Create different route tables for different subnets
- Route Priorities: Test overlapping routes with different specificity
- BGP Routes: Implement BGP routing with VPN Gateway
- Service Chaining: Chain multiple network virtual appliances
- 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
Type | Description | Use Case |
---|---|---|
Virtual Network Gateway | VPN/ExpressRoute gateway | Hybrid connectivity |
Virtual Appliance | Custom NVA | Firewall, load balancer |
Internet | Direct internet access | Public services |
VNet Local | Within virtual network | Inter-subnet communication |
None | Drop traffic | Security isolation |
Route Precedence
- User-defined routes (0-65,535 priority)
- BGP routes (dynamic)
- System routes (default Azure routing)