Inst wireguard » History » Version 6
Michael Gunsch, 09/25/2023 10:34 AM
| 1 | 2 | Michael Gunsch | h1. Installation WireGuard unter Debian |
|---|---|---|---|
| 2 | 3 | Michael Gunsch | |
| 3 | h2. Anleitung |
||
| 4 | |||
| 5 | https://www.wireguard.com/ |
||
| 6 | |||
| 7 | 4 | Michael Gunsch | h2. Pakete installieren |
| 8 | |||
| 9 | <pre> |
||
| 10 | sudo apt install wireguard wireguard-tools |
||
| 11 | </pre> |
||
| 12 | |||
| 13 | 3 | Michael Gunsch | h2. Konfiguration |
| 14 | 4 | Michael Gunsch | |
| 15 | h3. Schlüsselpaar erzeugen |
||
| 16 | |||
| 17 | <pre> |
||
| 18 | wg genkey | tee wg_priv_key | wg pubkey > wg_pub_key |
||
| 19 | chmod 600 wg_priv_key |
||
| 20 | chmod 600 wg_pub_key |
||
| 21 | </pre> |
||
| 22 | |||
| 23 | 5 | Michael Gunsch | Der private Schlüssel bleibt lokal, der öffentliche Schlüssel wird zum entfernten Partner übertragen. |
| 24 | |||
| 25 | h3. Konfigurationsdatei lokal |
||
| 26 | |||
| 27 | Die Konfigurationsdatei liegt in @/etc/wireguard/wg0.conf@, wobei anstelle der Null eine beliebige Zahl stehen darf. Dieser Name – im Beispiel @wg0@ – ist auch der Name der Netzwerkschnittstelle, die von WireGuard angelegt wird. |
||
| 28 | |||
| 29 | 6 | Michael Gunsch | /etc/wireguard/wg0.conf |
| 30 | |||
| 31 | 5 | Michael Gunsch | <pre> |
| 32 | [Interface] |
||
| 33 | PrivateKey = <insert private key here> |
||
| 34 | Address = 172.16.4.8/24 |
||
| 35 | |||
| 36 | [Peer] |
||
| 37 | PublicKey = <insert peer's public key here> |
||
| 38 | AllowedIPs = 172.16.4.0/24 |
||
| 39 | Endpoint = puntodivista.ch:51820 |
||
| 40 | PersistentKeepalive = 25 |
||
| 41 | |||
| 42 | </pre> |
||
| 43 | |||
| 44 | h3. Konfigurationsdatei entfernt |