Thank you for reaching out to us with your query. I understand that you are trying to create a Virtual Network Gateway (VNGW) in Azure, but you are encountering an error message. You have two subnets under the same virtual network and want to create two VNGWs and connect them to allow a single VPN client to connect to machines on multiple VNets. You have tried using VNet peering, but it did not work. I will be happy to assist you with this.
Based on the error observed in the screenshot above. In an Azure Virtual Network, you can deploy only one VPN gateway, this is documented here. You are getting the error above when you are trying to add another VPN Gateway to the virtual network which already has a VPN Gateway.
Based on your statement above
I have tried having just the one VPN gateway with VNET peering between the two VNETs as I thought this would originally work , but it hasnt hence the reason why im going down this route.
This is actually a recommended way to achieve the required communication. A similar scenario is described here.
You need to set the following configuration on your peered Vnets.
- Configure the peering connection to Allow gateway transit.
- Configure the peering connection to Use the remote virtual network's gateway.
You can also refer to this tutorial if you have hub and spoke architecture for your vnets.
Please let us know if you are facing any issue for this set-up, we will gladly continue with our discussion.
Please "Accept the answer" if the information helped you. This will help us and others in the community as well.