Domain 4 of 5 · Chapter 1 of 3

Virtual Networks

VNets and subnets: address space and reserved IPs

Hand a /29 subnet to the exam's favorite trap stem and the answer is 3 VMs, not 6: Azure reserves five addresses in every subnet, so a /24 yields 251 usable hosts and a /29 only 3. The address plan is the foundation every other VNet topic builds on (peering, public IPs, user-defined routes, connectivity troubleshooting all assume a correctly sized space), so it is where this page starts.

An Azure virtual network (VNet)[1] is a logically isolated private network you define inside a single Azure region and a single subscription. You give it an address space (one or more private CIDR ranges such as 10.0.0.0/16) and it automatically spans every availability zone in that region, so you never carve a VNet up by zone (VNets and availability zones[1]). The VNet itself is free; you pay only for the resources inside it.

Subnets and the five reserved addresses

You partition the address space into subnets, each a sub-CIDR of the VNet range (for example 10.0.0.0/24 inside 10.0.0.0/16). Azure reserves five addresses in every subnet, which is the most-missed sizing fact on the exam (subnet reservations[2]):

Address Reserved for
x.x.x.0 Network address
x.x.x.1 Azure default gateway
x.x.x.2 and x.x.x.3 Azure-mapped DNS (maps the platform DNS to the VNet space)
x.x.x.255 (last) Network broadcast address

So a /24 (256 addresses) gives 251 usable host IPs, not 256, and the smallest usable subnet is a /29 (8 addresses minus the 5 reserved leaves 3 usable). A common trap stem hands you a /29 and asks how many VMs you can place: the answer is 3, not 6.

Default behavior you get for free

Three behaviors are on by default and require no configuration. First, all subnets in a VNet route to each other. Azure creates a system route so subnet-to-subnet traffic just works (you add network security groups, covered in the Network Security sibling page, only to restrict it). Second, all resources can reach the internet outbound via an Azure-assigned ephemeral IP, even with no public IP attached. Third, the address space is fully editable after creation: you can add, resize, or remove ranges later (with a peer sync step if the VNet is peered). Subnet delegation, handing a subnet to an Azure PaaS service such as Azure SQL Managed Instance or App Service so the service can inject its instances and manage subnet settings, is configured per subnet and reserves that subnet for the delegated service.

VNet address spacee.g. 10.0.0.0/16Subnet 10.0.0.0/24251 usable host IPsSubnet 10.0.1.0/24251 usable host IPs5 addresses reserved in EVERY subnet.0 network  ·  .1 default gateway  ·  .2 + .3 Azure DNS  ·  .last broadcastsmallest usable subnet = /29 (3 usable IPs)
A VNet's address space splits into subnets; Azure reserves five host IPs in each (subnet addressing).

VNet peering: regional, global, and non-transitive

Peering is the one VNet-to-VNet primitive, and a single property of it, non-transitivity, drives most of its exam questions; the topology figure below shows that property at a glance. A spoke peered to a hub does not reach the hub's other peers.

Virtual network peering[3] joins two VNets so their resources communicate by private IP, as though they were one network. The traffic stays entirely on the Microsoft backbone, no public internet, no gateway, and no encryption are involved, giving same-region latency equal to intra-VNet latency. There are two flavors, distinguished only by geography:

  • Virtual network peering (regional) connects two VNets in the same Azure region.
  • Global virtual network peering connects two VNets in different regions.

Both can span subscriptions and Microsoft Entra (formerly Azure Active Directory) tenants, both carry a nominal ingress/egress data charge, and creating a peering causes no downtime to either VNet.

Non-transitive: the rule everything else follows

Peering is non-transitive. If VNet A is peered to hub H, and H is peered to VNet B, A still cannot reach B: there is no peering between A and B, and traffic does not hop through H automatically. This is the defining constraint of a hub-and-spoke topology, and the exam tests it relentlessly. To make spokes reach each other (or reach on-premises through the hub), you must add a routing element in the hub:

  • Deploy a network virtual appliance (NVA) or firewall in the hub and steer spoke traffic to it with a user-defined route (covered in the next section). This pattern is called service chaining: the UDR's next hop is the appliance's private IP, and the appliance forwards between spokes.
  • Or use Azure Virtual Network Manager or Azure Virtual WAN to manage transitive connectivity at scale.

Peered VNets must also have non-overlapping address spaces. You cannot peer two 10.0.0.0/16 VNets; re-IP or resize one first.

Gateway transit: sharing one gateway across spokes

A VNet can have at most one gateway, so deploying a VPN or ExpressRoute gateway in every spoke is wasteful. Gateway transit lets spokes borrow the hub's gateway. It is a per-peering setting configured on both ends: on the hub side you enable Allow gateway transit, and on the spoke side you enable Use remote gateways (gateway transit[3]). A spoke that uses a remote gateway must not have its own gateway. Gateway transit works on both regional and global peering. The reconciling cost note: traffic the spoke sends through the hub's gateway is billed as peering ingress/egress on the spoke, the Microsoft documentation was corrected to state this explicitly, so don't assume transit traffic is free on the spoke side.

Hub VNet (H)central peering pointSpoke VNet Apeered to hubSpoke VNet Bpeered to hubpeeringpeeringA ✗ Bnon-transitive: no direct A-to-B pathTo connect spokes: NVA/firewall in hub + user-defined routeservice chaining, or Azure Virtual Network Manager / Virtual WAN
Peering is non-transitive: A peers the hub, the hub peers B, but A still can't reach B without hub routing.

Public IP addresses: Standard SKU, static, secure by default

A VNet already gives outbound internet access for free; a public IP is the separate resource you attach when you need a stable, inbound-reachable address.

A public IP address[4] is its own Azure resource with its own properties, which you associate with a NIC (on a VM), a public load balancer, a VPN/ExpressRoute gateway, a NAT gateway, Azure Firewall, or a Bastion host. You need one for inbound internet connectivity; outbound already works through an Azure-assigned ephemeral address, so a public IP is about being reachable, not about reaching out.

One SKU that matters: Standard

The Basic SKU was retired on September 30, 2025, so every new design uses the Standard SKU (public IP SKUs[4]). Standard differs from the retired Basic in three exam-relevant ways, and each is a recognizable question stem:

Property Standard SKU Basic SKU (retired)
Allocation Static only Dynamic or static (IPv4)
Security Secure by default (closed to inbound until an NSG allows it) Open by default
Availability zones Zone-redundant by default in zone-enabled regions Not supported (non-zonal)

Static allocation means the IP is assigned at creation and never changes until you delete the resource (IP assignment[4]). This matters whenever something external depends on the address not changing: firewall allow-lists, DNS A records, IP-based security models, or TLS/SSL certificates bound to the IP. (Basic's dynamic IPv4 could change when a VM was stopped and started, the source of a classic "why did my IP change?" stem.)

Secure by default is the most common Standard-SKU surprise: attaching a Standard public IP to a VM does not open inbound traffic. The resource is closed until a network security group[5] rule explicitly allows it. If a VM with a Standard public IP is unreachable, a missing NSG allow rule is the first thing to check.

Zone redundancy means a Standard IP is created across multiple zones and survives any single-zone failure, in regions that have availability zones. A public IP's availability-zone setting is fixed at creation and cannot be changed later. (Deeper load-balancer behavior, internal vs. public, the frontend IP configuration, lives in the DNS and Load Balancing sibling page.)

User-defined routes and route selection

Azure already routes everything by a system route table it builds and maintains for each subnet. You write a user-defined route only to override a specific system route. Building on the addressing and peering model above, this is how Azure decides where a packet goes and how you override that decision.

System routes you get automatically

Every subnet receives system routes[6] you cannot delete: a Virtual network route for intra-VNet traffic, a 0.0.0.0/0 → Internet default route, and None routes that drop the RFC 1918 private ranges (10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16) plus 100.64.0.0/10. Azure adds more optional system routes as you enable features: a Virtual network peering route per peered range, and Virtual network gateway routes for gateway/BGP prefixes.

User-defined routes (UDRs)

To change routing, you don't edit system routes. You create a route table, add user-defined routes, and associate the table to a subnet. Each subnet has zero or one route table. A UDR's next hop is one of exactly five types (next hop types[6]):

Next hop type Use
Virtual appliance Send traffic to an NVA/firewall (you also give its private IP)
Virtual network gateway Send traffic to the VPN gateway (forced tunneling)
Virtual network Override default intra-VNet routing
Internet Force traffic to the internet
None Drop the traffic

You cannot set Virtual network peering or service endpoint as a UDR next hop. Azure creates those route types only when you configure the feature.

Forced tunneling

The canonical UDR is forced tunneling: a route for 0.0.0.0/0 whose next hop is a firewall appliance or the VPN/ExpressRoute gateway, associated to a subnet so that all outbound traffic is sent on-premises (or through the NVA) for inspection instead of going directly to the internet (0.0.0.0/0 route[6]). This is how you override Azure's default internet route.

How Azure picks a route (two-step)

Route selection is longest-prefix-match first, source priority second, and getting the order right answers most routing questions:

  1. Longest prefix match. For 10.0.0.5, a route for 10.0.0.0/24 beats one for 10.0.0.0/16 because it is more specific, regardless of source.
  2. Source priority, only on an exact prefix tie. When two routes share the same prefix, the order is User-defined route → BGP route → system route. This is exactly why a UDR for 0.0.0.0/0 overrides the default internet route: same prefix, UDR wins.

Reconcile the one apparent exception: routes for the VNet itself, VNet peerings, and service endpoints are preferred system routes you cannot override, even with a more-specific prefix or a UDR. A service-endpoint route always wins for that service's addresses.

Outbound packet leaves subnetmatch against route table1. Longest prefix match wins/24 beats /16, regardless of source2. Prefixes tie? Source priorityUDR > BGP > system routeUser-defined routeyour route table overrideBGP routefrom on-prem gatewaySystem routeAzure defaultException: VNet, peering, and service-endpoint routes can't be overridden
How Azure picks a route: longest prefix first, then source priority; per Azure traffic routing.

Troubleshooting connectivity: effective routes and IP Flow Verify

When traffic doesn't flow, the question is always one of two things, and each has its own Azure diagnostic: is the packet being routed somewhere wrong, or is it being blocked? The decision tree below maps each symptom to the tool that answers it. Reading the routing rules above is enough to use both.

Effective routes: what is actually winning

The routes you author are not the routes that run. Azure merges your UDRs with the system and BGP routes, applies the longest-prefix and source-priority rules from the previous section, and the result is the effective routes on a NIC. You read them per network interface (Portal: the NIC's Effective routes, or az network nic show-effective-route-table) to see the final, evaluated table and which next hop a given destination resolves to (diagnose routing[7]). This is also how you confirm a peering exists: if VNet peering is active, every subnet shows routes with next hop type Virtual network peering for each peered address range. A missing peering route in the effective table is your evidence the peering isn't there or isn't synced.

IP Flow Verify: allowed or denied, and by which rule

Effective routes tell you where a packet would go; they don't tell you whether a security rule blocks it. IP Flow Verify[8], a feature of Azure Network Watcher, takes a 5-tuple (direction (inbound/outbound), protocol, local IP/port, remote IP/port) and tells you whether the traffic is Allowed or Denied, and crucially which network security group rule made the decision (IP Flow Verify[8]). If the verdict is Denied, it names the blocking rule so you fix the right NSG.

Which tool for which symptom

Use the two together, and pick by symptom:

  • "Traffic goes to the wrong place / a peer is unreachable" → a routing problem. Read effective routes to see which route wins and whether the peering/UDR route is present.
  • "Traffic is dropped / connection refused" → likely a security problem. Run IP Flow Verify to confirm allow/deny and find the responsible NSG rule.
  • "End-to-end path is failing and I don't know where" → use Network Watcher Connection Monitor / connection troubleshoot to test the full hop-by-hop path between two endpoints.

The deeper NSG rule mechanics, priority numbers, default rules, application security groups, belong to the Network Security sibling page; here the point is only that IP Flow Verify is the tool that turns a vague "it's blocked" into a named rule.

Connection is failingwhich symptom?Goes to wrong placerouting problemDropped / refusedsecurity problemUnknown, end-to-endpath failing somewhereEffective routesper NIC: which route winsIP Flow Verifyallowed/denied + which NSG ruleConnection Monitorhop-by-hop path testAll three are Azure Network Watcher features
Pick the diagnostic by symptom: Effective routes for routing, IP Flow Verify for blocks, Connection Monitor for unknown paths.

Connecting and routing VNet traffic: which mechanism to reach for

DimensionVNet peeringGateway transit (shared gateway)User-defined route (UDR)
What it doesJoins two VNets so resources talk by private IPLets a spoke use the hub's VPN/ExpressRoute gatewayOverrides a subnet's system route to a chosen next hop
Transitive?No. A↔H, H↔B does not give A↔BPer-peering; hub gateway reaches on-prem, not spoke-to-spoken/a. you author each route explicitly
ScopeTwo VNets (regional or global)Hub + each spoke peering it is set onOne subnet (zero or one table per subnet)
Key settingNon-overlapping address spaces requiredAllow gateway transit (hub) + Use remote gateways (spoke)Next hop type + 0.0.0.0/0 for forced tunneling
CostNominal ingress/egress data chargeSpoke pays peering charge for transit trafficNo charge for the route table itself

Sharp facts the exam loves — give these one last read before exam day.

Cheat sheet

Sharp facts the exam loves — scan these before test day.

A VNet lives in one region and one subscription but spans every zone in that region

An Azure virtual network is scoped to a single region and a single subscription, yet it automatically spans all availability zones in that region, so you never split or size a VNet by zone. Resources in different subnets of the same VNet route to each other by default with no configuration. To connect VNets that are in different regions or subscriptions, you use peering, not a single larger VNet.

Azure reserves 5 addresses in every subnet, so a /24 yields 251 usable hosts

Every subnet loses five addresses to Azure: the network address (.0), the default gateway (.1), two for Azure-mapped DNS (.2 and .3), and the broadcast address (last). A /24 therefore gives 251 usable host IPs, not 256, and the smallest usable subnet is a /29 (8 minus 5 = 3 usable). This is why a /29 handed to you in a stem holds 3 VMs, not 6.

Trap Assuming a /29 gives 6 usable IPs by counting only the .0 and broadcast: Azure reserves three more (gateway and two DNS), leaving just 3.

Subnet delegation hands a subnet to a PaaS service to inject its instances

Subnet delegation designates a subnet for a specific Azure PaaS service (such as Azure SQL Managed Instance or App Service integration) so that service can deploy its own instances into the subnet and manage relevant subnet settings. A delegated subnet is dedicated to that service. Use it when a managed service requires VNet injection rather than just a service or private endpoint.

7 questions test this
Peering keeps traffic on the Microsoft backbone with no gateway or encryption

VNet peering connects two virtual networks so resources reach each other by private IP, with traffic staying entirely on the Microsoft backbone: no public internet, no VPN gateway, and no encryption are involved. Regional peering connects VNets in the same region; global peering connects VNets across regions. Both can cross subscriptions and Microsoft Entra tenants and carry a nominal ingress/egress data charge.

Trap Assuming peering needs a VPN gateway or that traffic traverses the public internet: peered traffic is private on the Azure backbone with no gateway required.

2 questions test this
VNet peering is non-transitive, so spokes can't reach each other through a hub

If A peers with hub H and H peers with B, A still cannot reach B: peering never routes transitively through an intermediate VNet. To make a hub-and-spoke route spoke-to-spoke or spoke-to-on-premises, you put a network virtual appliance or firewall in the hub and steer traffic to it with user-defined routes (service chaining), or use Azure Virtual Network Manager / Virtual WAN. This non-transitivity is the single most-tested peering property.

Trap Assuming a spoke peered to a hub automatically reaches the hub's other peers: transit requires an NVA/gateway in the hub plus UDRs, not peering alone.

1 question tests this
Peered VNets must have non-overlapping address spaces

You cannot peer two VNets whose CIDR ranges overlap: for example two 10.0.0.0/16 networks. Plan address spaces up front, or re-IP / resize one VNet's range before creating the peering. Overlapping spaces make the routes ambiguous, so Azure blocks the peering.

Trap Trying to peer two VNets that both use 10.0.0.0/16: overlapping ranges are rejected; one side must be re-addressed first.

1 question tests this
Share a hub gateway with 'Allow gateway transit' on the hub and 'Use remote gateways' on the spoke

Because a VNet can have at most one gateway, gateway transit lets spokes use the hub's VPN or ExpressRoute gateway instead of deploying one each. It is a per-peering setting on both ends: enable Allow gateway transit on the hub side and Use remote gateways on the spoke side. A spoke that uses a remote gateway must not have its own gateway, and transit works on both regional and global peering.

Trap Setting Use remote gateways on a spoke that already has its own gateway: a VNet can have only one gateway, so the configuration is invalid.

1 question tests this
New public IPs are Standard SKU: Basic was retired in September 2025

The Basic public IP SKU was retired on September 30, 2025, so every new design uses the Standard SKU. Standard differs in three ways: allocation is always static, it is secure by default, and it is zone-redundant by default in zone-enabled regions. A public IP is a separate resource you attach for inbound internet connectivity; outbound already works through an Azure-assigned ephemeral address without one.

Standard public IPs are always static, so the address never changes on stop/start

A Standard SKU public IP uses static allocation: the address is fixed at creation and stays until you delete the resource. This matters whenever something external depends on a stable address: firewall allow-lists, DNS A records, IP-based security models, or TLS certificates bound to the IP. (Basic's dynamic IPv4 could change when a VM was stopped and started, the classic 'why did my IP change?' cause.)

A Standard public IP is closed inbound until an NSG rule allows it

Standard SKU public IPs are secure by default: attaching one to a VM does not open inbound traffic. the resource stays closed until a network security group rule explicitly permits it. If a VM with a Standard public IP is unreachable, a missing NSG allow rule is the first thing to check. (Basic public IPs were open by default, which is the behavior people wrongly expect from Standard.)

Trap Expecting a Standard public IP to be reachable as soon as it's attached: it's secure by default, so inbound is blocked until an NSG rule allows it.

Azure builds a system route table for every subnet that you can't delete

Each subnet automatically gets system routes: a Virtual network route for intra-VNet traffic, a 0.0.0.0/0 route to the Internet, and None routes that drop the RFC 1918 private ranges. You cannot create or delete system routes, but you can override specific ones with user-defined routes. Azure also adds optional system routes (Virtual network peering, Virtual network gateway) as you enable those features.

A UDR's next hop is one of five types, and peering/service-endpoint are not options

User-defined routes live in a route table you create and associate to a subnet (each subnet has zero or one table). A UDR's next hop is exactly one of: Virtual appliance, Virtual network gateway, Virtual network, Internet, or None. You cannot specify Virtual network peering or a service endpoint as a UDR next hop: Azure creates those route types only when you configure the feature itself.

Trap Trying to set 'Virtual network peering' or a service endpoint as a UDR next hop: only Azure creates those routes; they aren't selectable next-hop types in a UDR.

2 questions test this
Force all outbound traffic through a firewall with a UDR for 0.0.0.0/0 (forced tunneling)

Forced tunneling overrides Azure's default internet route by adding a UDR for 0.0.0.0/0 whose next hop is a firewall appliance or the VPN/ExpressRoute gateway, then associating the route table to the subnet. All outbound traffic is then sent to that next hop for inspection or on-premises egress instead of going directly to the internet. This is the canonical use of a UDR.

3 questions test this
A subnet can have at most one route table

You associate a single route table to a subnet, never two. Consolidate all custom routes into one table; longest-prefix-match and the UDR-over-system priority resolve precedence within it. A route table can be associated to many subnets, but each subnet points to only one table.

Trap Trying to attach two route tables to one subnet to combine rule sets: a subnet supports only one; merge the routes into a single table.

Longest prefix match wins first; only on an exact prefix tie does source priority decide

Azure selects a route by longest-prefix-match: 10.0.0.0/24 beats 10.0.0.0/16 for 10.0.0.5 because it is more specific, regardless of where each route came from. Source priority (user-defined route, then BGP route, then system route) is the tiebreaker only when two routes share the same prefix. That tie rule is exactly why a UDR for 0.0.0.0/0 overrides the default internet route.

Trap Assuming a UDR always beats a system route: a more-specific system prefix still wins by longest-prefix-match; UDR priority applies only on an exact prefix tie.

5 questions test this
VNet, peering, and service-endpoint routes are preferred and can't be overridden by a UDR

Routes for the VNet itself, for VNet peerings, and for virtual-network service endpoints are preferred system routes that a UDR cannot override, even with a more-specific prefix. In particular a service-endpoint route always wins for that service's addresses. This is the exception to the normal 'UDR overrides system route' rule.

Trap Writing a UDR to redirect service-endpoint or peering traffic: those preferred system routes can't be overridden, so the UDR is ignored for them.

Read effective routes on a NIC to see which route actually wins

The routes you author aren't necessarily the routes that run: Azure merges your UDRs with system and BGP routes and applies the selection rules, and the result is the effective routes on a network interface. View them per NIC (Portal Effective routes, or az network nic show-effective-route-table) to confirm the final next hop for a destination. A present 'Virtual network peering' route here is also your proof that a peering exists and is synced.

Every VNet resource gets outbound internet access by default, no public IP needed

All resources in a VNet can reach the internet outbound by default, through an Azure-assigned ephemeral IP, even with no public IP attached. A public IP (or public load balancer) is required only for inbound reachability. This is why outbound connectivity 'just works' but a VM is not reachable from the internet until you give it a public endpoint.

1 question tests this
A VM acting as an NVA needs IP forwarding enabled to forward traffic

Azure delivers a packet to a NIC only when the destination matches that NIC's own IP, so a VM used as a network virtual appliance silently drops forwarded traffic unless IP forwarding is enabled on its NIC. A Linux/Windows NVA must also enable forwarding inside the guest OS, not just on the Azure NIC.

Trap A correct UDR pointing at the NVA's private IP still black-holes traffic if NIC (or OS) IP forwarding is off.

4 questions test this

Also tested in

References

  1. https://learn.microsoft.com/en-us/azure/virtual-network/virtual-networks-overview
  2. https://learn.microsoft.com/en-us/azure/virtual-network/virtual-network-vnet-plan-design-arm
  3. https://learn.microsoft.com/en-us/azure/virtual-network/virtual-network-peering-overview
  4. https://learn.microsoft.com/en-us/azure/virtual-network/ip-services/public-ip-addresses
  5. https://learn.microsoft.com/en-us/azure/virtual-network/network-security-groups-overview
  6. https://learn.microsoft.com/en-us/azure/virtual-network/virtual-networks-udr-overview
  7. https://learn.microsoft.com/en-us/azure/virtual-network/diagnose-network-routing-problem
  8. https://learn.microsoft.com/en-us/azure/network-watcher/ip-flow-verify-overview