- Reduces the number of VPN gateways you must deploy and manage.
- Centralizes connectivity and routing configuration in a hub.
- Lowers operational complexity and costs.
- Frees up resources in spoke VNets (no gateway required in each spoke).
- Supports hybrid connectivity patterns such as site-to-site and point-to-site through the same hub gateway.
Traditional approach vs. gateway transit
Traditional (per-VNet gateways)- Requires a VPN gateway in each VNet for site-to-site connections.
- Higher cost and more management overhead.
- Greater risk of configuration drift and misconfiguration.
- One centralized gateway in a hub VNet.
- Spokes use the hub gateway through VNet peering.
- Simplified routing, centralized security controls, and cost savings.

- Allow gateway transit: enabled on the hub peering to allow spokes to use the hub’s gateway.
- Use remote gateways: enabled on the spoke peering so the spoke sends gateway-bound traffic to the hub.
Hub-spoke configuration and gateway transit
The hub-spoke architecture is widely recommended for scalable Azure network topologies and is commonly used in landing zones and enterprise designs:- Centralized routing, inspection, and connectivity.
- Simplified hybrid connectivity (S2S and P2S).
- Easier to apply consistent network security policies.
- Hub VNet contains the virtual network gateway with a P2S configuration.
- Spoke VNet (where a VM resides) is peered to the hub and configured to use the remote gateway.
- A client (laptop) connects via the Azure VPN Client to the hub gateway and accesses a private IP in the spoke VNet.


- On the spoke-to-hub peering: “Use remote gateways” is enabled so the spoke knows to route gateway-bound traffic to the hub.
- On the hub-to-spoke peering: “Allow gateway transit” is enabled to let the hub’s gateway be used by the spoke.
- If you have network virtual appliances (NVAs) in-line, you may also need “Allow forwarded traffic.”

Note: A virtual network cannot both host its own VPN gateway and be configured to “Use remote gateways.” If you enable “Use remote gateways” on a VNet, you cannot deploy a gateway in that same VNet until you disable that setting.
To enable gateway transit correctly:
- On the spoke VNet peering to the hub, enable Use remote gateways.
- On the hub VNet peering to the spoke, enable Allow gateway transit.
- If you need traffic to flow through network virtual appliances, enable Allow forwarded traffic on the appropriate peerings.
Demo: P2S VPN client → access VM in peered spoke
- Configure P2S on the hub gateway with Azure AD authentication and an address pool.
- Install and configure the Azure VPN Client on your laptop and authenticate via Microsoft Entra ID.
- Connect the client; the client will receive routes for the hub and peered spoke VNets (for example, the spoke address space
192.168.0.0/24). - From your laptop, SSH to the private IP of the VM in the spoke VNet. Traffic will traverse the P2S connection to the hub gateway, then follow the peering to the spoke.
When to use gateway transit
- Use gateway transit when you have multiple VNets that must access the same on-premises network or shared services and you want to centralize connectivity.
- Avoid placing gateways in every VNet when you want to reduce cost and simplify management.
- If you need isolation (separate gateways per VNet for security or performance reasons), consider per-VNet gateways instead.
Links and references
- Azure Virtual Network Peering overview
- Use remote gateways and allow gateway transit
- Point-to-site VPN overview (Azure VPN Gateway)
- Azure VPN Client overview
- Hub-spoke architecture (Azure reference)