Wireguard ubuntu
From Teknologisk videncenter
Wireguard VPN between two Ubuntu hosts - one behind NAT
Host A: Public access
sudo bash
apt install wireguard
cd /etc/wireguard
umask 077
wg genkey > privatekey
wg pubkey < privatekey > publickey
ip link add dev wg0 type wireguard
ip address add dev wg0 172.31.0.1/24
wg set wg0 listen-port 8172 private-key privatekey peer 9WDOCVCJ6dbcSofc2Ho1qbBBeiD6dBWWoyIyk+nxFxo= allowed-ips 0.0.0.0/0 endpoint 192.168.1.98:51820
wg-quick save wg0