Private networks - Overlapping

Michelangelo Stillante 41 Reputation points
2021-03-15T19:53:35.097+00:00

good evening .. i have a question about private networks and Azure. quite long..... from networking knowledge i know that, two private networks can connect to each other if they are connected via internet or VPN as they are behind a public IP address, no matter if the private networks are matching or overlapping.

Hypothesis not real: i have my laptop inside 10.10.10.0/24 behind a public 134.65.5.67 and i want to connect through 45.56.65.3 public ip address to my friend's server 10.10.10.0/24

i have just learnt today that in AZURE this is not possible: two private networks matching or overlapping can't connect one to the other even if they are behind a PUBLIC IP ADDRESS. do you know why ? may you please explain me or send me links able to explain it to me ? thks very much for your support

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,762 questions
0 comments No comments
{count} votes

Accepted answer
  1. GitaraniSharma-MSFT 50,021 Reputation points Microsoft Employee Moderator
    2021-03-18T13:23:17.89+00:00

    Hi @Michelangelo Stillante ,

    Welcome to Microsoft Q&A Platform. Thank you for reaching out & hope you are doing well.

    When using a virtual network as part of a cross-premises architecture, you need to make sure to carve out an IP address range that you can use specifically for this virtual network. If a duplicate address range exists on both sides of the VPN connection, traffic will route in an unexpected way.

    Azure VPN Gateway will NOT perform any NAT-like functionality on the inner packets to/from the IPsec tunnels and hence you can't have overlapping IP address ranges between Azure & local sites.

    Please refer : https://learn.microsoft.com/en-us/azure/vpn-gateway/tutorial-site-to-site-portal#CreatVNet
    https://learn.microsoft.com/en-us/azure/vpn-gateway/vpn-gateway-vpn-faq#can-i-use-nat-t-on-my-vpn-connections
    https://learn.microsoft.com/en-us/azure/vpn-gateway/vpn-gateway-vpn-faq#can-there-be-overlapping-address-spaces-among-connected-virtual-networks-and-on-premises-local-sites

    So to answer your query in simple terms:

    Why between two customers NOT using Azure this is possible : 3rd party VPN devices support NAT, hence this is possible.
    Why between two customers using Azure this is NOT possible : Azure VPN gateway doesn't support NAT, hence this is not possible.

    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

1 additional answer

Sort by: Most helpful
  1. Andreas Baumgarten 123.4K Reputation points MVP Volunteer Moderator
    2021-03-15T20:25:34.563+00:00

    Hi @Michelangelo Stillante ,

    There is no NAT component involved in a Site-To-Site Azure VPN Gateway connection.
    If you connect your local network via VPN Gateway Site To Site connection it is almost like you connect 2 networks via a layer 3 router. If both networks using the same subnet IP range routing isn't possible.

    Basically that's the simple answer to your question.

    If you connect local subnet with the Azure subnet with not-overlapping IP ranges the following will happen:

    • In the local subnet (for instance 192.168.1.0/24) a route to the Azure Subnet (10.0.0.0/24) will be added to send packages to the local Gateway VPN device
    • In the Azure subnet (10.0.0.0/24) a route to the local Subnet (192.168.0.0/24) will be added to send packages to the Azure VPN Gateway Site To Site connection
      This way network packages can be routed from Azure to local resources and vice versa.

    The VPN tunnel is using the public IP on both sides as connection point. If the VPN tunnel is established and connected between the 2 endpoints this tunnel is working like a "normal" layer 3 router between 2 subnets.

    ----------

    (If the reply was helpful please don't forget to upvote and/or accept as answer, thank you)

    Regards
    Andreas Baumgarten


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.