Files
michaelschiemer/docs/deployment/VPN-ROUTING-PROBLEM-ANALYSIS.md

121 lines
3.1 KiB
Markdown

# VPN-Routing Problem - Analyse
## Problem
? **Hosts-Datei funktioniert**: `grafana.michaelschiemer.de` wird auf `10.8.0.1` aufgel?st
? **Traffic l?uft NICHT ?ber VPN**: Traefik-Logs zeigen `ClientHost: 89.246.96.244` (?ffentliche IP) statt `10.8.0.7` (VPN-IP)
## Was passiert
1. Browser fragt: "Wo ist grafana.michaelschiemer.de?"
2. Hosts-Datei antwortet: "10.8.0.1"
3. Browser sendet Request an `10.8.0.1`
4. **Problem**: Windows sendet Traffic NICHT ?ber WireGuard-Interface, sondern ?ber Standard-Route
5. Resultat: Traffic kommt mit ?ffentlicher IP (`89.246.96.244`) am Server an
## M?gliche Ursachen
### 1. WireGuard AllowedIPs nicht korrekt
Die WireGuard-Client-Konfiguration muss sicherstellen, dass Traffic f?r `10.8.0.0/24` ?ber VPN geht.
**Aktuell m?glicherweise:**
```ini
[Peer]
AllowedIPs = 10.8.0.1/32 # Nur Server-IP, nicht das ganze Netzwerk
```
**Sollte sein:**
```ini
[Peer]
AllowedIPs = 10.8.0.0/24 # Gesamtes VPN-Netzwerk
```
### 2. Windows Route-Tabelle
Windows k?nnte die Route f?r `10.8.0.0/24` nicht korrekt setzen. Pr?fe mit:
```powershell
# Als Administrator
route print | findstr "10.8"
```
Sollte zeigen:
```
10.8.0.0 255.255.255.0 10.8.0.1 18 # 18 = Interface-Index von WireGuard
```
### 3. Interface-Metrik zu hoch
Obwohl WireGuard Interface-Metrik 5 hat (niedrigste), k?nnte Windows trotzdem das Standard-Interface bevorzugen.
## L?sungen
### L?sung 1: WireGuard AllowedIPs pr?fen und korrigieren
**Auf Windows, pr?fe deine WireGuard-Konfiguration:**
1. ?ffne WireGuard
2. W?hle `grafana-test` Verbindung
3. Klicke auf "Bearbeiten"
4. Pr?fe `[Peer]` Sektion
5. `AllowedIPs` sollte sein: `10.8.0.0/24` (nicht nur `10.8.0.1/32`)
**Beispiel korrekter Konfiguration:**
```ini
[Interface]
PrivateKey = ...
Address = 10.8.0.7/24
DNS = 10.8.0.1
[Peer]
PublicKey = ...
Endpoint = 94.16.110.151:51820
AllowedIPs = 10.8.0.0/24 # ? WICHTIG: Gesamtes Netzwerk!
```
### L?sung 2: Route manuell setzen (falls AllowedIPs nicht hilft)
**Auf Windows (als Administrator):**
```powershell
# Pr?fe aktuelle Route
route print | findstr "10.8"
# Setze Route manuell (falls nicht vorhanden)
route add 10.8.0.0 MASK 255.255.255.0 10.8.0.1 METRIC 1 IF 18
# Pr?fe ob es funktioniert hat
route print | findstr "10.8"
```
### L?sung 3: WireGuard neu verbinden
Nach ?nderung der Konfiguration:
1. **Disconnect** WireGuard-Verbindung
2. **Connect** WireGuard-Verbindung neu
3. Pr?fe Route-Tabelle: `route print | findstr "10.8"`
## Testen
Nach der Korrektur:
1. **Pr?fe Route:**
```powershell
route print | findstr "10.8"
```
2. **Ping Server:**
```powershell
ping 10.8.0.1
```
3. **Teste Grafana-Zugriff:**
- ?ffne `https://grafana.michaelschiemer.de` im Browser
- Pr?fe Traefik-Logs: `ClientHost` sollte `10.8.0.7` sein (nicht `89.246.96.244`)
## N?chste Schritte
1. ? Pr?fe WireGuard-Client-Konfiguration (`AllowedIPs = 10.8.0.0/24`)
2. ? Pr?fe Windows Route-Tabelle (`route print | findstr "10.8"`)
3. ? Falls Route fehlt: Setze manuell
4. ? WireGuard neu verbinden
5. ? Teste Grafana-Zugriff
6. ? Wenn `ClientHost: 10.8.0.7` ? Tempor?re IP-Erlaubnis entfernen