WireGuard Server Tools are useful tools for WireGuard VPN server.
Go ahead to the release page and download the script to your server, then link the entry script wgserver to wherever you like.
wget https://github.com/altairwei/wireguard-server-tools/releases/download/v0.2/wgserver.tar.gz
mkdir wgserver-tools
tar -zxv -f wgserver.tar.gz -C ./wgserver-tools/
ln -s $(pwd)/wgserver-tools/wgserver /usr/bin/wgserverOr, you can build the script by using Argbash:
git clone https://github.com/altairwei/wireguard-server-tools.git
chmod +x ./INSTALL.sh
sudo ./INSTALL.sh /usr/bin/You can pass -h|--help to any subcommands to get help messages.
wgserver -h
wgserver install -h
wgserver show -h
wgserver set -hYou need to install necessary packages first, but wgserver only support auto-installation on Ubuntu, Debian and CentOS. Other distributions should refer to the official documentation of WireGuard. To get complete functionality of wgserver, the package qrencode is highly recommended to install.
wgserver install
Then, deploy a tunnel interface:
wgserver install -D wg0wg0 is the default name of WireGuard server tunnel interface, and is also the default positional argment of wgserver subcommands.
You can add servaral clients at a time.
wgserver set -q -a test1 -a test2 -a test3or, remove some clients:
wgserver set -r test1 -r test2 -r test3Show details of all clients:
wgserver show
# or
wgserver show -c allDisplay the contents of specific client config file:
wgserver show -c test1or, you can get qrencode from terminal by:
wgserver show -q test1The tools are inspired by l-n-s/wireguard-install and atrandys/wireguard .