Beginner · Foundations · 5 of 15

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
  1. Look at the address space and the subnets that fill it.

    az network vnet show -g rg-lab --name vnet-app --query addressSpace.addressPrefixes
    What's this?

    Shows virtual networks: their address space and subnets.

    • -g the resource group the resources live in
    • --name the name of the thing to look at or change
  2. 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/24
    What's this?

    Changes a virtual network, such as its address space or the DNS servers its VMs use.

    • -g the resource group the resources live in
    • --name the name of the thing to look at or change
    • --address-prefixes the full list of ranges, existing and new, separated by spaces
  3. 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/24
    What's this?

    Adds a subnet: a range carved out of the virtual network's address space.

    • -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. Answer the question below: does --address-prefixes add to the list or replace it?

    --address-prefixes
    The flag that sets a virtual network's address ranges.
Sources on Microsoft Learn (2)
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
  • 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/24subnet-web: tap to inspectsubnet-web10.1.0.0/25 · 123 usablevm-web 10.1.0.4: tap to inspectNICvm-web10.1.0.4subnet-app: tap to inspectsubnet-app10.1.0.128/25 · 123 usable
Goals 0/3
Cloud Shell · bashVMsrg-lab · eastus2
cloudshell:~$