Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
| en:howtos:wireguard [2022/02/18 08:09] – Externe Bearbeitung 127.0.0.1 | en:howtos:wireguard [2022/02/18 08:23] (aktuell) – morquai | ||
|---|---|---|---|
| Zeile 1: | Zeile 1: | ||
| - | ====== Wireguard | + | ====== Wireguard |
| - | Die Frage, wozu man ein [[https:// | + | The question why you need a [[https:// |
| - | * Sicheres Nutzen des Internets auch in öffentlichen | + | * Secure use of the Internet |
| - | * Zugriff auf die heimische Netzwerkfestplatte | + | * Access to the home network hard drive |
| - | PiVPN hat vor einiger Zeit als Standard von OpenVPN | + | PiVPN switched from OpenVPN |
| - | Als Server dient uns ein Raspberry Pi 4 mit [[https:// | + | Our server is a Raspberry Pi 4 with [[https:// |
| - | Raspberry Pi OS liefert einen Kernel mit, der mit Wireguard | + | Raspberry Pi OS ships with a kernel compatible with Wireguard. |
| uname -a | cut -d" " -f3 | uname -a | cut -d" " -f3 | ||
| - | liefert die gewünschte Information | + | provides the desired information |
| ===== Installation ===== | ===== Installation ===== | ||
| apt install wireguard | apt install wireguard | ||
| - | Ja, das war es auch schon :-) Wireguard | + | Yes, that's about it :-) Wireguard |
| - | ===== Konfiguration | + | ===== Configuration |
| - | Sowohl Client als auch Server benötigen eine Konfigurationsdatei. \\ | + | Both client and server require a configuration file. \\ |
| - | Server | + | Server |
| - | Hier kurze Beispiele, | + | Here are short examples |
| - | **Server | + | **Server |
| / | / | ||
| [Interface] | [Interface] | ||
| - | # Server zuhause | + | # Home servers |
| Address = 10.8.10.1/ | Address = 10.8.10.1/ | ||
| SaveConfig = false | SaveConfig = false | ||
| ListenPort = 51196 | ListenPort = 51196 | ||
| - | PrivateKey = <Private Key des Servers> | + | PrivateKey = <Server' |
| [Peer] | [Peer] | ||
| - | # Client | + | # Client |
| - | PublicKey = <Public key des Client | + | PublicKey = <Public key of client |
| AllowedIPs = 10.8.10.2/ | AllowedIPs = 10.8.10.2/ | ||
| [Peer] | [Peer] | ||
| - | # Client | + | # Client |
| - | PublicKey = <Public key des Client | + | PublicKey = <Public key of client |
| AllowedIPs = 10.8.10.3/ | AllowedIPs = 10.8.10.3/ | ||
| | | ||
| - | **Client 2 Konfiguration**, dieser Client nutzt den VPN nur zum Zugriff auf das heimische Netzwerk: | + | **Client 2 configuration**, this client only uses the VPN to access the home network: |
| [Interface] | [Interface] | ||
| - | # Client | + | # Client |
| - | PrivateKey = <Private Key des Client | + | PrivateKey = <private key of client |
| Address = 10.8.10.2/ | Address = 10.8.10.2/ | ||
| # DNS = 9.9.9.9 | # DNS = 9.9.9.9 | ||
| [Peer] | [Peer] | ||
| - | # Server zuhause | + | # Home servers |
| - | PublicKey = <Public Key des Servers> | + | PublicKey = <public key of the server> |
| - | AllowedIPs = 10.8.10.0/ | + | AllowedIPs = 10.8.10.0/ |
| - | Endpoint = dein.dyndns.de: | + | Endpoint = your.dyndns.de: |
| PersistentKeepalive = 30 | PersistentKeepalive = 30 | ||
| - | **Client 3 Konfiguration**, dieser Client nutzt den VPN für sämtlichen Netzwerk Traffic: | + | **Client 3 configuration**, this client uses the VPN for all network traffic: |
| [Interface] | [Interface] | ||
| - | # Client | + | # Client |
| - | PrivateKey = <Private Key des Client 3> | + | PrivateKey = <Client 3's private key> |
| Address = 10.8.10.3/ | Address = 10.8.10.3/ | ||
| DNS = 9.9.9.9 | DNS = 9.9.9.9 | ||
| [Peer] | [Peer] | ||
| - | # Server zuhause | + | # Home servers |
| - | PublicKey = <Public Key des Servers> | + | PublicKey = <public key of the server> |
| - | AllowedIPs = 10.8.10.0/ | + | AllowedIPs = 10.8.10.0/ |
| - | Endpoint = dein.dyndns.de: | + | Endpoint = your.dyndns.de: |
| PersistentKeepalive = 30 | PersistentKeepalive = 30 | ||
| - | Der Parameter | + | The parameter |
| - | Wenn sämtlicher Traffic | + | If all traffic |
| - | Der Wireguard | + | The Wireguard |
| - | systemctl start wg-quick@zuhause | + | systemctl start wg-quick@home |
| - | Soll der Server im Rahmen des Raspberry Pi boot automatisch gestartet werden, geht dies so: | + | If the server is to be started automatically as part of the Raspberry Pi boot, this is how it works: |
| - | systemctl enable wg-quick@zuhause | + | systemctl enable wg-quick@home |
| - | "zuhause" | + | "home" |
| - | ===== Das geht auch einfacher | + | ===== There is an easier way ===== |
| - | Wer keine Lust hat, sich die Konfigurationsdateien, die Keys etc selbst zu basteln, kann dies auch per Script auf den Raspberry Pi erledigen lassen. Ihr findet meine Lösung auf [[https:// | + | If you don't feel like making the configuration files, the keys, etc. yourself, you can also have this done using a script on the Raspberry Pi. You can find my solution on [[https:// |
| - | Das Tool stellt ein Verzeichnis mit allen nötigen Dateien und ein paar Hilfsdateien, | + | The tool provides a directory with all the necessary files and a few auxiliary files that make life easier. |
| - | * Private | + | * Private |
| - | * Für jeden Client einen QR Code, der mit der Wireguard | + | * A QR code for each client, which can be easily scanned with the Wireguard |
| - | * Eine .csv Datei, die es erleichtert sich zu merken | + | * A .csv file that makes it easy to remember |
| - | Viel Spass | + | Have fun |
| ===== Ein wenig Technik dazu? ===== | ===== Ein wenig Technik dazu? ===== | ||
| Zeile 79: | Zeile 79: | ||
| * Route ist nicht gleich Route. Routen werden normalerweise mit einem Ziel und einem Gateway konfiguriert, | * Route ist nicht gleich Route. Routen werden normalerweise mit einem Ziel und einem Gateway konfiguriert, | ||
| * Wireguard unterstützt im Gegensatz nur das UPD Protokoll, TCP kann nicht verwendet werden. Ein " | * Wireguard unterstützt im Gegensatz nur das UPD Protokoll, TCP kann nicht verwendet werden. Ein " | ||
| + | ===== A bit of technology? ===== | ||
| + | There are always stumbling blocks. The routing in particular is a frequently misconfigured stumbling block when using a VPN. If in doubt, no Internet access works anymore. Here are a few thoughts: | ||
| + | * The server provides the clients with access to the home network on the one hand and to the Internet on the other. " | ||
| + | * Route is not always the same route. Routes are typically configured with a destination and a gateway, where the gateway is the IP address of a single router, while the destination can be a single machine or a network. Another type of routing takes place without a specific gateway and leaves finding a suitable router to others. These interface routes are supported by the Wireguard software because Wireguard knows the network connections of all clients.\\ | ||
| + | * In contrast, Wireguard only supports the UPD protocol, TCP cannot be used. It is not possible to " | ||