Palo Alto NAT Rules
Source NAT (masquerade / IP pool), Destination NAT (DNAT/port-forwarding), and static NAT rules for Palo Alto PAN-OS firewalls.
What is it?
NAT (Network Address Translation) on Palo Alto rewrites IP addresses as packets traverse the firewall. Source NAT (SNAT) hides private internal IPs behind a public IP when users access the internet — the most common type is 'dynamic IP and port' (masquerade). Destination NAT (DNAT) redirects inbound traffic to an internal server — used for publishing web servers, exposing APIs, or port-forwarding. PAN-OS evaluates NAT rules before security policies — a packet is first matched to a NAT rule (translated), then the translated packet is matched to a security policy.
When to use
- ·Any time private RFC 1918 addresses (10.x, 172.16.x, 192.168.x) need to access the internet — requires source NAT
- ·Publishing internal servers to the internet (web server, mail server, VPN concentrator) — requires destination NAT
- ·Multi-ISP environments where you need to steer traffic through specific interfaces with different public IPs
- ·Moving servers to new IPs without changing external DNS — use static NAT as a transition
When NOT to use
- ·Site-to-site VPN traffic — VPN traffic must NOT be source-natted. Use a NAT exemption rule (no-nat) for VPN subnets.
- ·Internal server-to-server traffic within the same zone — NAT is only needed when crossing the firewall
How it compares
Prerequisites
- →Security zones must be defined before NAT rules reference them
- →Address objects for servers should be created first
- →For DNAT (inbound): a corresponding security policy must also allow the traffic from untrust to trust/DMZ zone
- →For VPN coexistence: create a 'no-nat' rule above the internet SNAT rule to exclude VPN subnets
Config Generator
Verification commands
show running nat-policyShow all active NAT rules in order
ExpectedLists all NAT rules with from/to zones, source, destination, and translation action
show session id <session-id>Show NAT translation details for a specific session
ExpectedShows pre-NAT and post-NAT source/destination IPs for the session
Debug commands
test nat-policy-match source <ip> destination <ip> to untrust from trust protocol 6 destination-port 80Test which NAT rule matches specific traffic
Common mistakes & fixes
Further learning
Recommended books to go deeper on this topic.
Palo Alto Networks Firewall Deployment and Administration
Tom Piens · Packt · PAN-OS NAT policies — source NAT, destination NAT, U-turn NAT