Hello @APTOS ,
Welcome to Microsoft Q&A Platform. Thank you for reaching out & hope you are doing well.
I understand that you have a working Vnet peering between Vnet A and Vnet B with gateway transit option enabled and now when you are trying to configure Vnet peering between Vnet A and Vnet C with gateway transit option, it is failing with following error "Error: Peering VNET_ _Peering cannot have UseRemoteGateways flag set to true, because another peering already has UseRemoteGateways flag set to true".
Per design and as described in our official doc, each virtual network, including a peered virtual network, can have its own gateway. However, when you configure the gateway in the peered virtual network as a transit point to an on-premises network, the virtual network that is using a remote gateway can't have its own gateway. A virtual network could have only one gateway, the gateway should be either local or remote gateway in the peered virtual network.
Refer : https://learn.microsoft.com/en-us/azure/virtual-network/virtual-network-peering-overview#gateways-and-on-premises-connectivity
Below is your current setup and limitation:
Vnet A <---peering with remote gateway enabled---> Vnet B (S2S to on-prem)
The above peering implies that Vnet B has a local VPN gateway and Vnet A now has a remote VPN gateway.
Since Vnet A already has a remote gateway i.e. the VPN gateway of Vnet B, it cannot have another remote gateway (in your case, that would be the VPN gateway of Vnet C). Hence, you won't be able to peer Vnet A with Vnet C using the remote gateway option.
In a Hub and spoke architecture, the hub virtual network acts as a central point of connectivity to many spoke virtual networks. You can enable cross-premises scenarios by using the hub to connect to your on-premises networks and the spoke virtual networks peer with the hub.
Refer: https://learn.microsoft.com/en-us/azure/architecture/reference-architectures/hybrid-networking/hub-spoke?tabs=cli
https://learn.microsoft.com/en-us/azure/cloud-adoption-framework/ready/azure-best-practices/hub-spoke-network-topology
But in your case, there are 2 hub Vnets and 1 spoke Vnet, which will not work for on-premise transit connectivity.
So, to get your setup to work, you would need to make the below changes:
- Add both the on-premises sites to a single VPN gateway in one of the Vnets and make it a hub Vnet.
- Remove the other VPN gateway
- Peer the 2 Vnets (without any VPN gateways) to the hub Vnet as spokes with remote gateway option enabled.
Kindly let us know if the above helps or you need further assistance on this issue.
----------------------------------------------------------------------------------------------------------------
Please "Accept the answer" if the information helped you. This will help us and others in the community as well.