How to use Azure VPN with Azure NAT Gateway and route all P2S VPN traffic

Oles Samolevsky 20 Reputation points
2024-07-17T17:34:48.57+00:00

Hello everyone,

Is it possible to use Azure VPN with Azure NAT Gateway and route all P2S VPN traffic through a NAT Gateway connected to this VPN?

I connected Azure NAT Gateway to the Virtual Network,

  • in the p2s VPN connection settings I specified to route all traffic through the VPN tunnel, announcing routes 0.0.0.0/1,128.0.0.0/1,
  • changed the connection configuration of the Azure VPN client to version 2   to force tunneling all traffic.

But all this was unsuccessful - traffic could not be routed through the remote gateway and I don't have internet connectivity when using VPN.scheme

Thank you for your help. I spent ages trying to figure out why VPN doesn't work like VPN for all connections.  

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,567 questions
Azure Virtual Network
Azure Virtual Network
An Azure networking service that is used to provision private networks and optionally to connect to on-premises datacenters.
2,531 questions
Azure NAT Gateway
Azure NAT Gateway
NAT Gateway is a fully managed service that securely routes internet traffic from a private virtual network with enterprise-grade performance and low latency.
39 questions
0 comments No comments
{count} votes

Accepted answer
  1. KapilAnanth-MSFT 47,206 Reputation points Microsoft Employee
    2024-07-18T05:05:57.7+00:00

    @Oles Samolevsky ,

    To answer your question,

    "Is it possible to use Azure VPN with Azure NAT Gateway and route all P2S VPN traffic through a NAT Gateway connected to this VPN?"

    • No
    • This is not possible.

    Summary:

    #Point1

    • See : Forced tunneling
    • Internet connectivity is not provided through the VPN gateway. As a result, all traffic bound for the Internet is dropped.
    • This means, VPN Gateway as a stand alone resource cannot provide you with internet connectivity.

    #Point2

    What you can do is,

    Consider deploying a NVA or Azure Firewall on the VNET and route all traffic to the Firewall from the VPN Gateway.

    • You should advertise additional custom routes 0.0.0.0/1 and 128.0.0.0/1 to the P2S Clients.
    • On the GatewaySubnet, attach a UDR with routes 0.0.0.0/1 and 128.0.0.0/1 pointing to the nextHop as the NVA's/Azure Fierwall's IP Address
    • Now, this Firewall will provide you with Internet connectivity

    I would suggest you instead consider using Virtual WAN Hub routing intent with Internet Traffic Routing Policy

    • User's image

    Hope this helps.

    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.

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.