PAN-OS NAT64 Explained (PCNSE Focus)

As networks increasingly adopt IPv6, the need for interoperability between IPv6-only segments and the vast number of remaining IPv4-only resources becomes critical. NAT64, often paired with DNS64, provides a vital translation mechanism to bridge this gap. Understanding NAT64 principles, configuration, and its interaction with security policies on Palo Alto Networks firewalls is an important topic for the PCNSE exam.

This article provides a comprehensive explanation of NAT64 on PAN-OS, focusing on the concepts and details relevant for PCNSE preparation, including configuration steps, traffic flow, and security considerations.

PCNSE candidates should understand the purpose of NAT64 as an IPv6 transition mechanism, how it works with DNS64, how to configure NAT64 policies on PAN-OS, and how corresponding Security Policies must be configured (especially regarding destination address matching).

What is NAT64?

NAT64 is a stateful Network Address and Protocol Translation technology, primarily defined in RFC 6146, designed to allow IPv6-only clients to initiate connections to IPv4-only servers . It acts as a gateway between IPv6 and IPv4 networks.

Key functions include:

Essentially, NAT64 makes IPv4-only servers appear as if they have IPv6 addresses to the IPv6-only clients.

Remember the core function: enabling IPv6-only clients to connect to IPv4-only servers. It's a stateful translation mechanism.

How NAT64 Works (Typically with DNS64)

While NAT64 handles the IP-level translation, clients need a way to discover the "IPv6 address" of an IPv4-only server. This is where DNS64 (RFC 6147) usually comes in.

Here's the typical process:

  1. Client DNS Query: An IPv6-only client wants to reach `www.ipv4-server.com`. It sends a DNS query for an AAAA (IPv6) record to its configured DNS server, which is often a DNS64 server.
  2. DNS64 Server Action:
    • The DNS64 server first attempts to resolve the AAAA record directly.
    • If no AAAA record exists, it queries for an A (IPv4) record (e.g., finds `198.51.100.10`).
    • The DNS64 server synthesizes an AAAA record by embedding the received IPv4 address (`198.51.100.10`) into a predefined NAT64 prefix.
    • NAT64 Prefix: This is a specific IPv6 prefix designated for NAT64 synthesis. The well-known prefix (WKP) is 64:ff9b::/96 , but network-specific prefixes (NSPs) can also be used.
    • Synthesized Address Example (using WKP): 64:ff9b::198.51.100.10 (often written in hex as 64:ff9b::c633:640a ).
  3. DNS Response to Client: The DNS64 server returns the synthesized AAAA record ( 64:ff9b::c633:640a ) to the IPv6 client.
  4. Client Initiates Connection: The client, unaware it's a synthesized address, initiates an IPv6 connection towards 64:ff9b::c633:640a .
  5. Routing to NAT64 Gateway: The network routes traffic destined for the NAT64 prefix towards the NAT64 gateway (the Palo Alto Networks firewall).
  6. NAT64 Gateway Translation: The firewall receives the IPv6 packet, identifies it as NAT64 traffic based on the destination address matching the configured NAT64 prefix, and performs the translation (details in the next section).
While you *can* use NAT64 without DNS64 (e.g., by manually configuring clients to use synthesized addresses), using DNS64 provides a seamless experience for IPv6-only clients trying to reach IPv4 resources via FQDNs. The Palo Alto firewall itself performs the NAT64 function; DNS64 is typically a separate server function (though some platforms might integrate it).
Understand the role of DNS64 in synthesizing AAAA records from A records using a NAT64 prefix. Know the well-known prefix (64:ff9b::/96). Remember that NAT64 and DNS64 are complementary technologies for this transition scenario.

PAN-OS NAT64 Configuration Details

Configuring NAT64 on a Palo Alto Networks firewall involves creating a specific type of NAT rule under Policies > NAT .

  1. Create NAT Rule: Click "Add".
  2. General Tab:
    • Rule Name: Descriptive name (e.g., `NAT64_Internal_to_Internet`).
    • NAT Type: Select nat64 from the dropdown.
    • Ensure the rule is Enabled.
  3. Original Packet Tab: Defines the IPv6 traffic entering the firewall that needs translation.
    • Source Zone: The zone containing the IPv6-only clients (e.g., `Zone_IPv6_Clients`).
    • Destination Zone: The zone towards which the translated IPv4 traffic will be routed (usually the zone holding the default IPv4 route, e.g., `Zone_Untrust_IPv4`).
    • Source Address: Typically `any` or a specific IPv6 prefix for your internal clients.
    • Destination Address: Crucially, set this to the NAT64 Prefix (e.g., `64:ff9b::/96` or your configured Network-Specific Prefix). This is how the firewall identifies traffic requiring NAT64 processing.
    • Service: Usually `any`, or specific services if needed.
  4. Translated Packet Tab: Defines how the source address is translated to IPv4.
    • Source Address Translation:
      • Type: Most commonly Dynamic IP and Port (for NAPT64).
      • Address Type: Choose either Interface Address (select the firewall's IPv4 interface in the destination zone) or Translated Address (select an Address Object representing an IPv4 pool).
      • Interface: Required if using Interface Address.
    • Destination Address Translation:
      • Type: None .
      • Important: Do NOT configure destination translation here. The firewall automatically extracts the destination IPv4 address from the original IPv6 destination based on the NAT64 prefix matched in the Original Packet tab.
  5. Click OK and Commit.
Key configuration points for PCNSE: Set NAT Type to `nat64`. Original Destination Address MUST be the NAT64 Prefix. Translated Destination Address MUST be `None`. Configure Source Address Translation to provide the IPv4 source IP (usually DIPP).

NAT64 Traffic Flow Example

Let's trace a packet using the following details:

Forward Path (Client -> Server)

  1. Client sends packet:
    • Source IP: 2001:db8:10:1::100
    • Destination IP: 64:ff9b::198.51.100.50 (Synthesized by DNS64)
  2. Firewall receives packet on IPv6_Trust interface.
  3. NAT rule lookup matches NAT64 rule (Original Dst Addr = 64:ff9b::/96).
  4. Security Policy lookup (Details next section).
  5. Firewall prepares to forward packet out IPv4_Untrust interface.
  6. NAT64 Applied at Egress:
    • Original Source 2001:db8:10:1::100 translated to 203.0.113.10 (plus a source port).
    • Original Destination 64:ff9b::198.51.100.50 translated to 198.51.100.50 (IPv4 extracted).
  7. Firewall sends packet:
    • Source IP: 203.0.113.10 (and translated port)
    • Destination IP: 198.51.100.50

Return Path (Server -> Client)

  1. Server sends reply packet:
    • Source IP: 198.51.100.50
    • Destination IP: 203.0.113.10 (Firewall's SNAT IP)
  2. Firewall receives packet on IPv4_Untrust interface.
  3. Firewall performs session lookup and finds the existing NAT64 session state.
  4. Security Policy lookup for return traffic.
  5. Firewall prepares to forward packet out IPv6_Trust interface.
  6. Reverse NAT64 Applied at Egress:
    • Original Source 198.51.100.50 translated back to 64:ff9b::198.51.100.50 .
    • Original Destination 203.0.113.10 (and port) translated back to 2001:db8:10:1::100 (and original port).
  7. Firewall sends packet:
    • Source IP: 64:ff9b::198.51.100.50
    • Destination IP: 2001:db8:10:1::100
Follow the translation logic: IPv6 Source becomes Firewall's IPv4; Synthesized IPv6 Destination becomes extracted IPv4. The reverse happens for reply traffic based on session state.

NAT64 Interaction with Security Policy

A common point of confusion is how to write the Security Policy rule to allow NAT64 traffic. As with all NAT, the Security Policy rule uses pre-NAT addresses but the final (post-NAT) destination zone .

For typical NAT64 (IPv6 client to IPv4 internet server):

Example Security Rule for NAT64

Given:

  • IPv6 Client Zone: `Internal_v6`
  • IPv4 Server Zone: `Internet_v4`
  • NAT64 Prefix Used: `64:ff9b::/96`

Security Rule Configuration:

  • Name: `Allow_NAT64_Outbound`
  • Source Zone: `Internal_v6`
  • Source Address: `any` (or specific IPv6 subnet)
  • Destination Zone: `Internet_v4`
  • Destination Address: `64:ff9b::/96` (Create an Address Object for this prefix)
  • Application: `any`
  • Service: `any`
  • Action: `Allow`
Crucial PCNSE takeaway: The Destination Address object used in the Security Policy rule allowing NAT64 traffic must match the NAT64 Prefix itself, not the specific IPv4 addresses of the servers being accessed. The Destination Zone, however, reflects the zone where the actual IPv4 servers reside.

Diagram: Sequence - DNS64 & NAT64 Interaction

Sequence diagram showing the combined flow involving DNS64 for discovery and NAT64 for translation.

Diagram: Flowchart - Simplified NAT64 Process

Simplified flowchart outlining the key steps in the NAT64 translation process on the firewall.

Diagram: Graph - NAT64 IP Address Relationships

Graph showing the relationship between the original IPs, the synthesized address, and the translated IPs during NAT64.

PCNSE Exam Focus Summary (NAT64)

For the PCNSE exam, concentrate on these NAT64 aspects:

Expect scenario questions where you need to identify the need for NAT64/DNS64, configure the NAT64 rule correctly (especially the destination address fields), and configure the corresponding Security Policy rule correctly (especially the destination address matching the prefix).

PCNSE Style Quiz: NAT64

Test your understanding with these 20 questions focused on NAT64:

1. What is the primary function of NAT64?

2. Which technology synthesizes AAAA records from A records using a specific prefix?

3. When configuring a NAT64 rule in PAN-OS, what must be selected as the 'NAT Type'?

4. What is the well-known prefix (WKP) commonly used for NAT64 synthesis?

5. In the 'Original Packet' tab of a PAN-OS NAT64 rule, what should the Destination Address typically be set to?

6. In the 'Translated Packet' tab of a PAN-OS NAT64 rule, what should the Destination Address Translation typically be set to?

7. Which Security Policy component uses the NAT64 Prefix for matching traffic?

8. NAT64 is considered what type of translation mechanism?

9. What does NAPT64 refer to?

10. In the return path of a NAT64 session (IPv4 server -> IPv6 client), what is the source IP address after the firewall applies reverse NAT64 translation?

11. Can a Palo Alto Networks firewall perform the DNS64 function directly?

12. For the Security Policy rule allowing NAT64 traffic, the Destination Zone should be:

13. Which RFC primarily defines the NAT64 translation mechanism?

14. You are configuring NAT64. In the 'Translated Packet' tab, which Address Type is most commonly used for Source Address Translation to support multiple clients?

15. True or False: A NAT64 rule requires a specific service object to be defined in the Original Packet tab.

16. If an IPv6 client sends traffic to an actual global IPv6 address (not a synthesized NAT64 address), will it match a NAT64 rule configured with the 64:ff9b::/96 prefix as the destination?

17. When troubleshooting NAT64 issues where clients cannot reach IPv4 servers, besides checking the NAT64 rule and Security Policy, what other related component is crucial to verify?

18. Can NAT64 be used to allow IPv4-only clients to initiate connections to IPv6-only servers?

19. What is a key difference between NAT64 and NPTv6?

20. You have configured a NAT64 rule. Which PAN-OS CLI command might be useful to verify if traffic is matching the rule and being translated?