linux:vpn:wireguard
This is an old revision of the document!
Table of Contents
WireGuard VPN
Installation
sudo apt update sudo apt install wireguard
Konfiguation
Server
create private key and remove permissions for any one other than root
wg genkey | sudo tee /etc/wireguard/private.key sudo chmod go= /etc/wireguard/private.key
create public key
sudo cat /etc/wireguard/private.key | wg pubkey | sudo tee /etc/wireguard/public.key
sudo nano /etc/wireguard/wg0.conf
[Interface] PrivateKey = <private key server> Address = 10.1.2.254 ListenPort = 51820 SaveConfig = false [Peer] PublicKey = <public key client> AllowedIPs = 10.1.2.1/32
Dienst aktivieren und starten
sudo systemctl enable wg-quick@wg0 sudo systemctl start wg-quick@wg0
Client
[Interface] PrivateKey = <private key client> Address = 10.1.2.1/32 DNS = 10.1.2.254 [Peer] PublicKey = <public key server> AllowedIPs = 10.1.2.254/32 Endpoint = vpn.example.com:51820 PersistentKeepalive = 25
linux/vpn/wireguard.1680231787.txt.gz · Last modified: 2024/02/17 19:03 (external edit)