Benutzer-Werkzeuge

Webseiten-Werkzeuge


notiz:wireguard

Dies ist eine alte Version des Dokuments!


Wireguard

Kryptografie

Privaten Schlüssel erzeugen

wg genkey > wg-c2s-private.key

Öffentlichen Schlüssel erzeugen

cat wg-c2s-private.key | wg pubkey > wg-c2s-public.key

wg0.conf

Wireguard wird über Konfigurationsdateien verwaltet. Diese liegen unter /etc/wireguard/<interface name>.conf.

Eine solche Datei sieht ungefähr so aus.

/etc/wireguard/wg0.conf
# Lokales Interface
[Interface]
Address = 192.168.123.1/24
PrivateKey = <private key of local interface>
ListenPort = 51820 # Netzwerport
PostUp = <bash command>
PostDown = <bash command>
 
# Client 1
[Peer]
PublicKey = <public key of client 1>
AllowedIPs = 192.168.123.12/32
 
# Client 2
[Peer]
PublicKey = <public key of client 2>
AllowedIPs = 192.168.123.11/32

Wireguard verwenden

Interface starten

wg-quick up <interface name>

Interface stoppen

wg-quick down <interface name>

Interface starten systemd

systemctl start wg-quick@<interface name>

Interface stoppen systemd

systemctl stop wg-quick@<interface name>

Interface persistent starten systemd

systemctl enable wg-quick@<interface name>
notiz/wireguard.1584556795.txt.gz · Zuletzt geändert: 2020/03/18 19:39 von clerie

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki