sudo su
cd /etc/wireguard
umask 077
wg genkey | tee privatekey | wg pubkey > publickey
- Check to make sure the interface (eg eth0) is correct in the iptables rules in the template.
sudo su
cp wg0.conf.template /etc/wireguard/wg0.conf
# Add the private key to /etc/wireguard/wg0.conf
vim /etc/wireguard/wg0.conf
sudo systemctl start wg-quick@wg0
sudo systemctl enable wg-quick@wg0
- Change the server "PublicKey" in
mkconfig.sh:create_client_config(near line 19) to be the publickey of your wireguard server. - Use mkconfig tool on server to make client configs. It will add them to the running server.
- Distribute the
<name>.confand<name>all.confconfigs to clients. - Keep keys secret.
sudo wg