Virtual Networks Routes Overview

This document provides a comprehensive overview of route tables and their role in defining traffic flow within Azure Virtual Networks.

Understanding Route Tables

Route tables in Azure Virtual Networks (VNet) allow you to override the default system routes. By default, Azure automatically creates routes for subnets within a VNet. However, for more complex network topologies and traffic control, you can create custom route tables.

Key Concepts

How Route Tables Work

When a virtual machine (VM) or other resource within a subnet sends network traffic, Azure checks the associated route table for a matching route. If a match is found, Azure forwards the traffic to the specified next hop. If no custom route matches, Azure uses its default system routes.

Next Hop Types

The following are common next hop types you can define in a route:

Creating and Managing Route Tables

Route tables can be created and managed through the Azure portal, Azure PowerShell, or Azure CLI. When you create a route table, you associate it with one or more subnets.

Steps to Create a Route Table (Azure Portal)

  1. Navigate to the Azure portal.
  2. Search for "Route Tables" and select it.
  3. Click "Create".
  4. Fill in the required details: Subscription, Resource Group, Name, Region.
  5. Click "Review + create" and then "Create".
  6. Once created, select the route table and go to "Routes" to add custom routes.
  7. Go to "Subnets" to associate the route table with your desired subnets.

Use Cases for Custom Routes

Custom routes are essential for implementing various network architectures:

Important Note on Route Propagation

Routes learned from BGP (Border Gateway Protocol) via VPN Gateway or ExpressRoute are automatically propagated to the subnets associated with the route table. Custom routes you define take precedence over system routes but are generally overridden by BGP routes unless specifically configured otherwise.

Route Table Limitations

Example: Forcing Traffic Through a Firewall

Consider a scenario where you want to inspect all inbound and outbound traffic from a specific subnet. You can achieve this by:

  1. Deploying a Network Virtual Appliance (NVA) like an Azure Firewall or a third-party firewall.
  2. Creating a route table.
  3. Adding a route with the address prefix 0.0.0.0/0 (representing all internet traffic).
  4. Setting the next hop to the NVA.
  5. Associating this route table with the subnet containing your resources.

This ensures that all traffic originating from or destined for that subnet is first routed to the NVA for inspection before being sent to its final destination.

Next Hop Type Details
Type Description
Virtual Appliance Traffic is sent to an IP address of a network virtual appliance in the VNet.
Virtual Network Gateway Traffic is sent to a Virtual Network Gateway for VPN or ExpressRoute.
Internet Traffic is routed to the internet.
None Traffic is dropped.
Virtual Network Traffic is routed to another subnet within the same VNet.

Performance Considerations

While route tables offer flexibility, be mindful of the performance impact when routing traffic through NVAs. Ensure your NVAs are sized appropriately to handle the expected network load.