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/destination-nat-exampleone-to-one-mapping, 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.
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
... View more