wg-go

command module
v0.0.0-...-09c4e76 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 27, 2023 License: MIT Imports: 13 Imported by: 0

README

wg-go

A Golang implementation of the WireGuard wg(8) utility.

This tool could be used to get and set the configuration of WireGuard tunnel interfaces.

It can be used in conjunction with wireguard-go for an almost complete userspace implementation of WireGuard on platforms which can be targeted by Go but do not have an implementation of WireGuard available.

wg-go can also control a kernel-based WireGuard configuration.

For more information on WireGuard, please see https://www.wireguard.com/.

Supported Sub-commands

This implementation supports the following sub-commands as specified in wg(8):

  show:     Shows the current configuration and device information
  showconf: Shows the current configuration of a given WireGuard interface, for use with 'setconf'
  setconf:  Applies a configuration file to a WireGuard interface
  genkey:   Generates a new private key and writes it to stdout
  genpsk:   Generates a new preshared key and writes it to stdout
  pubkey:   Reads a private key from stdin and writes a public key to stdout

The --version command line option is also supported to show the release version.

Script Wrapper

The wg script provides a convenient wrapper around wg-go to provide a level of compatibility with the wg(8) utility.

How does this work?

This tool uses wgctrl-go to enable control of WireGuard devices on multiple platforms.

Building

This requires an installation of go ≥ 1.16.

git clone https://github.com/seud0nym/wg-go.git
cd wg-go
make

You can build the executable for different architectures and operating systems by setting the GOOS, GOARCH, and, if necessary, GOARM environment variables before running make, as specified in https://golang.org/doc/install/source#environment.

Original Code

This project was inspired by and based upon QuantumGhost/wg-quick-go.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL