Hub-and-spoke is the default answer to “how should we lay out our Azure network?” — and for good reason. It gives you one place for shared services and one place to inspect traffic. But drawing the diagram is the easy part. The design only works if the routing agrees with the picture.
The shape
A hub virtual network holds the things every workload needs: the firewall, the VPN or ExpressRoute gateway, and often DNS and management access. Each spoke is its own virtual network holding one workload or environment, peered to the hub. Spokes are not peered to each other.
That last point is the whole idea. If spoke A wants to talk to spoke B, the traffic has to go through the hub — which is where your firewall is waiting.
Peering does not forward traffic by itself
VNet peering is not transitive. Peering A to the hub and B to the hub does not let A reach B. Something in the hub has to route the packet onward, and each spoke has to be told to send its traffic there. That is the job of a user-defined route (UDR).
On every spoke subnet, attach a route table with a default route pointing at the firewall’s private IP:
Address prefix : 0.0.0.0/0
Next hop type : Virtual appliance
Next hop IP : 10.0.1.4 (firewall, in the hub)Now spoke-to-spoke, spoke-to-internet and spoke-to-on-premises traffic all land on the firewall first.
The three settings people miss
- Allow forwarded traffic on the spoke side of each peering. Without it, packets that the firewall forwards from another spoke are dropped at the peering.
- Use remote gateways on the spoke, and allow gateway transit on the hub, if spokes should reach on-premises through the hub’s gateway.
- A route table on the GatewaySubnet that sends spoke prefixes to the firewall. Otherwise traffic arriving from on-premises goes straight to the spoke and bypasses inspection — and the reply comes back through the firewall, which has never seen the session.
What goes where
Keep the hub small and boring. Firewall, gateway, Bastion, DNS. Workloads live in spokes, each with its own network security groups for the rules that belong to that workload. The firewall handles what crosses a boundary; NSGs handle what happens inside one.
How to check your work
Do not trust the diagram — ask Azure. On a VM’s network interface, open Effective routes and confirm the default route’s next hop is the firewall. Then run a connection test from Network Watcher and look for the hop through the hub. If the firewall is not in the path, the design is not doing what the drawing says.