clatd
clatd copied to clipboard
A 464XLAT CLAT implementation for Linux
=head1 NAME
B
=head1 DESCRIPTION
B
B
It relies on the software package TAYGA by Nathan Lutchansky for the actual translation of packets between IPv4 and IPv6 (I<RFC 6145>) TAYGA may be downloaded from its home page at Lhttp://www.litech.org/tayga/.
=head1 SYNOPSIS
B
=head1 OPTIONS
=over
=item -q
Quiet mode; suppress normal output. This is the same as setting B<quiet=1>. Warnings and errors are still outputted, to silence those too, repeat I<-q>.
=item -d
Enable debugging output. This is the same as setting B<debug=1>. Repeat for even more debugging output, which is the equivalent of setting B<debug=2>.
=item -c conf-file
Read configuration settings from B
=item -h, --help
Print a brief usage help and exit.
=item key=value
Set configuration B
=back
=head1 INVOCATION
B
See the I
=head1 INSTALLATION
The following commands will quickly download and install the latest version
of B
=over
=item git clone https://github.com/toreanderson/clatd
=item sudo make -C clatd install installdeps
=back
This will install B
=head1 CONFIGURATION
B
Settings are of the form B<key=value>. A list of recognised keys and their possible values follow below:
=over
=item B<quiet=integer> (default: I<0>)
Set this to 1 to suppress normal output from B
=item B<debug=integer> (default: I<0>)
Set this to 1 to get debugging output from B
=item B<script-up=string> (no default)
Specify a custom script to be run when B
The script is run by the system shell, so you can do everything you could in an
interactive shell: run multiple commands by separating them by semi-colon or
double ampersands, use standard if/else statements, use variable substitutions,
redirect output to files, set up command pipelines, and so on. However it must
all be on one line, so if you want to do complex things or use some other
programming language it's probably better to put the script itself in a
separate executable file and just make B
If the script returns a nonzero exit status, this is considered a fatal error,
and B
All of B
Logging or debug messages from the script may simply be sent to stdout, where
it will be picked up by the init system along with B
The script should not be enclosed in quotes in the configuration file (even though it contains whitespace). For example:
B<script-up=echo date -Ins
: clatd started on $clat_dev | tee -a ~/clatd.log>
If on the other hand you want to supply a B
B<clatd 'script-up=ip route add 192.0.2.0/24 dev $clat_dev || true'>
=item B<script-down=string> (no default)
This works exactly the same as B
An unsuccessful exit code from B
=item B<clat-dev=string> (default: I
The name of the network device used by the CLAT. There should be no reason to
change the default, unless you plan on running multiple instances of B
=item B<clat-v4-addr=ipv4-address> (default: I<192.0.0.1>)
The IPv4 address that will be assigned to the CLAT device. Local applications will bind to this address when communicating with external IPv4 destinations. In a standard 464XLAT environment with a stateful NAT64 serving as the PLAT, there should be no need to change the default.
When using B
The default address is one from I<RFC 7335>.
=item B<clat-v6-addr=ipv6-address> (default: auto-generated)
The IPv6 address of the CLAT. Traffic to/from the B
By default, B
If only a non-SLAAC global address is found on the PLAT-facing device,
B
If multiple addresses are found in either category, the one that shares the longest common prefix with the PLAT prefix will be preferred when deriving the CLAT IPv6 address according to the algorithm described above.
=item B<dns64-servers=srv1,[srv2,..]> (default: use system resolver)
Comma-separated list of DNS64 servers to use when discovering the PLAT prefix
using the method described in RFC 7050. By default, the system resolver is
used, but it might be useful to override this in case your ISP doesn't provide
you with a DNS64-enabled name server, and you want to test B
=item B<cmd-ip=path> (default: assume in $PATH)
Path to the B
=item B<cmd-ip6tables=path> (default: assume in $PATH)
Path to the B
=item B<cmd-tayga=path> (default: assume in $PATH)
Path to the B
=item B<forwarding-enable=bool> (default: I
Controls whether or not B
All sysctls that are modified will be restored to their original values when
B
=item B<ip6tables-enable=bool> (default: see below)
Controls whether or not B
The default is I
=item B
Which network device is facing the PLAT (NAT64). By default, this is auto-detected by performing a route table lookup towards the PLAT prefix. This setting is used when setting up generating the CLAT IPv6 address, and when setting up ip6tables rules and Proxy-ND entries.
=item B
The IPv6 translation prefix into which the PLAT maps the IPv4 internet. See I<RFC 6052> for a closer description. By default, this is auto-detected from DNS64 answers using the method in I<RFC 7050>.
=item B
Controls whether or not B
Any entries added wil be removed when B
=item B
Where to write the TAYGA configuration file. By default, a temporary file will
be created (and also deleted when B
=item B
The IPv4 address assigned to the TAYGA process. This is used for emitting ICMPv4 errors back to the host (i.e., it will show up as the first hop when tracerouting to IPv4 destinations), and you may also ping it to verify that the TAYGA process is still alive and well.
The default address is one from I<RFC 7335>.
=item B<v4-conncheck-enable=bool> (default: I
Whether or not to check if the system has IPv4 connectivity before starting
the CLAT. If it does, then B
If you want to always start the CLAT whenever possible, even though the
system has IPv4 connectivity, disable this setting. You may instead use the
B
Note that enabling B
=item B<v4-conncheck-delay=seconds> (default: I<10>)
When performing an IPv4 connectivity check, wait this number of seconds
before actually doing anything. This is to avoid a race condition where for
example IPv6 SLAAC finshes and triggers a network-up event script to start
B
Set it to 0 to perform the check immediately.
=item B<v4-defaultroute-enable=bool> (default: I
Whether or not to add an IPv4 default route pointing to the CLAT. In a
typical 464XLAT environment, you want this. However when using B
=item B<v4-defaultroute-replace=bool> (default: I
Instructs B
Note that nothing prevents software like a connection manager or a DHCPv4
client daemon from re-adding any replaced routes while B
If you enable B
Setting B
=item B<v4-defaultroute-metric=integer> (default: I<2048>)
The metric of the IPv4 default route pointing to the CLAT. The default is chosen because it is higher than that of a native IPv4 default route added by NetworkManager, which makes it so that the native IPv4 connectivity is preferred if present.
=item B<v4-defaultroute-mtu=integer> (default: I<1260>)
The MTU of the default route pointing to the CLAT. The default is the default IPv6 MTU used by TAYGA (1280, which in turn comes from I<RFC 6145>) minus 20 to compensate for the difference in header size between IPv4 and IPv6. This prevents outbound packets from having to be fragmented by TAYGA, and also makes local applications advertise a TCP MSS to their remote peers that prevent them from sending packets beck to us that would require fragmentation.
If you know that the IPv6 Path MTU between the host and the PLAT is larger than 1280, you may increase this, but then you should also recompile TAYGA with a larger B<ipv6_offlink_mtu> setting in I<conffile.c>.
=item B<v4-defaultroute-advmss=integer> (default: B
The "advmss" value assigned to the the default route potining to the CLAT. This controls the advertised TCP MSS value for TCP connections made through the CLAT.
You should normally not need to set this. By default the value is calculated by
taking the value of B
=back
=head1 LIMITATIONS
B
B
B
=head1 BUGS
If you are experiencing any bugs or have any feature requests, head over to Lhttps://github.com/toreanderson/clatd/issues and submit a new issue (if someone else hasn't already done so). Please make sure to include logs with full debugging output (using I<-d -d> on the command line or B<debug=2> in the configuration file) when reporting a bug.
=head1 LICENCE
Copyright (c) 2014-2019 Tore Anderson [email protected]
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
=head1 SEE ALSO
ip(8), ip6tables(8), tayga(8), tayga.conf(5)
RFC 6052, RFC 6145, RFC 6146, RFC 6877, RFC 7050, RFC 7335 RFC 7755, RFC 7756, RFC 7757
=cut