Stateful NAT64 Translation

The stateful NAT64 feature enables communication between IPv6 clients and IPv4 servers through IPv6 to IPv4 packet translation, and vice versa, while maintaining session information on the NetScaler appliance.

A stateful NAT64 configuration on the NetScaler appliance has the following components:

  • NAT64 rule— An entry consisting of an ACL6 rule and a netprofile, which consists of a pool of NetScaler owned SNIP Addresses.
  • NAT64 IPv6 Prefix— A global IPv6 prefix of length 96 bits (128-32=96) configured on the appliance. Note: Currently the NetScaler appliance supports only one prefix to be used commonly with all NAT 64 rules.

The NetScaler appliance considers an incoming IPv6 packet for NAT64 translation when all of the following conditions are met:

  • The incoming IPv6 packet matches the ACL6 rule bound to a NAT64 rule.
  • The destination IP address of the IPv6 packet matches the NAT64 IPv6 prefix.

When an IPv6 request packet received by the NetScaler appliance matches an ACL6 defined in a NAT64 rule and the destination IP of the packet matches the NAT64 IPv6 prefix, the NetScaler appliance considers the IPv6 packet for translation.

The appliance translates this IPv6 packet to an IPv4 packet with a source IP address matching one of the IP address bound to the netprofile defined in the NAT64 rule, and a destination IP address consisting of the last 32 bits of the destination IPv6 address of the IPv6 request packet. The NetScaler appliance creates a NAT64 session for this particular flow and forwards the packet to the IPv4 server. Subsequent responses from the IPv4 server and requests from the IPv6 client are translated accordingly by the appliance, on the basis of information in the particular NAT64 session.

Consider an example in which an enterprise hosts site www.example.com on server S1, which has an IPv4 address. To enable communication between IPv6 clients and IPv4 server S1, NetScaler appliance NS1 is deployed with a stateful NAT64 configuration that includes a NAT64 rule and a NAT64 prefix. A mapped IPv6 address of server S1 is formed by concatenating the NAT64 IPv6 prefix [96 bits] and the IPv4 source address [32 bits]. This mapped IPv6 address is then manually configured in the DNS servers. The IPv6 clients get the mapped IPv6 address from the DNS servers to communicate withIPv4 server S1.

nat64

The following table lists the settings used in this example: Stateful NAT64 translation example settings.

Following is the traffic flow in this example:

  1. IPv6 client CL1 sends a request packet to Map-Sevr-IPv6 (2001:DB8:300::192.0.2.60) address.

  2. The NetScaler appliance receives the request packet. If the request packet matches the ACL6 defined in the NAT64 rule, and the destination IP address of the packet matches the NAT64 IPv6 prefix, the NetScaler considers the IPv6 packet for translation.

  3. The appliance creates a translated IPv4 request packet with:

    • Destination IP address field containing the NAT64 prefix stripped from the destination address of the IPv6 request (Sevr_IPv4 = 192.0.2.60)
    • Source IP address field containing one of the IPv4 address bound to Netprofile-1(in this case, 192.0.2.100)
  4. The NetScaler appliance creates a NAT64 session for this flow and sends the translated IPv4 request to server S1.

  5. IPv64 server S1 responds by sending an IPv4 packet to the NetScaler appliance with:

    • Destination IP address field containing 192.0.2.100
    • Source IP address field containing the address ofSevr_IPv4(192.0.2.60)
  6. The appliance receives the IPv4 response packet, searches all the session entries, and finds that the IPv6 response packet matches the NAT64 session entry created in step 4. The appliance considers the IPv4 packet for translation.

  7. The appliance creates a translated IPv6 response packet with:

    • Destination IP address field=Client_IPv6=2001:DB8:5001::30
    • Source IP address field = Concatenation of NAT64 Prefix (First 96 bits) and Sevr_IPv4 (last 32 bits) =2001:DB8:300::192.0.2.60
  8. The appliance sends the translated IPv6 response to client CL1.

Limitations of Statelful NAT64

The following limitations apply to stateful NAT64:

  • Translation of IPv4 options is not supported.
  • Translation of IPv6 routing headers is not supported.
  • Translation of hop-by-hop extension headers of IPv6 packets is not supported.
  • Translation of ESP and EH headers of IPv6 packets is not supported.
  • Translation of multicast packets is not supported.
  • Packets of Stream Control Transmission Protocol (SCTP), Datagram Congestion Control Protocol (DCCP), and IPSec, are not translated.

Configuring Stateful NAT64

Creating the required entities for stateful NAT64 configuration on the NetScaler appliance involves the following procedures:

  1. Add an ACL6 rule with action ALLOW.
  2. Add an ipset, which binds multiple IP addresses.
  3. Add a netprofile and bind the ipset to it. If you want to bind only one IP address, you need not create an ipset entity. In that case, bind the IP address directly to the netprofile.
  4. Add a NAT64 rule, which includes binding the ACl6 rule and the netprofile to the NAT 64 rule.
  5. Add a NAT64 IPv6 prefix.

NetScaler command line procedures

To add an ACL6 rule by using the NetScaler command line:

At the command prompt, type:

  • add ns acl6 <acl6name> <acl6action> …

To add an IPset and bind multiple IPs to it by using the NetScaler command line:

At the command prompt, type:

  • add ipset <name>
  • bind ipset <name> <IPaddress …>

To add a netprofile by using the NetScaler command line:

At the command prompt, type:

  • add netprofile <name> -srcIP <IPaddress or IPset>

To add a NAT64 rule by using the NetScaler command line:

At the command prompt, type:

  • add nat64 <name> <acl6name> -netProfile <string>

To add a NAT64 prefix by using the NetScaler command line:

At the command prompt, type:

  • set ipv6 -natprefix <ipv6_addr *>

Example:

 > add acl6 ACL6-1 ALLOW -srcIPv6 2001:DB8:5001::30
 Done

> apply acls6
 Done

> add ip 192.0.2.100 255.255.255.0 –type SNIP
 Done

> add ip 192.0.2.102 255.255.255.0  –type SNIP
 Done

> add ipset IPset-1
 Done

> bind ipset IPset-1 192.0.2.100 192.0.2.102
IPAddress "192.0.2.100" bound
IPAddress "192.0.2.102" bound
 Done

> add netprofile Netprofile-1 -srcIP IPset-1
 Done

> add nat64 NAT64-1 ACL6-1 -netprofile Netprofile-1
 Done

> set ipv6 -natprefix 2001:DB8:300::/96
 Done

NetScaler GUI procedures

To add a NAT64 rule by using the NetScaler GUI:

Navigate to System > Network > Routes > NAT64, and a new NAT64 rule, or edit an existing rule.

To add a NAT64 prefix by using the NetScaler GUI:

Navigate to System > Network, in the Settings group, click Configure INAT Parameters, and set the Prefix parameter.

Stateful NAT64 Translation