TNAT64.CONF(5)
๐ฆ NAME ๐ฆ
okay so this is TNAT64.CONF(5), the manual page for tnat64.conf โ the literal configuration file for tnat64(8). she's a file-formats-manual girlie and she's here to spill ๐
โจ OVERVIEW โจ
bestie, the config for tnat64 can be anything. like, two lines. like, hundreds of lines. it fully depends on what your site needs at any given moment, no cap. the basic idea is simple tho: you define any networks this machine can reach directly over IPv4, and then you define one or many NAT64 prefixes to use for reaching everything else (including a default prefix, because of course there's a default ๐).
Local networks get declared with the local keyword in the config file. when an app tries to connect to a machine in a network marked as local, tnat64 will not try to use a NAT64 prefix. she knows the way, she doesn't need the middleman ๐
obviously tho โ if a connection is not to a locally accessible network, it's gonna need to be proxied over a NAT64. and here's the plot twist: sometimes you need different NAT64 prefixes to reach different internal (and external) networks. iconic, honestly. that's exactly why the config file lets you define paths and a default NAT64 prefix ๐ซถ
Paths are declared as blocks in the config file. meaning: they start with a path { line and end with a } line. inside that block you use directives to declare a NAT64 proxy (documented further down this page, keep scrolling bestie) and subnet directives to declare networks โ and even destination ports inside those networks โ that this server should be used to reach.
โ ๏ธ heads up fr fr: each path MUST define a NAT64 prefix and contain one or more subnet directives. that's not a vibe suggestion, that's a requirement ๐
NAT64 prefix declaration directives that are not inside a path block define the default NAT64 prefix. so if tnat64 needs to connect to a machine via a NAT64 (i.e. it isn't a network declared as local) and no path has declared โ via a subnet directive โ that it can reach that network, then this NAT64 prefix is used to construct IPv6 addresses. she's the fallback queen ๐
๐ CONFIGURATION SYNTAX ๐
the basic structure of every line in the config file is:
<directive> = <parameters>
the exception to this is path blocks, which look like:
path {
<directive> = <parameters>
}
Empty lines are ignored. and everything on a line after a # character is ignored too โ comment your heart out, bestie โจ
๐ DIRECTIVES ๐
these are the directives used in the tnat64 config file:
nat64_prefixโ the prefix of the IPv6 address of the NAT64 (e.g."nat64_prefix = 64:ff9b::"). Only one NAT64 prefix may be specified per path block, or one outside a path block (which is how you define the default NAT64 prefix). the NAT64 prefix is always/96, periodt.localโ an IP/subnet pair specifying a network which may be accessed directly, without proxying through NAT64 (e.g."local = 10.0.0.0/255.0.0.0"). no middleman needed ๐subnetโ this directive is only valid inside a path block. its parameter is formed asIP[:startport[-endport]]/subnet, and it specifies a network (and a range of ports on that network) that can be accessed through the NAT64 specified in this path block. for example, inside a path block,"subnet = 150.0.0.0:80-1024/255.0.0.0"tellstnat64that the NAT64 prefix specified in the current path block should be used to access any IPs in the range150.0.0.0to150.255.255.255when the connection request is for ports80-1024. that's the whole assignment, slay ๐ฅ
๐ง UTILITIES ๐ง
tnat64 comes with two utilities that are genuinely useful for creating and verifying the tnat64 configuration file. yes, two. she brought friends ๐ซถ
tnat64-validateconfโtnat64-validateconfcan be used to verify the configuration file. it checks the format of the file and also the contents for errors. once it's read the file, it dumps the configuration to the screen in a formatted, readable manner. this can be extremely useful when you're debugging problems, bestie ๐ญ
tnat64-validateconf can read a configuration file from a location other than the location specified at compile time, using the -f <filename> command line option.
normally tnat64-validateconf just dumps the configuration it read to the screen (in a nicely readable format), but it also has a genuinely useful test mode. when you pass it a hostname/ip on the command line like -t <hostname/ip>, tnat64-validateconf determines which of the NAT64 prefixes specified in the configuration file would be used by tnat64 to access the specified host. it's giving psychic, but make it diagnostics ๐ฎ
๐ SEE ALSO ๐
๐ AUTHORS ๐
Andrej Shadura (andrew@shadura.me), Shaun Clowes (delius@progsoc.uts.edu.au)
๐ธ COPYRIGHT ๐ธ
Copyright 2011 Andrej Shadura
Original tsocks manual page, copyright 2000 Shaun Clowes
tnat64 and its documentation may be freely copied under the terms and conditions of version 2 of the GNU General Public License, as published by the Free Software Foundation (Cambridge, Massachusetts, United States of America).
This documentation is heavily based on the documentation for tsocks, transparent SOCKSification library, whose documentation itself is based on the documentation for logwrites, another shared library interceptor. One line of code from it was used in tnat64 and a lot of the documentation :) logwrites is by adam@yggdrasil.com (Adam J. Richter) and can be had from ftp.yggdrasil.com pub/dist/pkg
okay that's the whole page, bestie ๐ this was TNAT64.CONF(5), brought to you by TNAT64 โ the source of all this wisdom โ and she's filed under section 5, the file formats one, iykyk. go forth and configure responsibly ๐โจ๐ฆ
๐ฆ where this page comes from
- debian bookworm: tnat64 0.06-1+b1 ยท GPL-2.0-or-later
- debian trixie: tnat64 0.06-1+b1 ยท GPL-2.0-or-later
- nixos 26.05: tnat64 0.06
- nixpkgs unstable: tnat64 0.06
- ubuntu jammy: tnat64 0.06-1 ยท GPL-2.0-or-later
- ubuntu noble: tnat64 0.06-1 ยท GPL-2.0-or-later
- ubuntu questing: tnat64 0.06-1
- ubuntu resolute: tnat64 0.06-1build1 ยท GPL-2.0-or-later
- ubuntu stonking: tnat64 0.06-2 ยท GPL-2.0-or-later
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms