linux:vpn:wireguard
This is an old revision of the document!
Table of Contents
WireGuard VPN
Installation
sudo apt update sudo apt install wireguard wireguard-tools
Konfiguration
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/32 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
Optional
sudo sysctl -w net.ipv4.ip_forward=1 sudo sysctl -p
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.1/32 Endpoint = vpn.example.com:51820 PersistentKeepalive = 25
linux/vpn/wireguard.1680359502.txt.gz · Last modified: 2024/02/17 19:03 (external edit)