Carve subnets from an address space
Your tasks
- Add subnet-api to vnet-app on 10.1.3.0/26
The API team needs a subnet inside vnet-app. Create subnet-api on 10.1.3.0/26 and work out how many VMs it can actually hold.
You'll learn
Subnets and the five reserved addresses
Check the size of a /26 first.
cidr 10.1.3.0/26Create the subnet inside vnet-app.
az network vnet subnet create -g rg-lab --vnet-name vnet-app --name subnet-api --address-prefixes 10.1.3.0/26What's this?
Adds a subnet: a range carved out of the virtual network's address space.
-gthe resource group the resources live in--vnet-namethe virtual network--namethe name of the thing to look at or change
--vnet-name vnet-appthe VNet the subnet belongs to--name subnet-apithe subnet's name--address-prefixes 10.1.3.0/26the subnet's range, inside the VNet's space
Answer below. Remember which addresses Azure keeps.
Sources on Microsoft Learn (2)
0/1 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
- 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.
Goals 0/3
Cloud Shell · bashVMsrg-lab · eastus2
cloudshell:~$