Hi bagh, sukriti,
Good day, i hope you are doing well!
Thank you for providing detailed information about your hybrid network setup across multiple subscriptions and VNets. This kind of multi-subscription, multi-hub architecture with Azure Firewall, VPN Gateway, and VNet peering can indeed become complex, especially when working with transit routing and gateway transit settings.
You are correct that the Azure CAF (Cloud Adoption Framework) guidance encourages this hub-and-spoke model, but it can feel complex for smaller projects depending on how routes and peering are configured.
Here are some important pointers and suggestions based on your scenario:
- For the hub (Shared subscription VNet where VPN gateway resides), you must enable Allow gateway transit and Allow forwarded traffic on peering links both to the Firewall VNet (subs1) and the VM VNet (subs3). The hub VNet becomes the transit point and gateway.
On the spoke VNets (Firewall VNet in subs1 and VM VNet in subs3), you must enable Use remote gateway on their peering connections back to the hub (subs2). Note you cannot enable Use remote gateway on more than one peering from the same spoke.
- This means that if the Firewall VNet also needs gateway transit, it has to peer with the hub and use the remote gateway, and the VM VNet peers and uses the remote gateway. The hub routes traffic between firewall and VM subnets and forwards on-prem traffic via the VPN gateway.
- UDRs (user-defined routes) on the VM subnet should point traffic to the firewall's private IP in the firewall VNet, and the firewall routes to the VPN gateway subnet in the hub VNet, creating a traffic flow path.
The error and peering failure you have when adding the firewall VNet IP ranges to the VM subnet's route table might be due to missing or conflicting peering settings in the hub, or because route propagation and custom UDRs overlap or conflict.
- Azure currently does not support multiple remote gateways on a single VNet peer, so you cannot have two VNets both enabling remote gateway via peering to the same hub.
Recommendations:
- Verify the peering on the hub VNet (subs2) to both the firewall VNet and VM VNet with Allow forwarded traffic and Allow gateway transit enabled.
- Ensure each spoke VNet (firewall VNet and VM VNet) peering back to the hub has Use remote gateway enabled.
- Carefully plan UDRs to avoid route conflicts. Use UDRs on the VM subnet pointing to the firewall private IP, and on firewall subnet pointing traffic to VPN gateway.
- If you face conflicts in direct peering, consider using a firewall or NVA in the hub subnet to centralize routing and simplify the topology.
- You may want to review Microsoft’s official guidance for such hybrid, hub-and-spoke configurations, particularly:
- Configure VPN gateway transit for virtual network peering
- Use Azure Firewall to route a multi-hub and spoke topology
I understand this can be tough with CAF's recommended model, but with the right combination of peering flags and route setups, you should achieve the desired connectivity.
Please let me know if you need help or additional clarifications.
If the information resolved your issue, kindly consider accepting the answer — it will help others who might be facing similar challenges.
Thanks,
Harish.