How can I add a DNAT rule in Azure Firewall policy for incoming traffic to a specific IP address with a port range?

Fernando F 20 Reputation points
2025-05-22T12:57:58.6266667+00:00

I'm trying to add a DNAT (Destination Network Address Translation) rule in Azure Firewall policy for incoming traffic to a specific IP address with a port range but encountering an issue where can't add a port range, only single ports.

User's image

If this is not possible, what is the alternate way for doing this?

Azure Firewall
Azure Firewall
An Azure network security service that is used to protect Azure Virtual Network resources.
{count} votes

Accepted answer
  1. Sindhuja Dasari 1,520 Reputation points Microsoft External Staff Moderator
    2025-05-22T13:52:58.8966667+00:00

    Hello Fernando F

    I understand that you're trying to specify the port range and facing challenges. Azure Firewall DNAT rules currently do not support specifying a port range.

    Azure Firewall is a robust, cloud-native network security service that provides stateful firewall capabilities, including DNAT rules for inbound traffic. However, DNAT rules in Azure Firewall require explicit port mappings, meaning you cannot use wildcards or ranges for ports. This limitation necessitates creating a separate DNAT rule for each port.

    Azure Firewall supports only 250 DNAT rules, if the requirement is below that- you could manually create a separate rule for each port in the Portal or use Azure CLI, PowerShell loop to automate the creation. If there are more than 250 rules, this approach is not feasible.

    To overcome this limitation, you can leverage Azure Load Balancer if your goal is port forwarding - Unlike Azure Firewall, Load Balancer does not require explicit port mappings for NAT. Useful link to refer - https://learn.microsoft.com/en-us/azure/load-balancer/tutorial-load-balancer-port-forwarding-portal

    This limitation is documented by Microsoft and feature request has been raised by the community- but as of now, port range support for DNAT rules is not yet available.

    Refer https://learn.microsoft.com/en-us/answers/questions/2181441/why-does-azure-firewall-dnat-rules-does-not-allow


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


0 additional answers

Sort by: Most helpful

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.