Worked example · Azure VNet · hub and spokes

Azure Hub-Spoke Subnet Plan

A hub VNet with the reserved gateway and firewall subnets plus shared services, and a spoke template for application and data tiers, sized under Azure reservations.

Hub VNet 10.0.0.0/16

Azure rule: 5 reserved per subnet, minimum /29

parent 10.0.0.0/16 subnets 3 allocated 352 of 65,536 (0.5%) free 65,184

Largest first: SharedServices takes the first /24 (256 addresses), so every smaller block that follows starts on a multiple of its own size with no gaps.

NameHostsSubnetNetmaskUsable rangeBroadcastUsableUnused
SharedServices20010.0.0.0/24255.255.255.010.0.0.4 – 10.0.0.25410.0.0.25525151
AzureFirewallSubnet5910.0.1.0/26255.255.255.19210.0.1.4 – 10.0.1.6210.0.1.63590
GatewaySubnet2710.0.1.64/27255.255.255.22410.0.1.68 – 10.0.1.9410.0.1.95270

Free blocks: 10.0.1.96/27 10.0.1.128/25 10.0.2.0/23 10.0.4.0/22 10.0.8.0/21 10.0.16.0/20 10.0.32.0/19 10.0.64.0/18 10.0.128.0/17

Spoke VNet 10.1.0.0/16

repeat with 10.2.0.0/16 for the second spoke

parent 10.1.0.0/16 subnets 2 allocated 384 of 65,536 (0.5%) free 65,152

Largest first: app takes the first /24 (256 addresses), so every smaller block that follows starts on a multiple of its own size with no gaps.

NameHostsSubnetNetmaskUsable rangeBroadcastUsableUnused
app20010.1.0.0/24255.255.255.010.1.0.4 – 10.1.0.25410.1.0.25525151
data10010.1.1.0/25255.255.255.12810.1.1.4 – 10.1.1.12610.1.1.12712323

Free blocks: 10.1.1.128/25 10.1.2.0/23 10.1.4.0/22 10.1.8.0/21 10.1.16.0/20 10.1.32.0/19 10.1.64.0/18 10.1.128.0/17

Why this layout

Inspect a finished subnet in the subnet calculator, or check that the three VNets cannot collide with the overlap checker. The AWS version of this exercise is the three-tier VPC example.

Questions

Why is the gateway subnet a /27?

Azure requires a subnet named exactly GatewaySubnet for a VPN or ExpressRoute gateway, and recommends /27 or larger so the gateway can scale. A /27 has 27 usable addresses after Azure reserves five, which is the request this plan gives it.

Why does the firewall subnet use a /26?

AzureFirewallSubnet is the reserved name for Azure Firewall, and /26 is the recommended size so the firewall can scale with traffic. A /26 leaves 59 usable addresses under Azure reservations.

Why do the spoke VNets use different address ranges?

VNet peering requires non-overlapping address space. The hub uses 10.0.0.0/16, the first spoke 10.1.0.0/16 and the second 10.2.0.0/16, so every spoke can peer with the hub and be summarized with one route.

How many addresses does Azure reserve in a subnet?

Azure reserves the first four addresses and the last one in every subnet, the same five as AWS: network, default gateway, two for DNS, and broadcast. The smallest subnet Azure allows is /29, and the planner enforces both bounds in Azure mode.