Sovereign 8s.is mirror of standardgalactic/gotatun
  • Rust 99.4%
  • Nix 0.6%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2025-12-05 13:59:51 +01:00
.cargo chore: rename config to config.toml (#264) 2022-06-17 09:48:41 -05:00
.github/workflows Add GHA workflow for linting nix code 2025-11-19 11:12:19 +01:00
gotatun Fix clippy::needless_pass_by_value 2025-11-26 11:33:30 +01:00
gotatun-cli Fix clippy::unnecessary_semicolon 2025-11-26 11:33:30 +01:00
.editorconfig Document crypto modules and remove unsafe code. 2020-04-28 13:18:28 -07:00
.gitignore Add nix flake packaging gotatun. 2025-11-19 11:12:19 +01:00
Cargo.lock Reset version number to 0.1.0 in preparation of initial release 2025-10-27 12:08:04 +01:00
Cargo.toml Add missing workspace metadata 2025-11-06 13:04:54 +01:00
CHANGELOG.md Update changelog to mention flake.nix 2025-11-19 11:12:59 +01:00
clippy.toml Fix clippy::doc_markdown 2025-11-26 11:33:30 +01:00
flake.lock Update flake.lock 2025-12-03 19:32:44 +01:00
flake.nix Update nixpkgs version to 25.11 2025-12-03 19:32:24 +01:00
LICENSE.md Add and update copyright & license notice 2025-11-06 13:04:55 +01:00
README.md Update README with build instructions using nix 2025-11-19 11:12:59 +01:00
rust-toolchain.toml Add rust-toolchain.toml and set MSRV 2025-11-17 18:44:13 +01:00
SECURITY.md Add SECURITY.md 2025-11-06 13:04:48 +01:00

GotaTun

A userspace WireGuard® implementation, and a fork of BoringTun.

Building

  • Library only: cargo build --lib --no-default-features --release [--target $(TARGET_TRIPLE)]
  • Executable: cargo build --bin gotatun --release [--target $(TARGET_TRIPLE)]

Installation

By default the executable is placed in the ./target/release folder. You can copy it to a desired location manually, or install it using cargo install --bin gotatun --path ..

Nix

To build the executable, simply run nix build .#gotatun. The final binary will be located in result/bin/gotatun.

Running

As per the specification, to start a tunnel use:

gotatun [-f/--foreground] INTERFACE-NAME

The tunnel can then be configured using wg, as a regular WireGuard tunnel, or any other tool.

It is also possible to use with wg-quick by setting the environment variable WG_QUICK_USERSPACE_IMPLEMENTATION to gotatun. For example:

sudo WG_QUICK_USERSPACE_IMPLEMENTATION=gotatun WG_SUDO=1 wg-quick up CONFIGURATION

Testing

Testing this project has a few requirements:

  • sudo: required to create tunnels. When you run cargo test you'll be prompted for your password.
  • Docker: you can install it here. If you are on Ubuntu/Debian you can run apt-get install docker.io.

Supported platforms

Target triple Binary Library
x86_64-unknown-linux-gnu ✓ ✓
aarch64-unknown-linux-gnu ✓ ✓
armv7-unknown-linux-gnueabihf ✓ ✓
x86_64-apple-darwin ✓ ✓
x86_64-pc-windows-msvc ✓
aarch64-apple-ios ✓
armv7-apple-ios ✓
armv7s-apple-ios ✓
aarch64-linux-android ✓
arm-linux-androideabi ✓

Other platforms may be added in the future

Linux

x86-64, aarch64 and armv7 architectures are supported. The behaviour should be identical to that of wireguard-go, with the following difference:

gotatun will drop privileges when started. When privileges are dropped it is not possible to set fwmark. If fwmark is required, such as when using wg-quick, run with --disable-drop-privileges or set the environment variable WG_SUDO=1.

You will need to give the executable the CAP_NET_ADMIN capability using: sudo setcap cap_net_admin+epi gotatun. sudo is not needed.

macOS

The behaviour is similar to that of wireguard-go. Specifically the interface name must be utun[0-9]+ for an explicit interface name or utun to have the kernel select the lowest available. If you choose utun as the interface name, and the environment variable WG_TUN_NAME_FILE is defined, then the actual name of the interface chosen by the kernel is written to the file specified by that variable.


License

The project is licensed under the 3-Clause BSD License.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the 3-Clause BSD License, shall be licensed as above, without any additional terms or conditions.


WireGuard is a registered trademark of Jason A. Donenfeld. GotaTun is not sponsored or endorsed by Jason A. Donenfeld.