User Tools

Site Tools


wireguard_setup

Wireguard Setup

For Debian 10, you need to add the backports repo

sh -c "echo 'deb http://deb.debian.org/debian buster-backports main contrib non-free' > /etc/apt/sources.list.d/buster-backports.list"
apt-get update

If you are using Proxmox

apt-get install pve-headers

Install Wireguard

apt-get install wireguard wireguard-dkms

Server 1 & Server 2 (Client)

cd /etc/wireguard
umask 077; wg genkey | tee privatekey | wg pubkey > publickey

Server 1 /etc/wireguard/wg0.conf

[Interface]
Address = 10.0.0.1/24
ListenPort = 51194
PrivateKey = theprivatkeyyoujustgeneratedgoeshere
SaveConfig = true
[Peer]
PublicKey = server2publickeygoeshere
AllowedIPs = 10.0.0.2/32

Server 2 (Client) /etc/wireguard/wg0.conf

[Interface]
PrivateKey = theprivatkeyyoujustgeneratedgoeshere
Address = 10.0.0.2/24
[Peer]
PublicKey = server1publickey
AllowedIPs = 10.0.0.0/24
Endpoint = server1publicip:51194
PersistentKeepalive = 20

Server 1 & Server 2 (Client)

systemctl enable wg-quick@wg0
systemctl start wg-quick@wg0
wireguard_setup.txt · Last modified: 2020/07/16 04:22 by neoon