Wireguard on Debian
Page content
Wireguard with Debian
Grab a Fresh Debian which has Public Internet Access. Target is to build a WG Tunnel and assign a Public IP to the Server.
Debian 11.6
apt-get install -y wireguard wireguard-tools
Gen Key
cd /etc/wireguard
umask 077; wg genkey | tee privatekey | wg pubkey > publickey
Config
cat << EOF > /etc/wireguard/wg0.conf
[Interface]
PrivateKey = ASSING_YOUR_PRIVATE_KEY_HERE
Address = PUBLIC_IP_V4/xx, PUBLIC_IP_V6/xx
[Peer]
PublicKey = ASSIGN_REMOTE_PUBLIC_KEY_HERE
Endpoint = PUBLIC_IP_OF_REMOTE_ENDPOINT:PORT
AllowedIPs = 0.0.0.0/0, ::/0
PersistentKeepalive = 60
Tunnel UP
systemctl enable wg-quick@wg0
systemctl start wg-quick@wg0
systemctl status wg-quick@wg0
Check IP
i3
sha256: c4d87bfca434aca32d6a8869720220b6ea4abe1ff534dd6e715cbb73d4f7025e