Skip to content

Wireguard Install

Debian

Add the Package source, only required for Debian 10 and lower.
Debian 11 Bullseye include Wireguard.

echo "deb http://deb.debian.org/debian/ unstable main" > /etc/apt/sources.list.d/unstable-wireguard.list
printf 'Package: *\nPin: release a=unstable\nPin-Priority: 90\n' > /etc/apt/preferences.d/wireguard

apt update
apt install wireguard

Config

Keys Generieren

cd /etc/wireguard
umask 077
wg genkey > privatekey
wg pubkey < privatekey > publickey

Example Config

[Interface]
Address = 10.0.1.3/32, fd28:10:0:1::3/128 # (1)!
PrivateKey = <Private Key> 

[Peer]
PublicKey = <Public Key of Peer>
PresharedKey = <Pre Shared Key optional>
AllowedIPs = 0.0.0.0/0, ::/0 # (2)!
Endpoint = <Endpoint>:51820
  1. Addresses of the local machine
  2. Networks for which the Wireguard connection should be used.