Add WireGuard VM migration troubleshooting
- Document WireGuard conflict when running on host AND VM - Add NAT port-forwarding solution for VM migration - Include iptables-persistent setup 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -634,6 +634,51 @@ egrep -c '(vmx|svm)' /proc/cpuinfo # Sollte > 0 sein
|
||||
|
||||
---
|
||||
|
||||
### WireGuard nach VM-Migration
|
||||
|
||||
**Problem:** Services nicht erreichbar nach Migration der Container in eine VM
|
||||
|
||||
**Ursache:** WireGuard laeuft noch auf dem Proxmox Host UND in der VM mit gleicher Konfiguration. Der VPS verbindet sich mit dem Host statt der VM.
|
||||
|
||||
**Diagnose:**
|
||||
```bash
|
||||
# Auf Host pruefen - sollte NICHT laufen nach Migration
|
||||
wg show wg0
|
||||
|
||||
# Auf VM pruefen - sollte laufen
|
||||
ssh root@192.168.178.200 "wg show wg0"
|
||||
```
|
||||
|
||||
**Loesung:**
|
||||
```bash
|
||||
# 1. WireGuard auf Host deaktivieren
|
||||
systemctl stop wg-quick@wg0
|
||||
systemctl disable wg-quick@wg0
|
||||
|
||||
# 2. Port-Forwarding auf Host einrichten (UDP 51820 -> VM)
|
||||
iptables -t nat -A PREROUTING -i vmbr0 -p udp --dport 51820 -j DNAT --to-destination 192.168.178.200:51820
|
||||
iptables -t nat -A POSTROUTING -o vmbr0 -j MASQUERADE
|
||||
|
||||
# 3. Regeln persistent machen
|
||||
apt install iptables-persistent
|
||||
iptables-save > /etc/iptables/rules.v4
|
||||
|
||||
# 4. WireGuard auf VM mit festem Port konfigurieren
|
||||
# In /etc/wireguard/wg0.conf:
|
||||
# [Interface]
|
||||
# ListenPort = 51820
|
||||
|
||||
# 5. WireGuard auf VM neu starten
|
||||
ssh root@192.168.178.200 "wg-quick down wg0 && wg-quick up wg0"
|
||||
```
|
||||
|
||||
**Verkehrsfluss nach Fix:**
|
||||
```
|
||||
VPS (10.0.0.1) --> Host:51820 (NAT) --> VM:51820 (WireGuard) --> Container
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Kontakt / Hilfe
|
||||
|
||||
- **Gitea Issues:** https://eckardt-git.duckdns.org/Martin/proxmox-infrastruktur/issues
|
||||
|
||||
Reference in New Issue
Block a user