Welcome to the Microsoft Q&A Platform. Thank you for reaching out & I hope you are doing well.
I am afraid this will not be feasible with a traditional VPN gateway (when I say traditional VPN gateway, I mean a VPN gateway without vWAN solution, which is deployed directly into a Vnet)
For a Traditional VPN Gateway:
To route all the P2S traffic through Azure Vnet , you can enable forced tunneling for your P2S clients. --> Which you don't want to do.
Please note that:
Internet connectivity is not provided through the VPN gateway. As a result, all traffic bound for the Internet is dropped.
Limitation:
Traditional VPN gateways do not have the EnableInternetSecurity flag option. This flag is needed and must be set to true for your clients to be properly configured for forced-tunneling(for accessing Internet) via the P2S VPN gateway.
For a vWAN P2S Gateway
The P2S VPN gateway under Virtual Hub has this option.
Configure a vWAN P2S Gateway
In order to reach the Internet via Azure P2S VPN gateway, you need to deploy a secured virtual hub with Azure firewall manager and add the P2S VPN Gateway to allow your egress traffic that will be controlled by a firewall policy.
You can advertise the 0.0.0.0/0 route or any custom route to your VPN clients and secure Internet traffic via Azure Firewall (Firewall Manager). This makes your clients send the Internet bound traffic to Azure for inspection. Then, Firewall SNATs the packet to the PIP of Azure Firewall for egress to Internet.
To do this, you need to setup an Azure Firewall & then configure a Policy to allow P2S traffic to Internet.
- You can also use a NVA instead of Azure Firewall as per your requirement.
- To advertise custom route to your VPN clients, refer:
- https://learn.microsoft.com/en-us/azure/vpn-gateway/vpn-gateway-p2s-advertise-custom-routes
References:
Below doc explains how to configure forced tunneling for Virtual WAN Point-to-site VPN and take inputs on the configuration:
https://learn.microsoft.com/en-us/azure/virtual-wan/how-to-forced-tunnel
Other Q&A references :
- https://learn.microsoft.com/en-us/answers/questions/589858/azure-wan-and-p2s-vpn-forced-tunneling
- https://learn.microsoft.com/en-us/answers/questions/1332929/specific-route-to-a-public-ip-through-p2s-vpn
Please let us know if we can be of any further assistance here.
Thanks,
Kapil
Please Accept an answer if correct. Original posters help the community find answers faster by identifying the correct answer.