WireGuard is an extremely simple yet fast and modern VPN that utilizes state-of-the-art cryptography. It aims to be faster, simpler, leaner, and more useful than IPSec, while avoiding the massive headache. It intends to be considerably more performant than OpenVPN. WireGuard is designed as a general purpose VPN for running on embedded interfaces and super computers alike, fit for many different circumstances. Initially released for the Linux kernel, it plans to be cross-platform and widely deployable. It is currently under heavy development, but already it might be regarded as the most secure, easiest to use, and simplest VPN solution in the industry.
https://www.wireguard.com/
1. INSTALL WIREGUARD ON UBUNTU
sudo add-apt-repository ppa:wireguard/wireguard
sudo apt-get updatesudo apt-get install wireguard-dkms wireguard-tools
GENERATE PUBLIC KEY AND PRIVATE KEY
(umask 077 && printf "[Interface]\nPrivateKey = " | sudo tee /etc/wireguard/wg0.conf > /dev/null)wg genkey | sudo tee -a /etc/wireguard/wg0.conf | wg pubkey | sudo tee /etc/wireguard/publickey
You can simply go to the /etc/wireguard directory and see your keys either by cat privatekey or cat publickey
CREATE CONFIGURATION FILE
sudo nano /etc/wireguard/wg0.conf
[Interface]PrivateKey = YOUR_SERVER_PRIVATE_KEY
ListenPort = 51280
SaveConfig = false
Address = 10.0.0.1/24
Keep the address 10.0.0.1/24 this will be an internal address to bypass the traffic through wireguard. Lets Check if its working
START WIREGUARD
sudo wg-quick up wg0