Hello @Ashwani kumar ,
Welcome to Microsoft Q&A Platform. Thank you for reaching out & hope you are doing well.
I understand that you would like to know if you can keep VPN gateway at both Hub and Spokes and route all traffic from the Hub.
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.
Traffic is not transiting your peered spoke VNet because of the VPN gateways deployed in both VNets. Traffic will transit a peered Vnet only if one of the VNet has VPN gateway deployed.
So, if both the peered Vnets have their own VPN gateways, the gateway transit will not work, and you won't be able to connect to your on-premises networks from the peered Vnet. This is by design. For this to work, you need to remove the VPN gateway from the peered remote Vnet, or you can remove Vnet peering and create a Site-to-Site VPN connection between both the Vnets where VPN gateways are deployed.
To resolve this issue, I would advise you to follow the below:
Either:
- Delete the VPN gateway from spoke Virtual Network.
- Peer Hub Vnet & spoke Vnet and then use the transit gateway feature in the Vnet peering as you had in scenario 1.
OR:
- Disable the Vnet peering between Hub and Spoke Vnets.
- And create a site-to-site (IPsec) connection between the two VPN gateways.
When you follow the Site-to-Site IPsec steps, you create and configure the local network gateways manually. The local network gateway for each VNet treats the other VNet as a local site. These steps allow you to specify additional address spaces for the local network gateway to route traffic. If the address space for a VNet changes, you must manually update the corresponding local network gateway.
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.