azuregatewayvnet

Unable to create Gateway for existing Virtual Network


I have a VNET in Azure and I'm trying to create a new Virtual Network Gateway for this. So that, I can use this Virtual Network with Azure Function App.

During the creation, I'm getting the below error:

The Virtual network already has a gateway of this type or the existing gateway in the virtual network does not support coexistence

enter image description here


Solution

  • • According to official Microsoft documentation, the gateway subnet size should be atleast ‘/27’ or bigger, i.e., /27, /26, /25, /24 etc. which can accommodate 32 or more IP addresses. In your case, the subnet size for the Virtual network gateway which is already created in the virtual network that you have deployed is lesser than the one specified earlier. Also, please check whether you have already created a ‘GatewaySubnet’ of the said IP address configuration or not. And if there are no IP address spaces left to accommodate the VNET gateway, then you might have to add one accordingly.

    • The error also means that a VPN gateway might be in existence already which doesn’t support co-existence with the one that you are trying to configure, i.e., a Express route IPv6 gateway and a dual stack express route gateway. Also, please check whether any Network Security Group is configured for the gateway subnet that is already deployed as NSG for the gateway subnet should be avoided.

    • Please check the ASN (Autonomous System Number) of the VPN Gateway configured other than for this virtual network gateway, if it is 65515 or not. It should be 65515.

    I also tried to create a virtual network gateway as you as shown below in the snapshot and didn’t receive the error faced by you.

    VNET GW Creation

    For more details, please refer to the below official documentation link regarding VPN Gateway co-existence and creation of virtual network gateway: -

    https://learn.microsoft.com/en-us/azure/expressroute/expressroute-howto-coexist-resource-manager#add