D4 · Networking

Virtual Networks (VNet)

VNets are the fundamental network building block in Azure. The AZ-104 evaluates subnet design, CIDR, peering, custom routing, and how to isolate or connect resources inside and outside Azure.

What a VNet is

A is an isolated private network in Azure. It works like an on-premises network: it has a range of private IPs (CIDR), subnets, route tables, and traffic control — but managed by software in the cloud.

VNets are regional — they cannot span multiple regions directly. To connect VNets across regions, Global VNet Peering is used.

Key characteristics

  • •Isolation: a VNet cannot communicate with another by default
  • •Private IP space: RFC 1918 (10.x, 172.16-31.x, 192.168.x)
  • •No cost for the VNet itself — you pay for the resources inside it
  • •Supports IPv4 and IPv6 simultaneously (dual stack)
  • •No VPN or gateway required for intra-VNet communication

SLA and availability

  • •The VNet itself: no declared availability limit — it is Azure infrastructure
  • •Resources within the VNet: depend on the resource's own SLA (VM, LB, etc.)
  • •Intra-VNet networking is redundant by design in Azure
  • •Loss of intra-VNet connectivity does not occur under normal operation

Per-subscription limits

  • •50 VNets per region per subscription (extendable to 500)
  • •3000 subnets per VNet
  • •IP space: up to /8 (16M IPs) per VNet
  • •Azure reserves 5 IPs in every subnet (first, broadcast, and 3 for Azure)
  • •VMs in the same VNet can communicate directly without an NSG

Subnets and CIDR addressing

IPs reserved by Azure in every subnet

In a /28 subnet (16 IPs) there are only 11 usable IPs. Azure always reserves 5:

.0Network address (subnet identifier)
.1Azure default gateway
.2Azure DNS (internal mapping)
.3Azure DNS (internal mapping)
.255Broadcast address

Azure's special subnets

GatewaySubnet

Required for VPN Gateway and . Exact name. Minimum /27, /26 or larger recommended.

AzureBastionSubnet

Required for Azure Bastion. Exact name. Minimum /26.

AzureFirewallSubnet

Required for Azure Firewall. Exact name. Minimum /26.

AzureFirewallManagementSubnet

For Azure Firewall with forced tunneling enabled. Minimum /26.

CIDRTotal IPsUsable IPsTypical use
/816,777,21616,777,211Entire VNet (maximum range)
/1665,53665,531Mid-size organization VNet
/24256251Standard subnet with plenty of room
/266459Azure services subnet (Bastion, Firewall, GW)
/273227Minimum viable GatewaySubnet
/281611Small subnet for limited resources
/2983Very limited — avoid in production

VNet Peering

VNet Peering connects two VNets privately using Microsoft's backbone — without going through the internet, without a gateway, without encryption (the backbone is already secure). Traffic travels at full network speed with low latency.

Regional Peering

Connects VNets in the same Azure region.

  • →No egress cost — traffic within the region is free between peered VNets
  • →Low latency — same datacenter infrastructure
  • →No gateway or public IP required
  • →The VNets cannot have overlapping CIDR ranges

Global VNet Peering

Connects VNets in different Azure regions.

  • →Does have an egress cost (cross-region bandwidth)
  • →Uses Microsoft's private backbone — does not go through the internet
  • →Higher latency than regional but much lower than VPN
  • →Available between any pair of Azure regions

Important peering characteristics

• Peering is not transitive: if VNet-A peers with VNet-B and VNet-B peers with VNet-C, VNet-A CANNOT talk to VNet-C

• For transitive connectivity: use Azure Virtual WAN or an NVA (Network Virtual Appliance) as a hub

• Peering is bidirectional: two links are created (A→B and B→A)

• Options: Allow gateway transit (the hub VNet shares its gateway with the spokes) and Use remote gateway (the spoke uses the hub's gateway)

Routing and User-Defined Routes (UDR)

System routes (automatic)

Azure creates routes automatically for every subnet. You cannot modify them, but you can override them with a UDR.

0.0.0.0/0InternetDefault outbound traffic to the internet
10.0.0.0/8VNetInternal traffic within the VNet
10.1.0.0/16VNet peeringRoute added when peering is created (automatic)
168.63.129.16VirtualNetworkServiceEndpointTraffic to PaaS services via a service endpoint

User-Defined Routes (UDR)

Let you override system routes to direct traffic through an NVA, Azure Firewall, or .

• Created in a Route Table and associated with subnets

• Next hop types: Virtual appliance (NVA/Firewall IP), Virtual network gateway, VNet, Internet, None (drop)

• Typical case: force all outbound internet traffic through Azure Firewall (UDR 0.0.0.0/0 → Firewall IP)

• Typical case: force on-premises traffic over VPN with BGP route propagation disabled

Service Endpoints and Private Link

Service Endpoint

Extends the VNet's identity to Azure PaaS services (Storage, SQL, Key Vault, etc.). Traffic travels over Azure's backbone but the source IP remains the VNet's private IP.

Advantages

  • +Free — no additional cost
  • +Easy to configure on the subnet
  • +Improves security: you can restrict the PaaS service to just your VNet

Limitations

  • −The PaaS service still has a public endpoint (you only filter by VNet)
  • −Does not create a private IP in your VNet for the service

Private Endpoint (Private Link)

Creates a NIC with a private IP in your subnet that maps directly to the PaaS service. The PaaS service becomes fully private — accessible only from your VNet.

Advantages

  • +The PaaS service has NO public endpoint accessible from the internet
  • +Accessible from on-premises via VPN/ExpressRoute
  • +Private DNS resolution with Azure Private DNS Zones

Limitations

  • −Has a cost (per endpoint-hour + data processed)
  • −Requires Private DNS Zone configuration for correct resolution

applied at the subnet vs NIC level

Traffic evaluation with NSG

Inbound traffic

1. Destination subnet NSG → 2. Destination NIC NSG

Outbound traffic

1. Source NIC NSG → 2. Source subnet NSG

If the subnet NSG blocks the traffic, the NIC NSG is not evaluated (the packet has already been dropped).

Useful NSG Service Tags

InternetTraffic going to/from the internet
VirtualNetworkThe entire VNet (includes peered ranges and on-prem via VPN)
AzureLoadBalancerAzure Load Balancer probes (168.63.129.16)
StorageAzure Storage (all endpoints)
SqlAzure SQL Database and Synapse
AppServiceOutbound from App Service Environment
AzureMonitorAzure Monitor, Log Analytics, Application Insights

Did you get this topic?

Test what you just learned

A subnet has the range 10.0.1.0/26. How many IPs are available for Azure resources?

Ready to test "Virtual Networks (VNet)"?

Put what you learned to the test with original AZ-104 exam questions.

Start AZ-104 mock exam

Unlimited mock exams with the Pro plan

Log in to track your progress.