This script simplifies and automates the creation of Wireguard servers and clients for a road-warrior style VPN configuration. It is intended to be run on the server system.
wireguard-mgr.sh
only supports Ubuntu 18.04.
The new-server
option will set up a new Wireguard server, with tunnel traffic routed out the system's default gateway. It also starts and enables the Wireguard service with SystemD.
The new-server
option requires two arguments:
--tunnel-cidr
: A CIDR network block that the tunnel will use internally--server-port
: The local port on the system that the VPN server will listen on for incoming connections.
Example:
./wireguard-mgr.sh new-server --tunnel-cidr 10.78.0.0/24 --server-port 5555
The new-client
option requires no arguments. It instead generates a new client configuration based on the server configuration and any existing client configurations. Due to its automated nature, it requires the server configration to have been generated by wireguard-mgr.sh
.
Example:
./wireguard-mgr.sh new-client