already has UseRemoteGateways flag set to true

APTOS 221 Reputation points
2023-01-02T15:45:09.97+00:00

Hello ,

this is my topology :

i have 3vnets

vnet A : is located in west europe
vnet B : is located in north europe with a virtual network gateway B
vnet C : is located in west india and with a virtual network gateway C

site to site connection between B and Onpremise Office B throught network gateway B
site to site connection between C and Onpremise Office C throught network gateway C

vnet A peered with vnet B with use remote gateways is enabled ==> so , ressources can connect from vnet A and Office B network and vice versa

i want do the same between vnet A adn Vnet C, but i have gotten this error when i try do peering as before with remote gateways is enabled

My Goal is ressources in vnet A can connect to Office C Network and vice versa

i got this error when i do peering between vnet A and vnet C with use remote gateways is enable

Failed to save virtual network peering 'vnetA_vnetC'. Error: Peering VNET_ _Peering cannot have UseRemoteGateways flag set to true, because another peering /subscriptions/xxx/resourceGroups/xxx/providers/Microsoft.Network/virtualNetworks/VNET_xx/virtualNetworkPeerings/**VnetA_VnetB Peering **already has UseRemoteGateways flag set to true****.

So , when i tried to create the peering between vnet A and vnet C without remote gateways (disabled) .i can create the peering but the problem i can't connect from vnet A to Office C network

Please advice !!

Regards

Azure VPN Gateway
Azure VPN Gateway
An Azure service that enables the connection of on-premises networks to Azure through site-to-site virtual private networks.
1,796 questions
Azure Firewall
Azure Firewall
An Azure network security service that is used to protect Azure Virtual Network resources.
781 questions
Azure Virtual Network
Azure Virtual Network
An Azure networking service that is used to provision private networks and optionally to connect to on-premises datacenters.
2,775 questions
0 comments No comments
{count} votes

Accepted answer
  1. GitaraniSharma-MSFT 50,096 Reputation points Microsoft Employee Moderator
    2023-01-03T02:41:58.727+00:00

    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:

    1. Add both the on-premises sites to a single VPN gateway in one of the Vnets and make it a hub Vnet.
    2. Remove the other VPN gateway
    3. 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.


1 additional answer

Sort by: Most helpful
  1. msrini-MSFT 9,291 Reputation points Microsoft Employee
    2023-01-02T19:21:02.537+00:00

    Hi,

    You can connect vnet A with either vnet B or C with the remote gateway flag.

    You will need to come up with Hub and spoke architecture where you will have single vnet which connects to On premises and all spokes can connect to hib with use remote gateway flag.

    Regards,
    Karthik Srinivas

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.