Palo Alto Networks NAT Policies: PCNSE Essentials

Network Address Translation (NAT) is a fundamental concept in modern networking and a critical component of Palo Alto Networks firewall configuration.

NAT allows devices using private IP addresses (like those defined in RFC 1918) to communicate with external networks (like the internet) which use public IP addresses. This article focuses on the NAT concepts and configurations most relevant for PCNSE candidates.

The PCNSE exam tests your ability to deploy and configure core firewall components, including NAT policies for both IPv4 and IPv6. Key areas include understanding NAT types, configuration parameters, packet flow logic, and the interplay between NAT and Security rules.

IPv4 NAT Types in PAN-OS

PAN-OS supports several types of NAT to address various network requirements. Understanding the purpose and configuration of each is crucial.

Be able to identify the correct NAT type based on a scenario description (e.g., internal users accessing the internet -> SNAT DIPP; external users accessing internal web server -> DNAT Static). Understand the differences between Static, Dynamic IP, and DIPP/PAT.

Dynamic IP and Port (DIPP) NAT Oversubscription

When using DIPP NAT, especially with a single translated IP address (like the egress interface IP), a potential issue is port exhaustion . A single IPv4 address has 65,535 possible TCP/UDP ports. When many internal clients initiate outbound connections, the firewall must assign a unique translated source port for each session originating from the shared public IP. In high-traffic environments, the available ports can be depleted, preventing new connections.

To mitigate this, PAN-OS implements DIPP NAT Oversubscription . This feature allows the firewall to reuse the same translated IP address and port combination multiple times for concurrent sessions, effectively multiplying the available session capacity.

Key Points about Oversubscription:

Configuration Path: Device > Setup > Session > Session Settings > NAT Oversubscription Rate
For the PCNSE, understand *why* oversubscription exists (port exhaustion), *how* it works (reusing IP:Port based on unique 5-tuple), where it's configured (globally in Session Settings), and the implications (scalability vs. resources). Know the typical rates (1x, 2x, 4x, 8x).

Understanding the 256 Translated IP Addresses Limit per NAT Rule

A specific limitation within PAN-OS NAT configuration is that a single NAT policy rule can reference a maximum of 256 unique translated IP addresses in its translated packet definition. This applies to the pool of addresses configured for source or destination translation within that one rule.

Implications:

Example:

An administrator needs to configure Source NAT for internal users using a public IP block of 203.0.113.0/23 (which contains 512 addresses). They cannot create a single NAT rule using 203.0.113.0/23 as the translated address pool.

Solution: Create two separate NAT rules:

  1. Rule 1: Matches the original traffic, translates using pool 203.0.113.0/24 (256 IPs).
  2. Rule 2: Matches the same original traffic, translates using pool 203.0.114.0/24 (256 IPs).

Place these rules adjacent to each other. The firewall will distribute sessions across the pools defined in these rules.

Remember the 256 translated IP address limit *per NAT rule*. Be prepared for questions that might involve designing NAT configurations with larger IP pools, requiring multiple rules.

IPv6 NAT Support (NAT64 and NPTv6)

While IPv6 aims to reduce the need for NAT due to its vast address space, specific scenarios still require translation mechanisms, which PAN-OS supports.

Note: PAN-OS supports NAT64 and NPTv6. It does not implement stateful NAT66 (IPv6-to-IPv6 address and port translation).
Understand the purpose of NAT64 (IPv6-to-IPv4 communication) and NPTv6 (stateless IPv6 prefix translation). Know that PAN-OS supports these but not stateful NAT66.

NAT Policy Configuration

NAT rules are configured under Policies > NAT in the PAN-OS web interface or via CLI.

Each NAT rule consists of two main parts:

  1. Original Packet Tab: Defines the traffic to be matched for potential translation. Key criteria include:
    • Source Zone(s)
    • Destination Zone
    • Destination Interface (Optional, useful for specificity, especially with multiple paths/ISPs)
    • Service (e.g., tcp/80, any)
    • Source Address(es)
    • Destination Address(es)
    The Source and Destination Zones specified here are based on the routing lookup for the original (pre-NAT) source and destination IP addresses.
  2. Translated Packet Tab: Defines how the matched packet's addresses/ports should be translated upon egress. Key settings include:
    • Source Address Translation: Specifies the type (None, Dynamic IP and Port, Dynamic IP, Static IP) and the translated IP address(es) (Interface IP, specific address objects/pools).
    • Destination Address Translation: Specifies the type (typically Static IP for DNAT) and the translated IP address and optional port.
    • Bi-directional Option (for Static Source NAT)

Rule Ordering

NAT rules are processed sequentially from top to bottom . The firewall applies the first rule that matches the packet and stops processing further NAT rules for that session.

Know the key components of a NAT rule (Original Packet, Translated Packet tabs) and the critical importance of rule order (top-down, first match). Be prepared for questions involving placing rules correctly, especially "No NAT" rules.

Packet Processing Flow and NAT

Understanding where NAT fits into the overall PAN-OS packet flow is critical for both configuration and troubleshooting. Here's a simplified view relevant to NAT:

  1. Ingress: Packet arrives at an ingress interface. Basic validation occurs. The source zone is determined based on the ingress interface.
  2. Session Setup (Slow Path - First Packet):
    • Forwarding Lookup (Route Lookup): The firewall performs a route lookup based on the original destination IP address to determine the egress interface and initial destination zone.
    • NAT Policy Lookup: The firewall evaluates the NAT policy rules (top-down) based on the original packet's source zone, destination zone (determined in the previous step), source/destination IPs, etc.
      • If a matching NAT rule is found:
        • Destination NAT Check: If the rule involves Destination NAT, the firewall performs a *second* route lookup based on the translated (post-NAT) destination IP address . This second lookup determines the *final* destination zone used for the Security Policy evaluation.
        • Source NAT Check: If the rule involves Source NAT, the firewall checks for resource availability (e.g., IPs/ports in the pool) but doesn't apply the translation yet.
      • If no NAT rule matches, processing continues without planned translation.
    • Security Policy Lookup: The firewall evaluates Security Policy rules (top-down). Crucially, this lookup uses:
      • Original (Pre-NAT) Source and Destination IP addresses.
      • Source Zone (from ingress interface).
      • Final (Post-NAT) Destination Zone (determined after route lookups, considering potential DNAT).
    • Session Allocation: If allowed by Security Policy, a session is created in the session table, including the NAT translation details if applicable.
  3. Fast Path (Subsequent Packets): Packets belonging to an existing session bypass the lookups in the slow path and are processed based on the established session state.
  4. Forwarding/Egress: As the packet leaves the firewall via the egress interface, the actual NAT translation (changing IP addresses/ports in the packet header) is performed if specified in the matched NAT rule during session setup.
Key Takeaway: NAT policy is *evaluated* during session setup to determine *if* translation is needed and to find the correct post-NAT destination zone for security policy lookup. However, the actual IP/port translation in the packet header happens *at egress*. Security policy always evaluates based on the *original* IP addresses but the *final* destination zone.

Interaction with Security Policies

The interplay between NAT and Security policies is a frequent source of confusion and a common topic in PCNSE exam questions. Remember these critical points:

PCNSE Mnemonic: "Pre-NAT IP, Post-NAT Zone" Remember this when building Security Policies involving NAT.

Example: Destination NAT for Web Server

  • Internal Web Server: 192.168.10.100 (DMZ Zone)
  • Public IP for Server: 203.0.113.50 (Untrust Zone interface IP)
  • External Client: Any IP (Untrust Zone)

Configuration Steps:

  1. DNAT Rule:
    • Original Packet: Source Zone: Untrust, Dest Zone: Untrust, Dest IP: 203.0.113.50
    • Translated Packet: Dest Translation IP: 192.168.10.100
    Note: The NAT rule destination zone is 'Untrust' because the *original* destination IP (203.0.113.50) is routed via the Untrust interface/zone.
  2. Security Policy Rule:
    • Source Zone: Untrust
    • Source Address: Any
    • Destination Zone: DMZ (This is the Post-NAT zone, where 192.168.10.100 resides)
    • Destination Address: 203.0.113.50 (This is the Pre-NAT IP the client targets)
    • Application/Service: http, https
    • Action: Allow
    Note: The Security rule destination zone is 'DMZ' (Post-NAT), but the destination address is '203.0.113.50' (Pre-NAT).
This interaction is crucial. Expect scenario questions where you need to identify the correct zones and addresses for a Security Policy rule when NAT is involved. Focus on "Pre-NAT IP, Post-NAT Zone".

NAT Best Practices

Following best practices ensures efficient, manageable, and secure NAT configurations:

Best practices often translate into exam questions focusing on efficient and secure configuration. Pay attention to rule ordering and the use of specific matching criteria.

Sequence diagram illustrating packet flow, highlighting NAT evaluation, the second route lookup for DNAT, security policy evaluation using pre-NAT IPs/post-NAT zone, and NAT application at egress.

Diagram: Simplified NAT Type Decision Flowchart

This flowchart outlines basic logic for choosing a NAT type.

Simplified flowchart for selecting an appropriate NAT type based on traffic direction and requirements.

Diagram: NAT Session State

Illustrates possible states related to NAT during session setup.

State diagram showing simplified NAT states during session establishment and application at egress.

Diagram: NAT Relationship Graph (DIPP Example)

Visualizes multiple internal clients sharing a single public IP via DIPP NAT.

Graph showing multiple internal clients being translated to a single public IP using different source ports (DIPP/PAT).

PCNSE Exam Focus Summary for NAT

Based on the PCNSE objectives and common discussion points, focus on these NAT areas for the exam:

Expect scenario-based questions requiring you to select the correct NAT type, determine the correct Security Policy parameters when NAT is involved, or identify the correct order for NAT rules.

Potential PCNSE Questions (Based on Web Findings)

Based on online discussions, practice exams, and study guides, here are examples of the *types* of questions you might encounter related to NAT:

  1. An administrator configures a Destination NAT rule to translate public IP 203.0.113.10 (Untrust Zone) to internal server 10.1.1.50 (DMZ Zone). What should the Destination Zone and Destination Address be in the corresponding Security Policy rule allowing external users (Untrust Zone) access? (Hint: Pre-NAT IP, Post-NAT Zone).
  2. Which type of Source NAT allows multiple internal clients to share a single translated IP address by modifying the source port? (Hint: DIPP).
  3. An administrator needs to ensure server 192.168.5.10 is *never* subject to source NAT, while all other hosts in the 192.168.5.0/24 network use DIPP NAT for internet access. How should the NAT rules be ordered? (Hint: Specific "No NAT" rule first).
  4. Where in the PAN-OS GUI is the DIPP NAT Oversubscription rate configured? (Hint: Device > Setup > Session).
  5. A firewall is configured with DIPP NAT using the egress interface IP address. Users report intermittent connection failures during peak hours. What is a likely cause? (Hint: Port Exhaustion).
  6. Which NAT type provides a stateless 1:1 mapping between IPv6 prefixes, preserving the host identifier? (Hint: NPTv6).
  7. When does the actual modification of IP addresses and ports occur for a packet matching a NAT rule? (Hint: At egress).
  8. What is the maximum number of translated IP addresses that can be configured within a single NAT rule's translated address pool? (Hint: 256).
  9. An internal user (10.10.10.5) needs to access an internal web server (10.20.20.5) using its public IP address (203.0.113.20). What type of NAT configuration is required? (Hint: U-Turn NAT, likely needing DNAT and maybe SNAT).
  10. True or False: A NAT policy rule itself can permit or deny traffic flow through the firewall. (Hint: False, Security Policy does this).

Focus on the interaction between NAT rules and Security rules, the specific use cases for each NAT type, and key configuration parameters like Oversubscription.

PCNSE Style Quiz: PAN-OS NAT

Test your understanding with these 20 questions:

1. When evaluating a Security Policy rule for traffic subject to NAT, which IP addresses are used for matching?

2. For traffic subject to Destination NAT, which Destination Zone is used when evaluating the Security Policy rule?

3. Which NAT type is most commonly used to allow multiple internal users to access the internet using a single public IP address?

4. What is the primary purpose of DIPP NAT Oversubscription?

5. How are NAT rules processed by the PAN-OS firewall?

6. You need to publish an internal web server (10.0.0.10) using the public IP 203.0.113.20. Which NAT type is most appropriate?

7. Where is the actual translation of IP addresses/ports applied to a packet?

8. An administrator wants to prevent a specific server (192.168.1.5) from using the general outbound NAT rule that applies to the 192.168.1.0/24 subnet. What NAT rule configuration achieves this?

9. What is the maximum number of translated IP addresses allowed within a single NAT rule definition?

10. Which IPv6 NAT mechanism translates only the network prefix while keeping the host portion of the address unchanged?

11. In a Destination NAT scenario, the original destination zone (used for NAT rule matching) is determined by a route lookup of which IP address?

12. Where is the global DIPP NAT Oversubscription rate configured in PAN-OS?

13. A company uses U-Turn NAT to allow internal clients (Trust zone, 10.1.1.0/24) to access an internal server (DMZ zone, 10.2.2.5) via its public IP (Untrust zone, 203.0.113.5). What destination zone should typically be used in the Security Policy rule allowing this traffic?

14. Which NAT type creates a persistent one-to-one mapping between an internal IP and an external IP?

15. What component primarily determines if traffic is allowed or denied between zones, even if NAT is configured?

16. When configuring Source NAT using the 'Dynamic IP and Port' type, what does selecting 'Interface Address' for the translated address achieve?

17. What technology allows IPv6-only clients to communicate with IPv4-only servers?

18. You need to ensure traffic from internal network 10.5.0.0/16 to internal network 10.6.0.0/16 does NOT get NATted, while all other outbound traffic uses DIPP. Which rule should be placed higher in the NAT policy?

19. Setting the DIPP NAT oversubscription rate higher (e.g., from 1x to 8x) primarily increases the firewall's capacity for:

20. An administrator configures a Destination NAT rule for a web server. Users report they cannot access the server. The NAT rule configuration appears correct. What is the most likely *other* configuration area to check first?