4 releases (2 stable)

new 1.1.0 Apr 24, 2024
1.0.0 Feb 12, 2024
0.2.0 Jul 20, 2023
0.1.0 Jul 17, 2023

#438 in Network programming

Download history 15/week @ 2024-02-08 18/week @ 2024-02-15 73/week @ 2024-02-22 34/week @ 2024-02-29 2/week @ 2024-03-07 3/week @ 2024-03-14 9/week @ 2024-03-28 2/week @ 2024-04-04 40/week @ 2024-04-18

51 downloads per month

GPL-3.0 license

130KB
2K SLoC

protomask: Fast & reliable user space NAT64

GitHub release Build Audit

The protomask tool suite is a collection of user space tools that translate packets between OSI layer 3 protocol versions

This repository (referred to as the protomask tool suite) contains the following sub-projects:

Crate Info Latest Version
protomask User space NAT64 implementation crates.io
protomask-clat User space Customer-side transLATor (CLAT) implementation crates.io
easy-tun A pure-rust TUN interface library crates.io docs.rs
fast-nat An OSI layer 3 Network Address Table built for speed crates.io docs.rs
interproto Utilities for translating packets between IPv4 and IPv6 crates.io docs.rs
rfc6052 A Rust implementation of RFC6052 crates.io docs.rs
rtnl Slightly sane wrapper around rtnetlink crates.io docs.rs

Installation

Protomask can be installed using various methods:

Debian

Head over to the releases page and download the latest release for your architecture.

Then, install with:

apt install /path/to/protomask_<version>_<arch>.deb

# You can also edit the config file in /etc/protomask.json
# And once ready, start protomask with
systemctl start protomask

Using Cargo

cargo install protomask

Usage

The protomask and protomask-clat binaries are mostly self-sufficient.

Nat64

To start up a NAT64 server on the Well-Known Prefix (WKP), run:

protomask --pool-prefix <prefix>

Where <prefix> is some block of addresses that are routed to the machine running protomask.

For more information, run protomask --help. Configuration may also be supplied via a JSON file. See the example config for more information.

CLAT

To start up a CLAT server on the Well-Known Prefix (WKP), run:

protomask-clat --customer-prefix <prefix>

Where <prefix> is some block of addresses that are routed to the machine running protomask. This would generally be the address range of a home network when run on CPE. It may also be an individual client address if run on a client device instead of a router.

For more information, run protomask-clat --help. Configuration may also be supplied via a JSON file. See the example config for more information.

Dependencies

~14–27MB
~394K SLoC