Some scripts to run a WireGuard VPN client on Ubuntu.
$ sh scripts/install.sh
This script installs WireGuard and resolvconf (required for using VPN DNS).
$ sh scripts/setup.sh <gateway> <ip> <pubkey>
Arguments:
gateway - the public IP address/hostname of the VPN server
ip - the desired tunnel IP address for the client
pubkey - the server's public key
This script does the following:
- Generate public, private, and preshared keys and write them to
~/.wireguard
- Encrypt the private and preshared keys with GPG keys of your choosing
- Write the WireGuard config and the server's public key to
/etc/wireguard
- Write the client's public key and unencrypted preshared key to stdout
$ sh scripts/start.sh
This script does the following:
- Bring up the WireGuard interface
- Decrypt your private and preshared keys with the GPG keys you chose
- Set the private and preshared keys on the interface
$ sh scripts/stop.sh
Bring down the WireGuard interface.