Appearance
Wireguard VPN
2
Virtual Private Network #
- Virtuelles Netz
- Kein physical Interface
- ... sondern Tunnel Interface
- Verschachtelung
IP
inUDP
24.10.2022
Wireguard VPN
3
Wireguard #
- Point-to-Point VPN
- Verschlüsselt
- ChaCha Symetrisch
- Public / Private Key exchange
- Im Kernel implementiert
- sehr performant
- Clients für alle Betriebssysteme
24.10.2022
Wireguard VPN
4
Setup #
- Public / Private Key erstellen
- Wireguard Interface erstellen
- Interface mit Public Keys der Peers und eigenem Private Key konfigurieren
- IP Adressen zuweisen
24.10.2022
Wireguard VPN
5
Server - Clients #
- Wireguard auf "Server" als "Router" verwenden
- Ohne NAT: mit Public IP
- Mit NAT: mit Port Forward
24.10.2022
Wireguard VPN
6
Wireguard Tools #
wireguard-tools
package für Debian / RaspberryPi OS / Ubuntuwg
Command- Key erstellen
- Privater Schlüssel
wg genkey > privatekey
- Public Key ableiten
cat privatekey | wg pubkey > publickey
- Privater Schlüssel
24.10.2022
Wireguard VPN
7
# config Server
# /etc/wireguard/wg0.conf
[Interface]
Address = 10.10.10.1/24 # Eigene IP Adresse
ListenPort = 15551 # Port
PrivateKey = <Eigener Private Key>
MTU = 1420
PostUp = iptables -A FORWARD -i %i -o %i -j ACCEPT
PostDown = iptables -D FORWARD -i %i -o %i -j ACCEPT
[Peer]
PublicKey = <Peer 1 Public Key>
AllowedIPs = 10.10.10.2/32 # Peer 1 IP Adresse
[Peer]
PublicKey = <Peer 2 Public Key>
AllowedIPs = 10.10.10.3/32 # Peer 2 IP Adresse
24.10.2022
Wireguard VPN
8
wg-quick
#
- Interface hochfahren mit
sudo wg-quick up wg0
- ... herunterfahren mit
sudo wg-quick down wg0
24.10.2022
Wireguard VPN
9
# Client config
# /etc/wireguard/wg0.conf
[Interface]
PrivateKey = <Eigener Private Key>
Address = 10.10.10.2/32
[Peer]
PublicKey = <Public Key vom Server>
AllowedIPs = 10.10.10.0/24
Endpoint = <IP des Servers>:<Port des Servers>
PersistentKeepalive = 25 # NAT offen halten mit Keepalive messages
24.10.2022