Hello Peter Stieber
Please find below details:
When a DNAT rule is matched in Azure Firewall, is source NAT (SNAT) always applied — regardless of the SNAT configuration defined in Azure Firewall SNAT behavior for private IP ranges?
1.Yes, when a DNAT rule is matched, SNAT is typically applied. SNAT is typically applied to the source IP address. The source IP is translated to one of the firewall’s internal IPs (from the AzureFirewallSubnet
), even if the destination is a private IP.
- This behavior is by design to ensure return traffic flows back through the firewall, maintaining session state.
So yes, SNAT is applied even when a DNAT rule is matched, unless explicitly configured otherwise.
Does Azure Firewall always apply SNAT when the destination is a public IP address, even if SNAT is explicitly set to "never"? In my lab testing, I observe that SNAT is still applied in such cases. I have a UDR on FW subnet that redirects traffic for specific public IP ranges to another NVA, and the firewall still performs SNAT even when it's configured not to
2.Azure Firewall automatically applies SNAT for outbound traffic to public IP addresses, regardless of SNAT settings, unless:
- You explicitly define
0.0.0.0/0
in the private IP address ranges configuration to disable SNAT globally.
This means If your destination is a public IP and SNAT is set to "never" but 0.0.0.0/0
is not included in the private IP ranges, SNAT will still occur.
- This explains your lab observation — SNAT is still applied because Azure treats public IP destinations as requiring SNAT by default.
3.In forced tunneling mode, azure Firewall still performs SNAT — typically to one of its private IPs. This is done to maintain session state and ensure return traffic is routed correctly.
Even without a public IP, SNAT is applied unless you configure the firewall to never SNAT by setting 0.0.0.0/0
as a private IP range.
However, DNAT is not supported in forced tunneling mode unless the firewall has a Management NIC with a public IP
Refer: https://learn.microsoft.com/en-us/azure/firewall/forced-tunneling
I hope this helps! If these answers your query, do click the "Upvote" and click "Accept the answer" of which might be beneficial to other community members reading this thread.
If the above is unclear or you are unsure about something, please add a comment below.