Skip to content
stackfasPublic

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🥧 WirePi – WireGuard VPN Server auf Raspberry Pi 4

24/7 WireGuard VPN Server – performant, stromsparend, ausfallsicher. Betrieben hinter einer Fritz!Box mit DynDNS für dynamische IP-Adressen.


📋 Projektübersicht

Komponente Beschreibung
Hardware Raspberry Pi 4 (2/4/8 GB RAM), 32+ GB microSD
OS Raspberry Pi OS Lite (64-bit, headless)
VPN WireGuard (Kernel-Modul, Linux 5.6+)
Router Fritz!Box (Portfreigabe, statisches DHCP)
DynDNS DuckDNS (kostenlos, Cron-basierter Update)
Firewall iptables + UFW
Monitoring Health-Check-Skript + systemd-Timer

🏗️ Architektur

                         Internet
                            │
                     (DSL/Kabel/Glasfaser)
                            │
                     ┌──────┴──────┐
                     │  Fritz!Box   │
                     │  (Router)    │
                     │              │
                     │ • Port-Fwd:  │
                     │   UDP 51820  │
                     │ • Stat. DHCP │
                     │   für Pi     │
                     └──────┬──────┘
                            │
                     (LAN: 192.168.178.0/24)
                            │
                     ┌──────┴──────┐
                     │ Raspberry Pi │
                     │    4         │
                     │              │
                     │ wg0:         │
                     │ 10.0.0.1/24  │
                     │              │
                     │ • NAT/Masq.  │
                     │ • Firewall   │
                     │ • DDNS-Client│
                     └──────┬──────┘
                            │
              ┌─────────────┼─────────────┐
              │             │             │
        📱 Client 1   💻 Client 2   📱 Client 3
        (10.0.0.2)    (10.0.0.3)    (10.0.0.4)

IP-Adressierung

Typ Adressbereich
LAN (Fritz!Box) 192.168.178.0/24
Pi (LAN) 192.168.178.10 (statisch)
VPN-Subnetz 10.0.0.0/24
VPN-Server 10.0.0.1
VPN-Clients 10.0.0.2 – 10.0.0.254

🚀 Schnellstart

# 1. Raspberry Pi OS installieren & Grundsetup
#    → Siehe docs/02-hardware-setup.md

# 2. Installationsskript ausführen
chmod +x scripts/install.sh
sudo ./scripts/install.sh

# 3. Fritz!Box konfigurieren
#    → Siehe docs/04-fritzbox-setup.md

# 4. DynDNS einrichten
sudo ./scripts/ddns-update.sh --setup

# 5. Ersten Client anlegen
sudo ./scripts/wg-add-client.sh mein-laptop

📁 Projektstruktur

wirepi/
├── README.md                     # Diese Datei
├── Makefile                      # Hilfsbefehle
├── docs/
│   ├── 01-architecture.md        # Architektur & Designentscheidungen
│   ├── 02-hardware-setup.md      # OS-Installation & Grundkonfiguration
│   ├── 03-wireguard-setup.md     # WireGuard Einrichtung
│   ├── 04-fritzbox-setup.md      # Fritz!Box Portfreigabe & DHCP
│   ├── 05-dyndns-setup.md        # Dynamischer DNS
│   ├── 06-security.md            # Härtung & Firewall
│   └── 07-monitoring.md          # Überwachung & Wartung
├── scripts/
│   ├── install.sh                # Vollständige Installation
│   ├── ddns-update.sh            # DynDNS-Update-Skript
│   ├── wg-add-client.sh          # Neuen Client hinzufügen
│   └── health-check.sh           # System-Gesundheitscheck
└── config/
    ├── wg0.conf.template         # WireGuard Server-Konfig
    ├── client.conf.template      # WireGuard Client-Konfig
    └── iptables.rules            # Firewall-Regeln

⚡ Performance

Metrik Raspberry Pi 4
WireGuard-Durchsatz ~500–800 Mbit/s
Gleichz. Clients 20–50 (abhängig von Traffic)
Stromverbrauch ~5–7 Watt (Idle)
CPU-Auslastung <10% bei 100 Mbit/s VPN

Optimierungen

  • CPU-Governor: performance
  • Kernel-Parameter für Netzwerk optimiert
  • BBR Congestion Control
  • log2ram zur Reduzierung von SD-Karten-Schreibzugriffen

🔒 Sicherheit

  • ✅ SSH nur mit Key-Authentifizierung
  • ✅ UFW Firewall (nur UDP 51820 & SSH offen)
  • ✅ Unattended-Upgrades für Sicherheitspatches
  • ✅ Fail2ban für SSH-Brute-Force-Schutz
  • ✅ WireGuard: Nur Public-Key-Authentifizierung
  • ✅ Keine Passwort-Anmeldung
  • ✅ Regelmäßige Updates per Cron

🛡️ Ausfallsicherheit – Eventualitäten

Risiko Maßnahme
SD-Karten-Verschleiß High-Endurance-Karte + log2ram + /tmp als tmpfs
Stromausfall Pi bootet automatisch, WireGuard startet per systemd
IP-Wechsel DuckDNS aktualisiert alle 5 Min per Cron
Fritz!Box-Neustart Statisches DHCP + persistente Portfreigabe
Konfig-Verlust Backup nach /home/pi/backups + optional Git
DNS-Ausfall Fallback-DNS (1.1.1.1, 8.8.8.8)
Angriffe Fail2ban, UFW, kein Passwort-SSH
SD-Karte defekt USB-SSD-Boot als Upgrade-Option (docs)

📝 Lizenz

MIT – Frei verwendbar und anpassbar.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages