VPN C2S internet access

Marcio Henriques 5 Reputation points

Hey, guys!

I would like to know if there is the possibility of having a static IP to access the internet through a client-site VPN.

I need to connect to my client's network. However he needs to release firewall rule to a static IP. Can I connect my laptop to the Azure VPN client to site, and throught this vpn connection have a static IP to pass to my client to release my access to his environment?

I just need to access his environment allways with the same IP throught my azure vpn (Client to site) connection.

I know that a Site to Site VPN would resolve the question, but he doesn't want to create it for operational reasons.

Thanks in advance!


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,214 questions
{count} votes

1 answer

Sort by: Most helpful
  1. GitaraniSharma-MSFT 42,731 Reputation points Microsoft Employee

    Hello @Marcio Henriques ,

    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 it is possible to have a static IP to access the internet through Azure Point to Site VPN.

    Azure Point to Site VPN do not have a Public IP. Only the VPN gateway has a Public IP which is used for Site-to-Site VPN connections.

    Point to Site VPN make use of the configured address pool to allocate an IP address to the connected VPN client or local machine and this is a private IP. So, the Public IP of the clients still remains the ISP Public IP.

    To route all the P2S traffic through Azure Vnet and give them a common public IP address instead of their own ISP Public IP Address, you can enable forced tunneling for your P2S clients.

    Please note that Internet connectivity is not provided through the VPN gateway. As a result, all traffic bound for the Internet is dropped.

    Refer: https://learn.microsoft.com/en-us/azure/vpn-gateway/vpn-gateway-p2s-advertise-custom-routes#forced-tunneling

    Hence, you need to introduce another resource such as Azure Firewall or a NVA (Network Virtual Appliance) which can take care of the Internet connectivity.

    But there is another limitation on the traditional VPN gateway (when I say traditional VPN gateway, I mean a VPN gateway without Virtual WAN solution, which is deployed directly into a Vnet) as below:

    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/accessing Internet via the VPN gateway.

    Refer: https://learn.microsoft.com/en-us/powershell/module/az.network/set-azvirtualnetworkgateway?view=azps-10.1.0

    The P2S VPN gateway under Virtual Hub has this option.

    Refer: https://learn.microsoft.com/en-us/powershell/module/az.network/update-azp2svpngateway?view=azps-10.1.0

    So, 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.

    Refer: https://learn.microsoft.com/en-us/azure/firewall-manager/secure-cloud-network

    When you secure internet traffic via Azure Firewall (Firewall Manager), you can advertise the route or any custom route to your VPN clients. This makes your clients send the internet bound traffic to Azure for inspection. Then, firewall SNATs the packet to the Public IP 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:


    You can also add the route directly in your downloaded azurevpnconfig.xml file as below:


    Refer: https://learn.microsoft.com/en-us/azure/vpn-gateway/azure-vpn-client-optional-configurations#add-custom-routes

    You can refer the below doc which explains how to configure forced tunneling for Virtual WAN Point-to-site VPN and take inputs on the configuration:


    Another reference for you:


    However, if you are not looking for a native solution, you may explore the third-party Network Virtual Appliances (NVAs) from Azure Marketplace which may fit your requirement.

    Refer: https://learn.microsoft.com/en-us/azure/vpn-gateway/nva-work-remotely-support

    Or like you mentioned, Site-to-Site VPN would resolve the issue.

    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.

    0 comments No comments