Wireguard einrichten

Aus XccesS Wiki
Version vom 12. August 2024, 13:16 Uhr von Hendrik (Diskussion | Beiträge) (Die Seite wurde neu angelegt: „=== Beschreibung === === Download === === Installation === apt install wireguard -y === Konfiguration === ====Server==== Keys erzeugen <syntaxhighlight lang="bash" line="1"> wg genkey | sudo tee /etc/wireguard/priv.key chmod go= /etc/wireguard/priv.key cat /etc/wireguard/private.key | wg pubkey | sudo tee >> /etc/wireguard/pub.key nano /etc/wireguard/wg0.conf </syntaxhighlight> Inhalt: <syntaxhighlight lang="bash" line="1"> [Interface] Address = 10.0.…“)
(Unterschied) ← Nächstältere Version | Aktuelle Version (Unterschied) | Nächstjüngere Version → (Unterschied)
Zur Navigation springen Zur Suche springen

Beschreibung

Download

Installation

apt install wireguard -y

Konfiguration

Server

Keys erzeugen

wg genkey | sudo tee /etc/wireguard/priv.key
chmod go= /etc/wireguard/priv.key

cat /etc/wireguard/private.key | wg pubkey | sudo tee >> /etc/wireguard/pub.key
nano /etc/wireguard/wg0.conf

Inhalt:

[Interface]
Address = 10.0.5.1/24
ListenPort = 51820
# Use your own private key, from /etc/wireguard/privatekey
PrivateKey = XXX 


#Routen einstellen damit Clients kommunizieren können
PostUp     = iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
PostDown   = iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE

[Peer]
# Client 1
PublicKey = XXX
# VPN client's IP address in the VPN
AllowedIPs = 10.0.5.2/32

wg-quick up wg0

Update

Test

Fehlerbehebung

Starten/Stoppen funktioniert nicht

Lösung 1
auszufüllen

Codeschnipsel

Nützliche Links

Codeschnipsel

Nützliche Links