Hello Handian,
Welcome to Q&A, I uderstand that you can't reach vNet2 from on-premises without BGP enabled, but when BGP is enabled, vNet2 becomes unreachable?
When BGP is disabled, your VPN Gateway likely uses static routing to reach vNet1 and vNet2. In this case, the static routes enable communication between your on-premises network and both VNets, even if the peered VNets (vNet1 and vNet2) don't propagate routes dynamically. Static routes don't rely on BGP advertisements for connectivity.
However, when BGP is enabled, the VPN Gateway switches to dynamic routing. It advertises only the routes to directly connected networks (like vNet1) to your on-premises network. Routes to peered VNets (like vNet2) are not automatically propagated through the VPN Gateway, which causes vNet2 to become unreachable from on-premises.
I do think you can fix the issue if you include vNet2's routes in the BGP advertisements to your on-premises network:
- Enable "Allow Gateway Transit" in vNet2's peering configuration.
- Enable "Use Remote Gateways" in vNet1's peering configuration.
- Confirm that your on-premises BGP router is correctly handling and adding the routes for vNet2.
Let me know your findings.
References:
- https://learn.microsoft.com/en-us/azure/vpn-gateway/vpn-gateway-peering-gateway-transit
- https://learn.microsoft.com/en-us/answers/questions/802735/azure-vnet-peering-and-use-remote-gateways
If the information helped address your question, please Accept the answer.
Luis