Creating a Wireguard VPN - jwells24/Tech-Journal GitHub Wiki

Creating a Wireguard VPN

  • In this tech journal entry, we will be installing wireguard and creating a VPN tunnel between our AWS instance and xubuntu-lan.

Install Wireguard

  1. Install wireguard using the commands below.
sudo apt-get update

sudo apt-get install wireguard

Generate a key

  1. CD into the /etc/wireguard directory.

  2. Now, create a file called wg0.conf in each of your /etc/wireguard directories. Configure each file to look similar to the one below, with your own respective IP addresses, keys, and peer information.

[Interface]
Address = 10.0.0.1/24
SaveConfig = true
ListenPort = 51820
PrivateKey = SERVER_PRIVATE_KEY

[Peer]
PublicKey = PEER_PUBLIC_KEY
AllowedIPs = 10.0.101.0/24
Endpoint = 10.0.5.6:51900
  1. Use the command below to turn your wg0 interface on.
wg-quick up wg0