NATPTCONFIG(8)

NAME
natptconfig - configure IPv6-to-IPv4 translator

SYNOPSIS
natptconfig [-q] [-d debuglevel] -f configfile
natptconfig [-q] [-d debuglevel] subcommand [args ...]

DESCRIPTION
natptconfig configures and control the IPv6-to-IPv4 translator implemented in the kernel.

natptconfig takes the following command line options.

-q  Suppress error message sent to stderr.

-d debuglevel
    Set debug level to debuglevel. This option is for debug.

-f configfile
    Evaluate the contents of file specified as configfile. By specifying ‘-’ as a file name, standard input is used.

The first form (with -f) takes directives from the specified configuration file. This file will be read line by line and applied as argument to the natptconfig utility. The second form is to give single directive directly from the command line.

natptconfig configuration is made of a list of numbered rules, which is scanned for each incoming IPv6 and IPV4 packet until match is found and the relevant translation action is performed. When no match is found, packet is not translated into. In most case, this means the packet is dropped. Translation rule is examined from a small number sequentially. If matched rule is found, search is finished, and action is performed.

Rules can be added with the map command; delete individually with the map delete command, and globally with the map flush command; Rule number can be renumbered with the map renum command. Finally, rules can be displayed with show command.

To ease configuration, rules can be put into a file which is processed using -f option in the first synopsis line. See natpt.conf(5) for more detail about map command.

RETURN VALUES
natptconfig returns non ZERO value when detects error of syntax. Actually, return value is number of error which natptconfig detected.

DIRECTIVES
Keywords and special characters that the parser expects exactly are displayed using this font. Parameters are specified with this font. Square brackets ( ‘[’ and ‘’] ) are used to show optional keywords and parameters. Parentheses( ‘(’ and ‘’) ) are used to group keywords and parameters when necessary. The vertical bar (‘|’) is used to indicate a choice between optional parameters.

You can put all directives into file and process using -f option, here we describe directives mainly executed from command line. The following directives are available.

?   Show available actions on each stage.

map delete number
    Delete translation rule specified by number. Error does not occur even if specified rule does not exist.

map renum [number1 [number2]]
    Renumber translation rule. The number1 is the start number of rule number. The number2 is interval of rule number. When number1 or number2 is omitted, "100" is used.

show subcommand
    [args ...] Show various useful information. natptconfig read this information from kernel, so you must have read permission of /dev/kmem. Available subcommands are listed below.

    ?   Show available subcommands on this stage.

    prefix
        Show NAT-PT prefix and prefix mask.

    rules
        [cui] Show NAT-PT rules. When cui is specified, show rules command shows translation rule with CUI format instead of natptconfig format. natptconfig does not accept this CUI format. Because CUI format is for a special intended use, a general people does not use it.

    xlate
        [long] [interval] Show NAT-PT current translation table entry. An entry of this table is empty at first. Kernel forms an entry that packet flows, 1 entry per 1 TCP session, 1 entry per 1 UDP/ICMP packet.

        •   long shows with long format.

        •   interval is a number, and if this option is specified, natptconfig shows the information shown with ‘xlate’ subcommand regularly in specified second interval.

        By default, this command displays IPv6 address with short format (22 columns per address), and when long was specified, this command displays IPv6 address without shortening it.

        It is useful to see this table entry when this translator seems not to work. See TABLE FORMAT section below for more detail.

    variables
        [all | tslot | caddr] Show variables that was set by ‘set’ subcommand. If nothing is specified after ‘variables’, this subcommand shows only variables to use usually.

        Meaning of words that can specify is as follows.

        all Show all variables.

        tslot
            Show timer related variables. You can change behavor of NAT-PT when you change a value of these variables.

        caddr
            Show start address of inner table. These variables are read only, and are for debug.

        See natpt.conf(5) for meaning of each indicated variables.

    mapping
        Show current translation status. Status is displayed as enable or disable.

test subcommand
    [args ...] Test the log system. You must run natptlog command. When only log specified, send LOGTESTPATTERN to translator, and translator send this pattern to log system. When you running natptlog command, this command display LOGTESTPATTERN. Current available subcommands are shown.

    ?   Show available subcommands on this stage.

    log Send predefined pattern LOGTESTPATTERN to the log system.

    log name
        Send one word to the log system.

    log "string"
        Send double quoted string to the log system.

    This is for log sysgem debug.

FILES
/kernel
    default kernel namelist
/dev/kmem
    default memory file

TABLE FORMAT
This section describes a table format indicated with
    # natptconfig show xlate
command.

Here is an example of command output with v6->v4 translation. Because this command's output is too long, line is bent over to two lines.

    tcp 3ffe=fe20:c157.1095 3ffe=:caf9:b2a.23
        10.0.0.102.32768  202.249.11.42.23  1  2  00:00:18  CLOSED

This entry has 9 fields. Meaning of each field is as follows.
•   The leftmost field shows protocol (icmp|icmp6|tcp|udp).
•   The second and third field shows source.port and destination.port of incoming packet.
•   The fourth and fifth field shows source.port and destination.port of outgoing packet.
•   The sixth and seventh field shows each packet count of incoming and outgoing.
•   The eighth field shows the time (seconds) from last packet matches this entry.
•   The last field has TCP status that is kept in the kernel. Of course, the last field appears TCP only.

This entry is same as the next example, but IPv6 address was shrunk to 14 columns, in order to keep total length in 128 characters. Each IPv6 address was shown as first 4 characters and last 9 characters connecting with ‘=’ character.

When you invoke command as follows,
    # natptconfig show xlate long
the output seems to be next. This line is more long than above example, line is bent over to two lines, too.

    tcp 3ffe:501:ffff:face:203:47ff:fe20:c157.1095 3ffe:501:ffff:c1ad::caf9:b2a.23
        10.0.0.102.32768  202.249.11.42.23  1  2  00:00:28  CLOSED

Meaning of each field is same as the above example, but IPv6 address is not shortening.

SEE ALSO
natpt.conf(5), natptlog(8) Eric Nordmark, RFC, 2765, February 2000, Stateless IP/ICMP Translation Algorithm (SIIT). George Tsirtsis, RFC, 2766, February 2000, Network Address Translation - Protocol Translation (NAT-PT).

HISTORY
The natptconfig command first appeared in WIDE/KAME IPv6 protocol stack kit.

BUGS
The natptconfig command is now under development. It's user interface and overall functionality are subjects to future improvements and changes.