Outbound NAT on private network through Azure firewall

Cyril P 26 Reputation points
2022-07-20T15:29:34.223+00:00

Hello,

I'm currently setting a new azure environment and I'm having troubles to understand what is the best course of action here.

I have a Vnet with 2 subnets, Subnet 1 for Azure firewall and Subnet 2 for Azure VM.

I want my VMs to be able to communicate outbound but only going through the Azure Firewall. I made a default route 0.0.0.0/0 with next hop on the firewall private address using this tutorial : https://video2.skills-academy.com/en-us/azure/firewall/tutorial-firewall-deploy-portal

I currently have 2 issues :

  • I can't ping anything outside even if I put a rule in my firewall allowing any outbound traffic (for example 8.8.8.8) but I can access internet.
  • Once I'm out, I realized that outside I'm seen with my private ip address while I would like to be seen with the public address from my firewall only.

I don't know if I'm actually supposed to use a NAT Gateway so I'll use the firewall public IP for Inbound and the NAT Gateway for Outbound or if I can change something on my network to change this parameter ?

I thought SNAT in the firewall strategy settings would work but apparently not.

Thank you for your help !

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
7,807 questions
Azure Firewall
Azure Firewall
An Azure network security service that is used to protect Azure Virtual Network resources.
656 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,409 questions
0 comments No comments
{count} votes

4 answers

Sort by: Most helpful
  1. msrini-MSFT 9,281 Reputation points Microsoft Employee
    2022-07-20T15:39:13.387+00:00

    Hi,

    You will not need NAT gateway. Azure Firewall can perform SNAT and send Internet traffic. You will need to create a Network rule to allow outbound traffic to Internet explicitly. Can you try post creating outbound access rule ?

    Regards,
    Karthik Srinivas

    1 person found this answer helpful.
    0 comments No comments

  2. Cyril P 26 Reputation points
    2022-07-21T09:41:09.633+00:00

    Hello,

    Thank you for answering !

    Here is the rule I created :

    223039-outbound-rule.jpg

    I can contact internet from this subnet but as I said previously any ping is dropped and my private address can be seen when reaching outside.

    Have a nice day !

    0 comments No comments

  3. NaderBaky 1 Reputation point
    2022-07-27T08:39:35.05+00:00

    Hi,

    For the ping issue, if you are able to reach the internet, then ICMP might be blocked by an NSG applied on the NIC or the subnet of the VM.

    For the private IP issue, It believe it is practically impossible to reach any destination on the internet with your private IP, so assuming from the first issue that you can reach the internet through Azure FW that means that you are successfully NATed. Please advise how you are assuming that you are discovered outside by your private IP address ? And please confirm also that your destination is public, not private using a VPN gateway or any tunneling to reach it.

    Best regards,


  4. NaderBaky 1 Reputation point
    2022-07-28T08:49:09.48+00:00

    Hi,

    I will need to understand the setup more, how the firewall is integrated with the NAT Gateway ? Are they both having public IPs and can be a gateway to the internet ?

    However, if you can ping private IP only and not public IPs outside. I would guess that your issue that the return traffic is taking a different path internally and couldn't be deNATed on the FW. Azure FW is performing SNAT by default for any outgoing traffic hitting a network rule and destined only to public IPs. You can try disabling the SNAT from the firewall as a work around and check if this solves the issue then you have asymmetric routing issue that need to be resolved.


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.