Understanding NAT64 on Palo Alto Networks Firewalls

As the world transitions to IPv6, scenarios arise where IPv6-only clients need to communicate with legacy IPv4-only servers or resources. NAT64 is a crucial transition mechanism that enables this communication by translating IP headers between IPv6 and IPv4 networks.

What is NAT64?

NAT64 is a stateful Network Address and Protocol Translation technology defined in RFC 6146. Its primary purpose is to allow clients using only IPv6 addresses to initiate connections to servers using only IPv4 addresses.

How NAT64 Works (with DNS64)

NAT64 typically works in conjunction with a DNS64 server (defined in RFC 6147).

  1. An IPv6-only client wants to reach `www.example-ipv4.com`. It sends a DNS query for an AAAA (IPv6) record.
  2. The DNS64 server receives the query. It first looks for an actual AAAA record.
  3. If no AAAA record exists, the DNS64 server queries for an A (IPv4) record (e.g., gets 192.0.2.100 ).
  4. The DNS64 server then synthesizes an AAAA record by embedding the IPv4 address within a specific, configured NAT64 Prefix . A common well-known prefix is 64:ff9b::/96 . The synthesized IPv6 address might look like 64:ff9b::192.0.2.100 (or 64:ff9b::c000:0264 in hex).
  5. The DNS64 server returns this synthesized AAAA record to the IPv6 client.
  6. The IPv6 client initiates a connection to the synthesized IPv6 address ( 64:ff9b::c000:0264 ).
  7. Traffic is routed towards the NAT64 gateway (the Palo Alto firewall).
  8. The firewall matches the traffic with a NAT64 policy rule.
  9. The firewall translates:
    • The IPv6 Source Address to an IPv4 Source Address (from its pool/interface).
    • The IPv6 Destination Address ( 64:ff9b::c000:0264 ) back to the original IPv4 Destination Address ( 192.0.2.100 ) by extracting the embedded IPv4 part based on the configured NAT64 prefix.
  10. The translated IPv4 packet is forwarded to the IPv4 server.
  11. Return traffic follows the reverse path, with the firewall translating addresses back based on the session state.

Palo Alto Implementation Details

NAT Policies are configured under: Policies > NAT

Configuring NAT64 involves creating a specific type of NAT rule:

Traffic Flow Example

Forward Path:

# Original Packet (Client -> Synthesized IPv6) Source IP: 2001:db8:1:1::100 Destination IP: 64:ff9b::198.51.100.50 (64:ff9b::c633:6432) # Packet After NAT64 (Firewall -> IPv4 Server) Source IP: 203.0.113.10 <-- SNAT Applied (IPv6 source translated) Destination IP: 198.51.100.50 <-- DNAT Applied (Synthesized IPv6 dest translated)

Return Path:

# Original Packet (IPv4 Server -> Firewall SNAT IP) Source IP: 198.51.100.50 Destination IP: 203.0.113.10 # Packet After Reverse NAT64 (Firewall -> IPv6 Client) Source IP: 64:ff9b::198.51.100.50 <--- Destination from forward flow becomes source Destination IP: 2001:db8:1:1::100 <--- Source from forward flow becomes destination

Interaction with Security Policy

Like other NAT types, NAT64 requires a corresponding Security Policy rule to allow the traffic. The Security Policy evaluation happens based on the original packet details but considering the destination zone where the packet will end up after routing/translation.

Key Point: The Security Policy rule must allow traffic from the IPv6 source zone to the IPv4 destination zone, but critically, the Destination Address in the Security Policy rule should generally match the NAT64 Prefix (e.g., 64:ff9b::/96 ).

Why use the prefix? Because the Security Policy lookup needs to match the destination the firewall initially sees *before* the final IPv4 translation occurs. The firewall uses the NAT64 prefix in the original destination to identify NAT64 traffic.

Example Security Rule:


NAT64 Quiz

1. What is the primary problem that NAT64 is designed to solve?

2. Which component is typically required alongside a NAT64 gateway to allow IPv6-only clients to discover IPv4-only services using domain names?

3. When configuring a NAT rule on a Palo Alto firewall specifically for NAT64 translation, what should the "NAT Type" be set to on the General tab?

4. To allow traffic handled by a NAT64 rule, what should typically be configured as the Destination Address in the corresponding Security Policy rule?

5. In the forward path of a NAT64 translation (IPv6 client -> IPv4 server), which addresses are translated by the NAT64 policy on the firewall?