MyNixOS website logo
option

networking.jool.nat64

Definitions of NAT64 instances of Jool. See the documentation for the available options. Also check out the tutorial for an introduction to NAT64 and how to troubleshoot the setup.

The attribute name defines the name of the instance, with the main one being default: this can be accessed from the command line without specifying the name with -i.

Instances created imperatively from the command line will not interfere with the NixOS instances, provided the respective pool4 addresses and port ranges are not overlapping.
Changes to an instance performed via jool -i <name> are applied correctly but will be lost after restarting the respective jool-nat64-<name>.service.
Declarations
Type
attribute set of (JSON value)
Default
{ }
Example
{
  default = {
    # custom NAT64 prefix
    global.pool6 = "2001:db8:64::/96";

    # Port forwarding
    bib = [
      { # SSH 192.0.2.16 → 2001:db8:a::1
        "protocol"     = "TCP";
        "ipv4 address" = "192.0.2.16#22";
        "ipv6 address" = "2001:db8:a::1#22";
      }
      { # DNS (TCP) 192.0.2.16 → 2001:db8:a::2
        "protocol"     = "TCP";
        "ipv4 address" = "192.0.2.16#53";
        "ipv6 address" = "2001:db8:a::2#53";
      }
      { # DNS (UDP) 192.0.2.16 → 2001:db8:a::2
        "protocol" = "UDP";
        "ipv4 address" = "192.0.2.16#53";
        "ipv6 address" = "2001:db8:a::2#53";
      }
    ];

    pool4 = [
      # Port ranges for dynamic translation
      { protocol =  "TCP";  prefix = "192.0.2.16/32"; "port range" = "40001-65535"; }
      { protocol =  "UDP";  prefix = "192.0.2.16/32"; "port range" = "40001-65535"; }
      { protocol = "ICMP";  prefix = "192.0.2.16/32"; "port range" = "40001-65535"; }

      # Ports for static BIB entries
      { protocol =  "TCP";  prefix = "192.0.2.16/32"; "port range" = "22"; }
      { protocol =  "UDP";  prefix = "192.0.2.16/32"; "port range" = "53"; }
    ];
  };
}