LevelUpWith

Explore / Microsoft Azure Network Engineer (AZ-700) Exam Prep / Lesson 2

Lesson 2: Network Segmentation, Address Spaces and Creating a VNet

[Design and implement core networking infrastructure – IP addressing] Plan network segmentation and non-overlapping address spaces, then create a virtual network (VNet) in the portal, Azure CLI and Bicep.

Free to read, no account needed. Part of Microsoft Azure Network Engineer (AZ-700) Exam Prep.

By the end of this level you'll be able to

  • Design address spaces for hub, spoke and on-premises networks that don't overlap and leave room to grow
  • Create a VNet with several address spaces and subnets using the portal, az network vnet create and a Bicep resource
  • Work out usable addresses in a subnet, allowing for the five IP addresses Azure reserves in every subnet

Before you start

This course is independent of Microsoft. It follows Microsoft's own Study guide for Exam AZ-700, which is free on Microsoft Learn and isn't reproduced here. Microsoft gives you 100 minutes for the exam, and you need a score of 700 or greater to pass. No course can promise you a pass. Hands-on practice gives you the best chance.

This level covers the first two bullets of the guide's Design and implement IP addressing for Azure resources objective:

  • Plan and implement network segmentation and address spaces
  • Create a virtual network (VNet)

Step 1: Understand address spaces and segmentation

A VNet is a private network in one Azure region. Every VNet has one or more address spaces (also called address prefixes): CIDR blocks such as 10.1.0.0/16. You segment the VNet by cutting its address space into subnets.

Rules to remember:

  1. Each subnet must fall inside the VNet's address space.
  2. Subnets in the same VNet can't overlap each other.
  3. Address ranges use CIDR notation.
  4. A VNet can have several address spaces, and you can add, remove or change them after you create it.
  5. The smallest supported IPv4 subnet is /29. The largest is /2.

Use private RFC 1918 ranges:

  • 10.0.0.0 – 10.255.255.255 (10.0.0.0/8)
  • 172.16.0.0 – 172.31.255.255 (172.16.0.0/12)
  • 192.168.0.0 – 192.168.255.255 (192.168.0.0/16)

You can't add these ranges to a VNet: 224.0.0.0/4 (multicast), 255.255.255.255/32 (broadcast), 127.0.0.0/8 (loopback), 169.254.0.0/16 (link-local) and 168.63.129.16/32 (Azure's internal DNS, DHCP and Load Balancer health probe address).

Step 2: Design non-overlapping hub, spoke and on-premises ranges

You can only connect networks to each other if their CIDR blocks don't overlap. That applies to VNet-to-VNet links and to links with on-premises networks. Think of it like postcodes: two towns with the same postcode can't share one mail system. Get this right on day one, because renumbering a live network is painful.

Your task: write an address plan before you deploy anything. Worked example:

Network Address space Notes
On-premises (existing) 172.16.0.0/16 Ask the network team. Never guess.
Hub VNet 10.0.0.0/16 Shared services
Spoke 1 (app) 10.1.0.0/16 Production workload
Spoke 2 (dev) 10.2.0.0/16 Development
Reserved for growth 10.3.0.0 – 10.15.255.255 Future spokes and regions

Planning checklist:

  • List every existing range first: on-premises, branch offices, partner networks and other clouds.
  • Give each VNet its own block that doesn't overlap any other block.
  • Leave unused blocks between networks so each one can grow.
  • Size subnets for the future, not just for today's VM count.
  • Write the plan down and keep it up to date. It's your single source of truth.

Step 3: Calculate usable addresses

Azure reserves five IP addresses in every subnet: the first four and the last one. In 192.168.1.0/24 they are:

Address Purpose
192.168.1.0 Network address
192.168.1.1 Default gateway
192.168.1.2 and .3 Map the Azure DNS IP addresses to the VNet space
192.168.1.255 Broadcast address

Formula: usable = 2^(32 − prefix) − 5

  • /24 → 256 − 5 = 251
  • /26 → 64 − 5 = 59
  • /27 → 32 − 5 = 27
  • /29 → 8 − 5 = 3

The first address you can assign is .4. For example, 10.1.1.4 is the first usable address in 10.1.1.0/24.

Step 4: Create a VNet in the Azure portal

  1. Select Create a resource > Virtual network > Create.
  2. On Basics, choose the subscription and resource group, then enter a name (vnet-spoke1) and a region.
  3. Skip Security for now. Later levels cover those options.
  4. On IP addresses, edit the default IPv4 address space to 10.1.0.0/16. Select Add IPv4 address space and add 10.201.0.0/24.
  5. Delete or edit the default subnet. Add snet-app (10.1.1.0/24) and snet-data (10.1.2.0/24). The portal shows the size of each subnet as you type.
  6. Add Tags if you need them, then select Review + create > Create.

Step 5: Create the same VNet with Azure CLI

az group create --name rg-net --location uksouth

az network vnet create \
  --resource-group rg-net \
  --name vnet-spoke1 \
  --location uksouth \
  --address-prefixes 10.1.0.0/16 10.201.0.0/24 \
  --subnet-name snet-app \
  --subnet-prefixes 10.1.1.0/24

az network vnet subnet create \
  --resource-group rg-net \
  --vnet-name vnet-spoke1 \
  --name snet-data \
  --address-prefixes 10.1.2.0/24

Notes:

  • --address-prefixes takes a space-separated list. That's how you give a VNet more than one address space.
  • If you leave out --address-prefixes, the VNet gets 10.0.0.0/16 by default. That range may clash with your plan, so always set it.
  • To add an address space later, run az network vnet update --address-prefixes ... and list all the prefixes you want to keep.
  • Check the result: az network vnet show -g rg-net -n vnet-spoke1 --query addressSpace.

Step 6: Create the same VNet with Bicep

resource vnet 'Microsoft.Network/virtualNetworks@2025-09-01' = {
  name: 'vnet-spoke1'
  location: resourceGroup().location
  properties: {
    addressSpace: {
      addressPrefixes: [
        '10.1.0.0/16'
        '10.201.0.0/24'
      ]
    }
    subnets: [
      {
        name: 'snet-app'
        properties: { addressPrefix: '10.1.1.0/24' }
      }
      {
        name: 'snet-data'
        properties: { addressPrefix: '10.1.2.0/24' }
      }
    ]
  }
}

Deploy it with az deployment group create -g rg-net --template-file vnet.bicep. The VNet's ranges go in addressSpace.addressPrefixes, which is an array. Each subnet's range goes in properties.addressPrefix, which is a single string.

What the exam asks about this

  • Overlap scenarios: you're given on-premises and VNet ranges and asked which design lets you peer or connect them. Look for any overlapping CIDR block.
  • Usable-address maths: questions like "how many VMs fit in a /27?" Always subtract 5.
  • Reserved addresses: which address Azure reserves, or which address is the first one you can assign (.4).
  • Adding address space: you can add a new, non-overlapping prefix to an existing VNet. You don't have to recreate it.
  • Tool syntax: recognise az network vnet create --address-prefixes and the Bicep addressSpace.addressPrefixes property.

Key takeaways

  • Plan every range (hub, spokes, on-premises) before you deploy, with no overlaps and room to grow.
  • A VNet can have several address spaces, and you can change them after creation.
  • Azure reserves 5 addresses per subnet (the first four and the last), so usable = 2^(32 − prefix) − 5.
  • The smallest subnet is /29, which leaves 3 usable addresses.
  • Portal, CLI (--address-prefixes, --subnet-prefixes) and Bicep (addressPrefixes, addressPrefix) all build the same VNet.

A 6-question knowledge check follows this lesson in the app, free and without an account.

Keep going: levels 3 and 4 are free

Create a free account to open the next two levels, save your progress and pick up where you left off. No card needed.

Next: Level 3, Subnetting for Services, Delegation and Shared Subnets.

Create a free account →See the whole course

More like this

  • Microsoft Azure AI Fundamentals (AI-901) Exam Prep

    Get ready for Microsoft AI-901 by learning every skill in the April 15, 2026 study guide. You will cover responsible AI, how generative models work and the mai…

    Exam prep · AI-901 · AI & Agents · Capable · 18 levels · 4 free · Professionally curated by levelupwith.com

  • Microsoft Cloud and AI Security Engineer (SC-500) Exam Prep

    Get ready to pass Microsoft SC-500 (Implementing End-to-End Security Controls for Cloud and AI Workloads) by learning every bullet in Microsoft's study guide.…

    Exam prep · SC-500 · IT Support, Networking & Security · Expert · 60 levels · 4 free · Professionally curated by levelupwith.com

  • Microsoft Azure Fundamentals (AZ-900) Exam Prep

    Learn to pick the cloud model, service type or Azure service that fits a scenario and explain why the alternatives do not, across every skill in the 20 July 20…

    Exam prep · AZ-900 · Cloud & Compute · Capable · 17 levels · 4 free · Professionally curated by levelupwith.com

  • Microsoft Azure Administrator (AZ-104) Exam Prep

    Work through every bullet of the AZ-104 skills measured as of April 17, 2026, learning each task in the Azure portal, Azure CLI, PowerShell, and ARM templates…

    Exam prep · AZ-104 · Cloud & Compute · Expert · 60 levels · 4 free · Professionally curated by levelupwith.com

  • Support Pro: Helping Users Move to Microsoft 365

    Help users get through a move from Google Workspace to Microsoft 365, from the week before cutover to the first tickets afterwards. You will learn what moves a…

    Course · Microsoft · Suite Support Pro: Configure and Fix · Expert · 40 levels · 4 free · Professionally curated by levelupwith.com

  • Microsoft 365 Support Pro: Copilot for End Users

    Learn to work out which Copilot a user actually has, and to fix the everyday Copilot tickets: missing buttons, licence and sign-in problems, files Copilot can'…

    Course · Microsoft · Suite Support Pro: Configure and Fix · Expert · 36 levels · 4 free · Professionally curated by levelupwith.com