Install Wiregard VPN

  • Wiregard does not follow tradition client server architecture its more of a peer architecture

  • wiregard ip address on server has to be different and unique on the network

On both client and server

sudo apt-add-repository universe
sudo apt-get update
sudo apt-get install wireguard-tools wireguard
wg genkey | sudo tee /etc/wireguard/private.key
sudo chmod go= /etc/wireguard/private.key
sudo cat /etc/wireguard/private.key | wg pubkey | sudo tee /etc/wireguard/public.key

On client

sudo nano /etc/wireguard/wg0.conf

Config File

[Interface]
PrivateKey = <CLIENT PRIVATE KEY>
Address = <IP ADRESS THAT IS TO BE ASSIGNED TO CLIENT>
ListenPort = <ListenPort>
[Peer]
PublicKey = <Server PUBLIC KEY>
AllowedIPs = <IP ADRESS THE CLIENT IS ALLOWED TO CONNECT TO GENERALLY ALLOW WHOLE NETWORK>
Endpoint = <SERVER ENPOINT WITH PORT NUMBER>
PersistentKeepalive = <KEEP ALIVE>

client public key

client private key

On Server

Server Config

server public key

server private key

References

  • https://www.digitalocean.com/community/tutorials/how-to-create-a-point-to-point-vpn-with-wireguard-on-ubuntu-16-04

  • Look into this for S2S

    • https://ubuntu.com/server/docs/wireguard-vpn-site-to-site

Last updated