brain/03 Bereiche/Heimnetz/Netzwerk/OpnSense/Terra Firewall OPNsense.md

117 lines
5.5 KiB
Markdown
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
tags: [netzwerk, heimnetz, firewall]
---
# Terra Firewall (OPNsense)
Hauptfirewall im Heimnetz, Hardware "BLACK DWARF" G3 UTM. Stand: 2026-05-25, OPNsense **26.1.3 (amd64)**.
## Hardware / Zugriff
- **Inventarseite:** [[I: TERRA FIREWALL "BLACK DWARF" G3 UTM 1 Jahr🗄]]
- **MAC:** 00:07:32:7B:91:93
- **Hostname/Domain:** `OPNsense.home.internal`
- **WebUI:** https://192.168.1.1:55443/ (HTTPS, kein HTTP-Redirect)
- **AdGuard:** http://192.168.1.1:3000/
- **SSH:** Port 22, root erlaubt (Pubkey ed25519). Gruppe `admins`.
- **Backup-Config-Export:** WebUI → System / Configuration / Backups → Download
## Interfaces
| Key | Rolle | Phys. | IPv4 | Netz |
| ----- | --------------- | ------- | ----------------- | -------------- |
| wan | WAN | igc1 | 192.168.178.21 (DHCP von FritzBox) | 192.168.178.0/24 |
| lan | LAN / Mgmt | igc0 | 192.168.1.1 | 192.168.1.0/24 |
| opt1 | VLAN 10 USER | vlan01 | 10.10.0.1 | 10.10.0.0/16 |
| opt2 | VLAN 20 GUEST | vlan02 | 10.20.0.1 | 10.20.0.0/16 |
| opt3 | VLAN 30 IOT | vlan03 | 10.30.0.1 | 10.30.0.0/16 |
| opt4 | VLAN 40 SERVER | vlan040 | 10.40.0.1 | 10.40.0.0/16 |
| opt5 | VLAN 41 DOCKER_NAS | vlan041 | 10.40.10.1 | 10.40.10.0/24 |
| opt6 | WireGuard WG1 | wg0 | (per Tunnel) | 10.123.123.0/24 |
Alle VLANs trunken über `igc0`. Details siehe [[03 Bereiche/Heimnetz/Netzwerk/VLANs]].
## DNS-Kette
Client → **AdGuard Home :53****Unbound :5353** → Upstream (Quad9 / Google DoH/DoT).
Sonderfall `internal.home`: Unbound forwarded via DoT auf 127.0.0.1:53053 zurück an AdGuard (für dnsmasq-Hostnamen).
Siehe [[AdGuard auf OPNsense installieren]].
## DHCP
Backend **dnsmasq** (Kea disabled). Domain `internal` / `internal.home`. ~25 statische Reservierungen.
## NAT & externer Zugriff
| WAN-Port | Ziel | Zweck |
| -------- | ------------- | ---------------- |
| TCP 80 | 10.40.0.201:80 | HAProxy → Redirect HTTPS |
| TCP 443 | 10.40.0.201:443 | HAProxy → Subdomains *.straso.com |
| UDP 51820| OPNsense | WireGuard Server WG1 |
WAN blockt zusätzlich: Bogons, Private Networks, Alias `suspicious_WAN_hosts` (`20.171.207.15`).
## HAProxy
Reverse-Proxy für `*.straso.com`. Frontends `http_lan_wan` / `https_lan_wan` (auf VIP 10.40.0.201) und `https_lan` (auf VIP 10.40.0.202, intern only).
Aktive Backends: `kbha_backend` → 192.168.1.192:8123 (Home Assistant), `git_backend` → 10.40.10.130:3000 (Gitea), `acme_challenge_backend` → 127.0.0.1:43580.
Inaktiv/vorbereitet: `paper_backend`, `nas_backend`, `immich_backend`, `portainer_backend`.
Details: [[03 Bereiche/Heimnetz/Zugriff aus dem Web/HAProxy Reverse-Proxy auf OPNsense]] und [[03 Bereiche/Heimnetz/Zugriff aus dem Web/Home Assistant über HAProxy]].
## ACME / Let's Encrypt
Plugin `os-acme-client`. Account `kauer` bei Let's Encrypt.
| Cert | altNames | Validation | Auto-Renewal | Restart-Action |
| ----------- | ----------------------------------------------------------- | ------------------ | ------------ | -------------- |
| straso.com | kbha, git, paper, nas, photo, cloud, mail.straso.com | DNS-01 IONOS | alle 60 Tage | Restart HAProxy ✓ |
| *.kbu.home64.de | | DNS-01 IPv64 | aktiv (cert disabled) | Restart HAProxy ✓ |
Cron: täglich 03:55. Details: [[03 Bereiche/Heimnetz/Zugriff aus dem Web/SSL-Zertifikat Straso.com]].
## Plugins (installiert)
`os-acme-client`, `os-adguardhome-maxit`, `os-ddclient`, `os-haproxy`, `os-isc-dhcp`, `os-nginx`, `os-ntopng`, `os-postfix`, `os-redis`, `os-sensei` (Zenarmor), `os-sensei-updater`, `os-sunnyvalley`.
Aktiv: AdGuardHome, HAProxy, ACME, Postfix (Relay über `smtp.ionos.de`), Redis (:6379), Zenarmor (mit IDS, CommunityID), Netflow v9 (Collector 127.0.0.1:2056), Hostwatch.
Inaktiv / standby: Nginx-Plugin (für Immich vorbereitet), Suricata IDS, ntopng, DDClient (IPv64), Monit, Captive Portal.
## VPN
**WireGuard WG1** — UDP 51820, Tunnel 10.123.123.0/24:
- Peer `NB-DR-ChrKa` → 10.123.123.11
- Peer `iPhoneChristian` → 10.123.123.12
- Peer `wg1` → 10.0.0.2
OpenVPN/IPsec leer.
## Firewall-Logik (kompakt)
- `lan`: AdminDevices→any (Log), lan→HAProxy40 erlaubt, DNS-Pass, sonst lan→!Private blockt
- VLANs: jeweils DNS-Pass + `→ !Private` block (Inter-VLAN-Isolation)
- `opt4 SERVER`: zusätzlich KBNAS→KBHA Backup, opt4→HAProxy40
- `opt5 DOCKER_NAS`: SMTP self:25, opt5→HAProxy40
- `opt6 WG1`: WireGuard → any (markiert `CHANGE LATER!!`)
Aliases: `PrivateNetworks`, `AdminDevices`, `HAProxyPorts`, `FritzNetwork`, `HAProxy40_lan_wan`, `HAProxy40_lan`, `UserDevices`, `UserServers`, `BlockedDevices` (MAC iPad), `suspicious_WAN_hosts`.
## Verwandte Notizen
- [[03 Bereiche/Heimnetz/Netzwerk/VLANs]] / [[VLANs einrichten]]
- [[AdGuard auf OPNsense installieren]]
- [[03 Bereiche/Heimnetz/Netzwerk/Multicast DNS Repeater]]
- [[03 Bereiche/Heimnetz/Netzwerk/OpnSense/Full Cert Chain in OpnSense verwenden]]
- [[03 Bereiche/Heimnetz/Zugriff aus dem Web/HAProxy Reverse-Proxy auf OPNsense]]
- [[03 Bereiche/Heimnetz/Zugriff aus dem Web/HAProxy & Let's Encrypt]]
- [[03 Bereiche/Heimnetz/Netzwerk/IP-Übersicht]]
## Externe Links
- [OPNsense - Router - schulnetzkonzept.de](https://old.schulnetzkonzept.de/opnsense)
- [DoT auf OPNsense konfigurieren - zenarmor.com](https://www.zenarmor.com/docs/de/netzwerksicherheitstutorials/wie-konfiguriert-man-dot-auf-der-opnsense-firewall)