- Add DISCOVERY_LOG_LEVEL=debug - Add DISCOVERY_SHOW_PROGRESS=true - Temporary changes for debugging InitializerProcessor fixes on production
133 lines
3.7 KiB
Markdown
133 lines
3.7 KiB
Markdown
# WireGuard Ansible (Vereinfacht)
|
|
|
|
Einfache Ansible-Konfiguration für einen WireGuard VPN-Server **ohne Firewall**. Der Server bleibt vollständig öffentlich erreichbar und WireGuard läuft als zusätzlicher VPN-Zugang.
|
|
|
|
## 🚀 Schnellstart
|
|
|
|
```bash
|
|
# 1. Server-IP anpassen
|
|
nano inventory/hosts.yml
|
|
|
|
# 2. Clients anpassen
|
|
nano inventory/group_vars/vpn.yml
|
|
|
|
# 3. Installation
|
|
make install
|
|
|
|
# 4. Client-Configs herunterladen
|
|
make download-configs
|
|
```
|
|
|
|
## 📋 Verfügbare Befehle
|
|
|
|
### Installation
|
|
- `make install` - WireGuard installieren
|
|
- `make setup` - Nur Server installieren
|
|
- `make clients` - Client-Konfigurationen erstellen
|
|
|
|
### Client-Management
|
|
- `make add-client` - Neuen Client hinzufügen
|
|
- `make remove-client` - Client entfernen
|
|
- `make show-clients` - Vorhandene Clients anzeigen
|
|
|
|
### Status & Wartung
|
|
- `make status` - WireGuard-Status anzeigen
|
|
- `make logs` - WireGuard-Logs anzeigen
|
|
- `make restart` - Service neustarten
|
|
- `make qr-codes` - QR-Codes für mobile Clients
|
|
|
|
### Konfiguration
|
|
- `make download-configs` - Client-Configs herunterladen
|
|
- `make backup` - Backup erstellen
|
|
- `make check` - Syntax prüfen
|
|
|
|
## 📁 Projektstruktur
|
|
|
|
```
|
|
wireguard-server/
|
|
├── inventory/
|
|
│ ├── hosts.yml # Server-Konfiguration
|
|
│ └── group_vars/vpn.yml # WireGuard-Einstellungen
|
|
├── roles/wireguard/
|
|
│ ├── tasks/
|
|
│ │ ├── main.yml # Haupt-Tasks
|
|
│ │ ├── install.yml # WireGuard-Installation
|
|
│ │ ├── configure.yml # Server-Konfiguration
|
|
│ │ └── network.yml # Netzwerk-Setup
|
|
│ ├── templates/
|
|
│ │ ├── wg0.conf.j2 # Server-Config
|
|
│ │ └── client.conf.j2 # Client-Config
|
|
│ └── handlers/main.yml # Service-Handler
|
|
├── site.yml # Haupt-Playbook
|
|
├── add-client.yml # Client hinzufügen
|
|
├── remove-client.yml # Client entfernen
|
|
├── show-clients.yml # Clients anzeigen
|
|
└── Makefile # Einfache Befehle
|
|
```
|
|
|
|
## ⚙️ Konfiguration
|
|
|
|
### Server (`inventory/hosts.yml`)
|
|
```yaml
|
|
all:
|
|
children:
|
|
vpn:
|
|
hosts:
|
|
wireguard-server:
|
|
ansible_host: 94.16.110.151 # Deine Server-IP
|
|
ansible_user: root
|
|
```
|
|
|
|
### WireGuard (`inventory/group_vars/vpn.yml`)
|
|
```yaml
|
|
wireguard_server_ip: 94.16.110.151
|
|
wireguard_network: "10.8.0.0/24"
|
|
wireguard_clients:
|
|
- name: "laptop-michael"
|
|
address: "10.8.0.10"
|
|
- name: "phone-michael"
|
|
address: "10.8.0.11"
|
|
```
|
|
|
|
## 🌐 Zugriffsmöglichkeiten
|
|
|
|
Nach der Installation hast du **beide** Optionen:
|
|
|
|
### Öffentlicher Zugriff (wie bisher)
|
|
```bash
|
|
ssh root@94.16.110.151
|
|
```
|
|
|
|
### VPN-Zugriff (zusätzlich)
|
|
1. WireGuard-Client mit `.conf`-Datei konfigurieren
|
|
2. VPN-Verbindung aktivieren
|
|
3. Zugriff über VPN-IP: `ssh root@10.8.0.1`
|
|
|
|
## 🔒 Was ist sicher?
|
|
|
|
- ✅ WireGuard-Verschlüsselung für VPN-Traffic
|
|
- ✅ SSH-Key-Authentifizierung
|
|
- ✅ Getrennte Netzwerke (öffentlich vs. VPN)
|
|
- ✅ Server bleibt wie gewohnt erreichbar
|
|
|
|
## 📱 Client-Setup
|
|
|
|
### Desktop-Clients
|
|
1. `make download-configs`
|
|
2. `.conf`-Datei in WireGuard-Client importieren
|
|
|
|
### Mobile Clients
|
|
1. `make qr-codes`
|
|
2. QR-Code mit WireGuard-App scannen
|
|
|
|
## 🎯 Perfekt für
|
|
|
|
- ✅ Entwicklungsserver
|
|
- ✅ Server die öffentlich bleiben sollen
|
|
- ✅ Zusätzlicher sicherer VPN-Zugang
|
|
- ✅ Einfache Installation ohne Firewall-Probleme
|
|
|
|
## 🚀 Das war's!
|
|
|
|
Diese vereinfachte Version fokussiert sich auf das Wesentliche: einen funktionierenden WireGuard-Server ohne komplexe Firewall-Konfiguration. Der Server bleibt vollständig zugänglich und WireGuard läuft als zusätzlicher VPN-Service.
|