Add address space to a VNet
Your tasks
- Add 10.1.1.0/24 to vnet-app, keeping 10.1.0.0/24
- Create subnet-data on 10.1.1.0/24
vnet-app was sized tightly: its 10.1.0.0/24 is already split between subnet-web and subnet-app. The data team needs a new /24 called subnet-data. Give vnet-app a second address range, 10.1.1.0/24, and carve subnet-data from it.
You'll learn
More than one address range
Look at the address space and the subnets that fill it.
az network vnet show -g rg-lab --name vnet-app --query addressSpace.addressPrefixesWhat's this?
Shows virtual networks: their address space and subnets.
-gthe resource group the resources live in--namethe name of the thing to look at or change
Give the VNet both ranges: the one it has, and the new one.
az network vnet update -g rg-lab --name vnet-app --address-prefixes 10.1.0.0/24 10.1.1.0/24What's this?
Changes a virtual network, such as its address space or the DNS servers its VMs use.
-gthe resource group the resources live in--namethe name of the thing to look at or change
--address-prefixesthe full list of ranges, existing and new, separated by spaces
Create subnet-data in the new range.
az network vnet subnet create -g rg-lab --vnet-name vnet-app --name subnet-data --address-prefixes 10.1.1.0/24What'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
Answer the question below: does --address-prefixes add to the list or replace it?
0/2 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:~$