user-guides

Hub-Spoke Architecture: Contoso On-Premises Connectivity via VPN Gateway

Overview

This document explains how Contoso On-Premises infrastructure connects to the Azure Hub-Spoke network architecture using a VPN Gateway.


Network Topology

Objective

Provide network connectivity between Contoso On-Premises and Cust1 Azure Subscription hosted in Spoke 1.


Connectivity Flow

  1. Site-to-Site VPN (Hub <-> Contoso On-Premises)
    • A route-based VPN Gateway is deployed in the Hub VNet.
    • The VPN connection terminates at the on-premises VPN device.
    • (Optional) Use BGP for automatic route propagation.
  2. VNet Peering (Hub <-> Spoke 1)
    • Spoke 1 is peered with the Hub VNet.
    • Configure peering as follows:
      • Hub → Spoke: Allow gateway transit = ✅, Allow forwarded traffic = ✅
      • Spoke → Hub: Use remote gateways = ✅, Allow virtual network access = ✅
  3. Route Propagation
    • If BGP is enabled, on-premises routes are automatically propagated to Spoke 1.
    • If not using BGP:
      • Define User Defined Routes (UDRs) in Spoke 1 that direct on-premises traffic to the Hub Gateway or NVA.
    • Verify that the Hub route table includes on-premises prefixes.
  4. Network Security Configuration
    • Ensure NSGs allow inbound and outbound traffic between Spoke 1 and on-premises address ranges.
    • If an Azure Firewall or NVA is in the Hub, configure routes and policies to permit the traffic.
    • Enable Allow forwarded traffic on all relevant peerings.

Azure CLI Example

# Hub to Spoke Peering
az network vnet peering create -g RG -n HubToSpoke --vnet-name HubVnet --remote-vnet SpokeVnet   --allow-vnet-access true --allow-gateway-transit true --allow-forwarded-traffic true

# Spoke to Hub Peering
az network vnet peering create -g RG -n SpokeToHub --vnet-name SpokeVnet --remote-vnet HubVnet   --allow-vnet-access true --use-remote-gateways true --allow-forwarded-traffic true

Notes & Best Practices


Summary

Contoso On-Premises connects to the Hub VNet via VPN Gateway.
Spoke 1 (Cust1 Azure Subscription) connects to the Hub using VNet Peering with Use Remote Gateway enabled.
✅ Traffic flows between Cust1 Azure workloads in Spoke 1 and Contoso On-Premises through the Hub VPN Gateway.


Another way of looking at it

Solution Overview

✅ Architecture Diagram

image

✅ Step-by-Step Implementation

Step 1: Create Hub VNet and VPN Gateway

Step 2: Add Multiple Site-to-Site Connections

Step 3: Configure VNet Peering

Step 4: Routing

Step 5: Isolation Controls

Pros & Cons