Precedence of Routing\NAT\Policy

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Precedence of Routing\NAT\Policy

L0 Member

Dear All,

 

Dear All,

 

I want to know what is correct precedence among Routing\NAT\Security Policy

 

So If a packet hits on the outside zone of the Firewall then whether below process is correct?

1. Whether FW has route for the destination\5.5.5.5 ( If YES)

2. Whether there is any NAT policy  (If YES) ( Assume -> After NAT, 5.5.5.5 translated to 6.6.6.6)

3. Then security policy should allow original destination IP(5.5.5.5)  or Translated  destination IP (6.6.6.6)

1 ACCEPTED SOLUTION

Accepted Solutions

Cyber Elite
Cyber Elite

Hi @ManinderNegi ,

 

Great question!  A good general rule is "Pre-NAT IP, post-NAT everything else."  For example, in this document -> https://docs.paloaltonetworks.com/pan-os/10-1/pan-os-networking-admin/nat/nat-configuration-examples... the IP in the security policy is pre-NAT, while the destination zone is post-NAT.  Scroll down to the bottom to see the NAT and security policy rules.

 

With regard to precedence, a good diagram is this one taken from the PCNSE study guide on Beacon.

 

TomYoung_0-1672709765443.png

 

Of the order you mentioned, the route lookup is done 1st (Forwarding Lookup).  Then the NAT policy lookup is 2nd (DNAT check).  However, NAT is not applied to the packets until the egress interface (Forward Traffic).  The forwarding/NAT lookup is necessary to determine the destination zone.  Then the security policy is checked last.  That is why the IP address in the security policy is pre-NAT.

 

Thanks,

 

Tom

Help the community: Like helpful comments and mark solutions.

View solution in original post

1 REPLY 1

Cyber Elite
Cyber Elite

Hi @ManinderNegi ,

 

Great question!  A good general rule is "Pre-NAT IP, post-NAT everything else."  For example, in this document -> https://docs.paloaltonetworks.com/pan-os/10-1/pan-os-networking-admin/nat/nat-configuration-examples... the IP in the security policy is pre-NAT, while the destination zone is post-NAT.  Scroll down to the bottom to see the NAT and security policy rules.

 

With regard to precedence, a good diagram is this one taken from the PCNSE study guide on Beacon.

 

TomYoung_0-1672709765443.png

 

Of the order you mentioned, the route lookup is done 1st (Forwarding Lookup).  Then the NAT policy lookup is 2nd (DNAT check).  However, NAT is not applied to the packets until the egress interface (Forward Traffic).  The forwarding/NAT lookup is necessary to determine the destination zone.  Then the security policy is checked last.  That is why the IP address in the security policy is pre-NAT.

 

Thanks,

 

Tom

Help the community: Like helpful comments and mark solutions.
Like what you see?

Show your appreciation!

Click Like if a post is helpful to you or if you just want to show your support.

Click Accept as Solution to acknowledge that the answer to your question has been provided.

The button appears next to the replies on topics you’ve started. The member who gave the solution and all future visitors to this topic will appreciate it!

These simple actions take just seconds of your time, but go a long way in showing appreciation for community members and the LIVEcommunity as a whole!

The LIVEcommunity thanks you for your participation!