Designing Virtual Networks and Subnets
This lesson explains address spaces, subnets, reserved addresses, dedicated subnets and outbound access from private subnets.
Learning outcomes
After completing this lesson, you will be able to:
- Explain how to plan non-overlapping address spaces.
- Calculate usable addresses in a subnet.
- Describe private subnets and the explicit outbound methods VMs need.
Address spaces
A VNet belongs to one region and one subscription and has one or more address spaces in CIDR notation, such as 10.10.0.0/16. Use private ranges from RFC 1918 (10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16) and plan them so that they do not overlap with on-premises networks or with other VNets that will be peered or connected, because overlapping ranges cannot be routed between. Address spaces can be added or removed later, and peered VNets must be resynchronized after a change.
Planning address spaces
Subnets
Subnets divide the address space into ranges where resources are deployed, and NSGs, route tables, NAT gateways and service endpoints are applied per subnet. Azure reserves five IP addresses in every subnet: the network address, the default gateway (.1), two addresses for Azure DNS (.2 and .3) and the broadcast address. The smallest supported IPv4 subnet is /29, which leaves three usable addresses. The table below shows usable addresses for common sizes.
| Prefix | Total addresses | Usable in Azure |
|---|---|---|
| /29 | 8 | 3 |
| /28 | 16 | 11 |
| /27 | 32 | 27 |
| /26 | 64 | 59 |
| /24 | 256 | 251 |
Several services require dedicated subnets with specific names or delegations: GatewaySubnet for VPN and ExpressRoute gateways (/27 or larger recommended), AzureBastionSubnet (/26 or larger), AzureFirewallSubnet (/26), and subnets delegated to services such as App Service VNet integration, Container Instances or Azure NetApp Files. A subnet can be resized only if no resources use the addresses that would be removed.
The following diagram shows non-overlapping address spaces and subnets for a hub, two spokes and an on-premises network.

Usable addresses
Private subnets and outbound access
Historically, VMs without a public IP reached the internet through default outbound access, an implicit public IP owned by Microsoft. Since 31 March 2026, new VNets are created with private subnets by default (the Private subnet setting), in which default outbound access is not available. VMs in them need an explicit outbound method: a NAT gateway associated with the subnet (recommended, with static outbound IPs and scale), a Standard public IP on the VM, a Standard load balancer with outbound rules, or a UDR to a firewall. Existing VNets are not changed.
Name resolution uses Azure-provided DNS (168.63.129.16) by default, which resolves Azure host names in the VNet; the VNet's DNS servers setting can point to custom DNS servers instead, and VMs pick up the change after a restart or DHCP renewal.
Outbound access from private subnets
Planning address space
A company's on-premises network uses 10.0.0.0/16. It plans a hub VNet and two spoke VNets in Azure, connected to on-premises through a VPN gateway in the hub. The hub needs a gateway subnet and a Bastion subnet; each spoke needs a web subnet for up to 50 VMs and a data subnet for up to 20 VMs. Propose address spaces.
Use non-overlapping ranges outside 10.0.0.0/16, for example hub 10.1.0.0/24 with GatewaySubnet 10.1.0.0/27 and AzureBastionSubnet 10.1.0.64/26, spoke 1 10.2.0.0/24 and spoke 2 10.3.0.0/24, each with a /26 web subnet (59 usable addresses) and a /27 data subnet (27 usable). A /27 would be too small for 50 web VMs, and reusing 10.0.x.x would overlap with on-premises.
How many usable addresses does a /28 subnet have in Azure?
Show answer
11: 16 addresses minus the 5 that Azure reserves.
Exam Tips
Remember for the exam
- Azure reserves five addresses per subnet; a /29 has three usable addresses.
- Never overlap address spaces with networks you will connect.
- New VNets use private subnets: add a NAT gateway for outbound internet.
- Gateway, Bastion and Firewall need dedicated, specially named subnets.