fachinformatiker-wiki

it's easy when it's here

User Tools

Site Tools


linux:vpn:wireguard

This is an old revision of the document!


WireGuard VPN

Installation

sudo apt update
sudo apt install wireguard wireguard-tools

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/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

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
This website uses cookies. By using the website, you agree with storing cookies on your computer. Also you acknowledge that you have read and understand our Privacy Policy. If you do not agree leave the website.  More information about cookies 
linux/vpn/wireguard.1680233207.txt.gz · Last modified: 2024/02/17 19:03 (external edit)