How to preserve source IP in Azure Firewall

Ijaz Muhammad 81 Reputation points
2024-06-05T07:35:06.3033333+00:00

AzureDiagram

Our requirement is to preserve the source IP even when the traffic flows through the Azure firewall and then reaches the destination server. We should be able to see the source IP in the logs of the destination server instead of Azure firewalls IP as source IP.

The expectation is to preserve the source IP address.

Azure Firewall
Azure Firewall
An Azure network security service that is used to protect Azure Virtual Network resources.
703 questions
Azure Firewall Manager
Azure Firewall Manager
An Azure service that provides central network security policy and route management for globally distributed, software-defined perimeters.
97 questions
{count} votes

Accepted answer
  1. KapilAnanth-MSFT 48,081 Reputation points Microsoft Employee
    2024-06-05T09:50:28.9033333+00:00

    @Ijaz Muhammad, Gnrgy ,

    Welcome to the Microsoft Q&A Platform. Thank you for reaching out & I hope you are doing well.

    I understand that you would like to preserve the source IP of the incoming DNAT rules via Azure Firewall.

    Since DNAT happens at Layer 4, the actual source IP is not preserved by the Azure Firewall.

    This is by design.

    To work around this, you can consider using Azure Application Gateway in front of the Azure Firewall and make use of the X-Fowarded-For header added by App gateway.

    Hope this clarifies.

    Cheers,

    Kapil

    1 person found this answer helpful.

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.