I prefer OpenVPN as I had problems using WireGuard on two machines (video and networking drivers broken)
sudo apt update sudo apt install software-properties-common sudo add-apt-repository ppa:wireguard/wireguard sudo apt install wireguard -y
Once installed create and update wg0.conf file
sudo nano /etc/wireguard/wg0.conf
To start or stop WireGuard:
sudo wg-quick up wg0 sudo wg-quick down wg0
Gotten my networking drivers broken, seems kernel 5.3+ bug
Iwconfig
Boot your machine with older kernel
Reboot and press and hold the shift key and you should see the grub menu choose advance mode
sudo apt-cache search linux-image-extra sudo apt-get install --reinstall linux-image-extra-virtual-hwe-18.04-edge
Watch errors I have gotten:
W: Possible missing firmware /lib/firmware/rtl_nic/rtl8125a-3.fw for module r8169
To fix:
cd /lib/firmware/rtl_nic Sudo wget https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/plain/rtl_nic/rtl8125a-3.fw sudo update-initramfs -u
wg-quick up wg0
wg-quick must be run as root. Please enter the password for ikstlan to continue:
[#] ip link add wg0 type wireguard
[#] wg setconf wg0 /dev/fd/63
[#] ip -4 address add 10.19.49.7/24 dev wg0
[#] ip link set mtu 1420 up dev wg0
[#] resolvconf -a wg0 -m 0 -x
/usr/bin/wg-quick: line 32: resolvconf: command not found
[#] ip link delete dev wg0
sudo apt install resolvconf -y sudo apt install openresolv -y
Source: http://forums.debian.net/viewtopic.php?f=30&t=145496
Source: https://linuxize.com/post/how-to-set-up-wireguard-vpn-on-ubuntu-18-04/