Azure Route Tables

MSDN Documentation - Networking Services

Understanding Azure Route Tables

Azure route tables are a core component of network routing within Azure Virtual Networks (VNet). They enable you to define custom routes that control how network traffic is directed between subnets, to the internet, or to your on-premises networks.

What are Route Tables?

A route table contains a set of rules, called routes, that are used to classify packets and direct them to a specific destination. Each subnet within an Azure VNet is associated with at most one route table. If no route table is explicitly associated with a subnet, it uses the System Route Table, which provides default routing behavior.

Key Concepts

Use Cases for Route Tables

Route tables are essential for advanced network configurations, including:

Creating and Managing Route Tables

You can create and manage route tables using the Azure portal, Azure PowerShell, or Azure CLI. When creating a route table, you can define custom routes immediately or add them later.

Example: Routing traffic through a firewall (Conceptual Azure CLI)


# Create a route table
az network route-table create --resource-group MyResourceGroup --name MyRouteTable

# Add a custom route to send all traffic to a firewall appliance
az network route-table route create --resource-group MyResourceGroup --route-table-name MyRouteTable --name ToFirewall --address-prefix 0.0.0.0/0 --next-hop-type VirtualAppliance --next-hop-ip-address 10.0.1.4

# Associate the route table with a subnet
az network vnet subnet update --resource-group MyResourceGroup --vnet-name MyVNet --name MySubnet --route-table MyRouteTable
            

Route Precedence

Azure determines the route to use based on the following precedence:

  1. User-defined routes (from route tables)
  2. System routes (default routes provided by Azure)
  3. BGP routes (propagated from on-premises devices via VPN/ExpressRoute)

If multiple user-defined routes match the destination prefix, the route with the most specific prefix (longest prefix match) is chosen.

Best Practices