Beginner · Routing · 12 of 15

Drop traffic with a route table

Your tasks
  • Give subnet-web a route table with a None route for 10.1.9.0/24
  • Stop vm-web from reaching vm-old

subnet-old (10.1.9.0/24, home of vm-old at 10.1.9.4) is being retired, and nothing in subnet-web should send it traffic anymore. Instead of touching every NSG, drop the traffic with a route: create the route table rt-web, add a route for 10.1.9.0/24 with next hop None, and associate it with subnet-web, where vm-web lives.

You'll learn
User-defined routes
  1. Create the route table.

    az network route-table create -g rg-lab --name rt-web
    What's this?

    Creates a route table. Its routes only apply to subnets you attach it to.

    • -g the resource group the resources live in
    • --name the name of the thing to look at or change
  2. Add a route that drops traffic to subnet-old.

    az network route-table route create -g rg-lab --route-table-name rt-web --name drop-old --address-prefix 10.1.9.0/24 --next-hop-type None
    What's this?

    Adds or changes one route in a route table: traffic for this address range goes to this next hop.

    • -g the resource group the resources live in
    • --route-table-name the route table the route is in
    • --name the name of the thing to look at or change
    • --address-prefix the address range this route is for
    • --next-hop-type where matching traffic goes, such as VirtualAppliance
    • --address-prefix 10.1.9.0/24 the destination this route covers
    • --next-hop-type None drop the traffic
  3. Associate the route table with subnet-web.

    az network vnet subnet update -g rg-lab --vnet-name vnet-app --name subnet-web --route-table rt-web
    What's this?

    Changes a subnet's settings, such as which NSG or route table is attached to it.

    • -g the resource group the resources live in
    • --vnet-name the virtual network
    • --name the name of the thing to look at or change
  4. Look at vm-web's effective routes. Find both routes that contain 10.1.9.4.

    az network nic show-effective-route-table -g rg-lab --name vm-web-nic -o table
    What's this?

    Lists every route that applies to a VM's network interface: system routes, gateway routes and your route tables, and which are active.

    • -g the resource group the resources live in
    • --name the name of the thing to look at or change
  5. Answer the question below.

    System route
    A route Azure adds for you, such as one for the network's own address space.
    Prefix
    An address range written as start/bits, like 10.1.0.0/16. The number after the slash is how many leading bits are fixed.
Sources on Microsoft Learn (2)
0/3 changes
Network map
?
  • Resource group, the outer dashed frame
  • Virtual network, with its address space top right
  • Subnet, with range and usable IPs (5 reserved)
  • Network security group. A small shield on a VM's NIC means the NIC has one too
  • Route table on the subnet
  • NICVM Appliance Private endpoint
  • Peering Connected Initiated or access off
  • Goal working Goal broken, X marks where it stops
  • Private DNS zone, dotted lines go to linked VNets
  • Orange pulse: what your last command changed. Drag to pan, Ctrl and scroll to zoom.
Resource grouprg-labvnet-app: tap to inspectVirtual networkvnet-app10.1.0.0/16subnet-web: tap to inspectsubnet-web10.1.1.0/24 · 251 usablevm-web 10.1.1.4: tap to inspectNICvm-web10.1.1.4subnet-old: tap to inspectsubnet-old10.1.9.0/24 · 251 usablevm-old 10.1.9.4: tap to inspectNICvm-old10.1.9.4:443 ✗
  • vm-web → vm-old:443should stay blocked: open, but it should be blocked
Goals 0/3
Cloud Shell · bashVMsrg-lab · eastus2
cloudshell:~$