Create a route table and a custom route

Azure Portal, Hands On10 minutesFreeSteps checked 23 October 2026By Cloud Hands On

In this task you'll create a route table and attach it to a subnet.

Azure routes traffic between subnets, to the internet and to connected networks for you, using built-in system routes. A route table lets you add your own routes that override them for the subnets it's attached to.

The usual reason is to send traffic through a firewall or another inspection device (a network virtual appliance) instead of straight out. Each route has a destination address range and a next hop: where matching traffic goes next.

Example. Ironbridge Payments sends all internet traffic from its app subnet through a firewall at 10.0.100.4. A route table with the route 0.0.0.0/0, next hop Virtual appliance 10.0.100.4, is attached to the subnet.

Before you start

You need: Network Contributor or Contributor. Time: 10 minutes.

Where to look

  1. Home
  2. Route tables
  3. + Create

Steps

  1. You need vnet-practice from the Create a virtual network and subnets task. Search Route tables and select + Create.
  2. Choose rg-portal-practice, the same region as the network, and the name rt-practice. Leave Propagate gateway routes on Yes and Enable peering routes (Preview) ticked. Select Review + create, then Create.Check the resource group: the form may start on another group, such as DefaultResourceGroup-SUK.
  3. Open rt-practice, select Routes, then + Add. Name it to-internet-blocked, set Destination type to IP Addresses, the range to 0.0.0.0/0 and Next hop type to None. Select Add.Next hop None drops the traffic. It's a safe route to practise with, because nothing is sent anywhere.
  4. Select Subnets, then + Associate. Pick vnet-practice and one of its subnets, then OK.From now on, VMs in that subnet can't reach the internet.
  5. If you have a VM in that subnet, open its network interface and select Effective routes to see your route listed as User, above the system routes.
  6. Dissociate the subnet when you've finished: in Subnets, select the row's ... menu, then Dissociate and Yes.

Commands

# Create a route table and a route that drops internet traffic
az network route-table create --resource-group rg-portal-practice --name rt-practice
az network route-table route create --resource-group rg-portal-practice --route-table-name rt-practice \
  --name to-internet-blocked --address-prefix 0.0.0.0/0 --next-hop-type None

# Attach it to a subnet
az network vnet subnet update --resource-group rg-portal-practice --vnet-name vnet-practice \
  --name <subnet name> --route-table rt-practice

Watch out for

Cost
Route tables and routes are free.
Security
A wrong route can cut a subnet off, or send its traffic around your firewall. Test with Effective routes and Next hop in Network Watcher.
Common mistakes
Sending 0.0.0.0/0 to an appliance that isn't set up to forward traffic, so everything stops. Attaching the table to the wrong subnet. Forgetting that the table must be in the same region and subscription as the network.

Clean up

  1. Route tables
  2. rt-practice
  3. Delete

Dissociate any subnets, then delete rt-practice, or delete the resource group at the end of the networking section.

Words to know

System route
A route Azure creates for you, such as between subnets in one network.
User-defined route (UDR)
A route you add in a route table. It wins over a system route for the same range.
Next hop
Where matching traffic is sent: Virtual network gateway, Virtual network, Internet, Virtual appliance or None.
0.0.0.0/0
Every address. A route for it catches all traffic that no narrower route matches.

Tick off each step and track your progress in the guide.

Open this task in Azure Portal, Hands On

Keep going