Drop traffic with a route table
- 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.
Create the route table.
az network route-table create -g rg-lab --name rt-webWhat's this?
Creates a route table. Its routes only apply to subnets you attach it to.
-gthe resource group the resources live in--namethe name of the thing to look at or change
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 NoneWhat's this?
Adds or changes one route in a route table: traffic for this address range goes to this next hop.
-gthe resource group the resources live in--route-table-namethe route table the route is in--namethe name of the thing to look at or change--address-prefixthe address range this route is for--next-hop-typewhere matching traffic goes, such as VirtualAppliance
--address-prefix 10.1.9.0/24the destination this route covers--next-hop-type Nonedrop the traffic
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-webWhat's this?
Changes a subnet's settings, such as which NSG or route table is attached to it.
-gthe resource group the resources live in--vnet-namethe virtual network--namethe name of the thing to look at or change
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 tableWhat'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.
-gthe resource group the resources live in--namethe name of the thing to look at or change
Answer the question below.
Sources on Microsoft Learn (2)
?
- 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
- VM 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.
vm-web → vm-old:443should stay blocked: open, but it should be blocked