How can I configure NAT on my VM subnets to route traffic through a single allowed IP address for accessing the client's system via the Site-to-Site VPN?

Faisal Kabeer 20 Reputation points
2025-01-21T11:54:54.6233333+00:00

I have established a Site-to-Site VPN connection with my client, and it is active. However, when using my VM in the default subnet, I am unable to access the client's system because the client has permitted only one IP address. Therefore, I need to configure NAT on my VM subnets to route traffic through the allowed IP address to reach the client.

How can I NAT my source address in Azure?

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,622 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.
44 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Rohith Vinnakota 2,090 Reputation points Microsoft Vendor
    2025-01-24T10:20:47.9066667+00:00

    Hi @Faisal Kabeer,

    Sorry for delay.

    You can achieve this using Azure Firewall. First, create the firewall and the route table to direct all on-premises traffic through the firewall. Then, create a DNAT rule in the firewall.

    How to create firewall refer this doc: https://learn.microsoft.com/en-us/azure/firewall/tutorial-firewall-deploy-portal-policy#deploy-the-firewall-and-policy

    How to create the route table: https://learn.microsoft.com/en-us/azure/virtual-network/manage-route-table#create-a-route-table

    Please associate this route table with the default VM subnet.

    In the firewall we have to create the DNAT rule.

    Configure a NAT rule

    1. Select Add NAT rule collection.
    2. For Name, type RC-DNAT-01.
    3. For Priority, type 200.
    4. Under Rules, for Name, type RL-01.
    5. For Protocol, select TCP.
    6. For Source type, select IP address.
    7. For Source, type your default subnet ip.
    8. For Destination Addresses, type the firewall's public or private IP address.
    9. For Destination ports, type 3389.
    10. For Translated Address type the private IP address for the Srv-Workload virtual machine.
    11. For Translated port, type 3389.
    12. Select Add.

    Refer this doc: https://learn.microsoft.com/en-us/azure/firewall/tutorial-firewall-dnat

    Using the private of the firewall you can connect the client system.

    Note: If use firewall you have to allow necessary traffic.


    Hope this clarifies!

    If above is unclear and/or you are unsure about something add a comment below.

    Please don’t forget to close the thread by clicking "Accept the answer" wherever the information provided helps you, as this can be beneficial to other community members.

    Regards,

    Rohith

    0 comments No comments

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.