related git: https://git.picalike.corpex-kunden.de/incubator/swiss-army-knife/-/tree/master/wireguard
Based on: https://pivpn.io/ | https://www.wireguard.com/
To auto install VPN configs in Ubuntu machines, you can use pivnp. Pivpn is used in Rasbarrypy, but work well on Ubuntu and other Linux machines.
Commands:
apt update # Update our virtual machine
apt upgrade # Update our virtual machine
curl -L https://install.pivpn.io | bash # Instalation Wireguard
pivpn add # Add a new user in Wireguard
pivpn -qr # To view the QRcode user
path:
/home/configs
Here you will find the configs to users in WireGuard, example:
user.conf:
[Interface] Address = 0.0.0.0/0 PrivateKey = ********************************* [Peer] PublicKey = ********************************* AllowedIPs = 0.0.0.0/0, 0.0.0.0/0 Endpoint = 0.0.0.0:51820 # 51820 is the default port used by wireguard.
Steps to users install and use wireguard
sudo apt install wireguard
To up vpn:
sudo wg-quick up <file configuration>
if you had this problem:
/usr/bin/wg-quick: line 31: resolvconf: command not found
only install:
sudo apt install openresolv