40 minutes (VPN gateway provisioning alone can take ~30 min — plan accordingly)
---
VNet address spaces MUST NOT overlap for peering to work. Check both VNets' address ranges before creating peering links.
- Resource group: Create new rg-az104-lab14
- Name: vnet-hub14
- Address space: 10.70.0.0/16
- Subnets: subnet-hub with 10.70.1.0/24
- Create.
- Address space: 10.71.0.0/16 (non-overlapping)
- Subnets: subnet-spoke with 10.71.1.0/24
- Create.
- Peering link name: hub-to-spoke
- Remote virtual network:
- Select by ID > choose vnet-spoke14
- Allow access between VNets: Checked
- Add.
- Peering link name: spoke-to-hub
- Remote virtual network: select vnet-hub14
- Allow access between VNets: Checked
- Add.
Both peerings should now show Connected status.
- Virtual machines > Create > vm-hub, Ubuntu 22.04 LTS,
vnet-hub14/subnet-hub with a public IP. Create.
- Create vm-spoke, Ubuntu 22.04 LTS, vnet-spoke14/subnet-spoke
with No public IP. Create.
using its public IP, then ping/SSH to vm-spoke's private IP
(e.g., 10.71.1.x) — should succeed over the peering connection (private
IPs, no public exposure needed).
- Allow forwarded traffic: Checked (lets traffic NOT originating in
the peered VNet pass through — needed for NVAs/firewalls)
- Save.
use the hub's VPN/ExpressRoute gateway (hub-spoke topology) — set on the hub
side; spoke side sets Use remote gateways.
VNet peering is not transitive — if spoke A peers with hub, and hub
peers with spoke B, A cannot reach B unless explicitly peered (or via gateway
transit + an NVA).
This part provisions a real gateway — expensive and slow (~30 min). Only
do this if you want hands-on VPN experience; otherwise read through for concepts.
- Name: GatewaySubnet (reserved name)
- Address range: 10.70.255.0/27
- Add.
- Name: vpngw-lab14
- Region: East US
- Gateway type: VPN
- VPN type: Route-based
- Virtual network: vnet-hub14
- Gateway subnet: GatewaySubnet
- Public IP: Create new (e.g., pip-vpngw)
- SKU: VpnGw1
- Create (provisioning takes ~30 minutes).
represent the on-prem side:
- Name: lng-onprem
- Endpoint: IP address
- IP address: 203.0.113.1 (a placeholder on-prem public IP)
- Address space: 192.168.1.0/24 (a placeholder on-prem network)
- Create.
Connections > + Add to create a Site-to-Site (IPSec) connection:
- Name: conn-onprem
- Connection type: Site-to-Site (IPSec)
- Local network gateway: lng-onprem
- Shared key: P@ssw0rd123! (used for IPSec negotiation)
- Create.
and spoke-to-hub) show Connected status
can reach vm-spoke's private IP across the peering
> Delete resource group.
> If you deployed the VPN gateway, deletion can take 10-15+ minutes — that's normal.