Hello MatthewHendry-4985
Please check below details on DNAT rules and brief:
1.Does the use of a public IP address in a DNAT rule reserve that PIP only for use in DNAT flows?
- No, a public IP address used in a DNAT rule is not reserved exclusively for DNAT flows. All public IP addresses associated with the Azure Firewall are available for both DNAT (inbound) and SNAT (outbound) operations, unless explicitly configured otherwise (e.g., by using a NAT Gateway for SNAT). https://learn.microsoft.com/en-us/azure/firewall/features Explanation: Azure Firewall does not segregate public IP addresses between DNAT and SNAT. A public IP used in a DNAT rule can still be selected randomly for SNAT unless the DNAT rule is actively handling traffic, in which case port availability may influence SNAT selection (see next question). This is why Microsoft recommends allowing all associated public IPs in downstream filtering.
2.Azure Firewall randomly selects from its pool of public IP addresses for SNAT, and this selection is independent of DNAT rule usage. However, Azure Firewall is stateful, so it avoids port conflicts by tracking active connections.
For example, if a DNAT rule uses a specific public IP and port (e.g., 13.xx.xxx.xxx:3389), SNAT will not use that exact IP/port combination for outbound traffic while the DNAT connection is active.
To ensure a specific public IP is used for SNAT (and avoid DNAT IPs), you can integrate a NAT Gateway with the firewall’s subnet, which will handle all outbound traffic using the NAT Gateway’s public IP(s). Refer: https://learn.microsoft.com/en-us/azure/firewall/integrate-with-nat-gateway
3.The 250 limit refers to the combined total of public IP addresses and unique destinations (where a unique destination is a public IP + port + protocol combination in a DNAT rule). Each DNAT rule with a distinct port count as a separate unique destination, even if it uses the same public IP, because each rule consumes firewall resources for stateful tracking. Thus, one public IP with two DNAT rules (different ports) counts as one public IP + two unique destinations, reducing the remaining limit by three (250 - 3 = 247).
One of the challenges with using a large number of public IP addresses with Azure Firewall is when there are downstream IP address filtering requirements. Azure Firewall randomly selects the source public IP address to use for a connection, so you need to allow all public IP addresses associated with it. Even if you use Public IP address prefixes and you need to associate 250 public IP addresses to meet your outbound SNAT port requirements, you still need to create and allow 16 public IP address prefixes.
As of today, Azure Firewall doesn't allow selection of a dedicated Public IP for SNAT outbound connections, and the IP address is selected randomly.
Hope this clears things up! If you have more specific scenarios or need further assistance, feel free to ask!
If the above is unclear or you are unsure about something, please add a comment below. If an answer has been helpful, please consider accepting the answer to help increase visibility of this question for other members of the Microsoft Q&A community. If not, please let us know what is still needed in the comments so the question can be answered. Thank you for helping to improve Microsoft Q&A!