Files
bf-infra/docs/core-switch-prep.md
Christoph Emsenhuber 1f6e2a000b Docs: core-switch-prep auf aktuellen Stand bringen
- Phase A als ABGESCHLOSSEN markiert (Firmware 2.2.1, VLAN-DB+Names, Save)
- Alte DRAFT-Inhalte (172.20/30/40-Schema, FW-Update 'heute', Web-UI-Skripting) entfernt
- Neue Struktur: Status/Phase-A/Phase-B-Cutover-Plan/Gotchas/Offene-Punkte
- Telnet-VTY-Lockout, Mgmt-VLAN-Lockout, Gateway-Migration, end-vs-exit dokumentiert
- README: SSOT-Link auf HANDOVER.md, Struktur-Übersicht, aktueller Stand
2026-06-09 19:01:14 +02:00

118 lines
6.0 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
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.
# Core-Switch ALL-SG8316M — Vorbereitung & Status
> Stand: **2026-06-09** — Phase A (VLAN-Vorbereitung) abgeschlossen.
> Phase B (hAP-Cutover) wartet auf die MikroTik hAP ax².
> Vollständige Übergabe/Architektur: `HANDOVER.md` im Repo-Root.
> CLI-Referenz: `switch/cli/CLI-REFERENCE.md`.
Switch: **ALLNET ALL-SG8316M**, 16× Gigabit, Smart-Managed. **FW 2.2.1.2956** (geflasht am 2026-06-08 von 1.0/2014).
Mgmt-IP: **10.40.41.239** (statisch, im MAIN-Subnetz bis zum Cutover → wandert nach vlan99/10.40.99.2).
Login: `claudecode` (Creds in `switch/.secrets`).
## 0. Capability-Check (verifiziert)
| Anforderung | ALL-SG8316M | Quelle |
|---|---|---|
| IEEE 802.1Q VLAN tagged | ✅ | UM, VLAN-Kapitel |
| Port-Modus Trunk (1 untagged + n tagged) | ✅ | UM |
| Port-Modus Access (nur untagged) | ✅ | UM |
| Port-Modus Hybrid | ✅ | UM (default auf allen Ports!) |
| PVID je Port (1–4094) | ✅ | UM |
| STP/RSTP, LACP, Port-Mirroring, 802.3x | ✅ | UM |
| Web-UI skriptbar (FW 1.0) | ✅ | Realtek `dispatcher.cgi` |
| Web-UI skriptbar (FW 2.2.1) | ❌ | cmd-Codes geändert (`cmd=2` → 404) |
| SSH | ❌ | nur Telnet (Port 23) |
| Telnet-VTY-Lines | **1** | ⚠️ reapt stale Sessions schlecht |
## 1. VLAN-Schema (final — User-bestätigt 2026-06-09)
Siehe `docs/vlan-plan.md` für die ausführliche Version mit Begründungen.
| VLAN | Name | Subnetz (Ziel) | Interim | Zweck |
|---|---|---|---|---|
| 10 | MAIN | 10.40.10.0/24 | **10.40.41.0/24** | Trusted-Clients + Media (Discovery!) |
| 20 | INFRA | 10.40.20.0/24 | 172.x | Server, VMs, Docker, NAS, HA |
| 30 | IOT | 10.40.30.0/24 | — | Smart-Home (HA-managed) |
| 40 | UNTRUSTED | 10.40.40.0/24 | — | Spielekonsole, Low-Trust-Internet |
| 90 | GUEST | 10.40.90.0/24 | — | nur Internet (abgesetzt; 50–89 frei) |
| 99 | MGMT | 10.40.99.0/24 | Switch vorerst .239 | Switch/AP/Hypervisor-Mgmt |
| 100 | WAN | (FB-Transfer) | — | zur Fritzbox |
| 1 | default | — | aktuell alle Ports untagged | Lifeboat bis Cutover |
**Adress-Konvention:** 3. Oktet = VLAN-ID (10.40.<vlanid>.0/24). Gateway je VLAN = `.1` (hAP#1). Switch-Mgmt = `10.40.99.2` (nach Cutover).
## 2. Port-Map (16 Ports) — Ist vs. Soll
**Ist** (`inventory/bf-core-ports.csv`):
| Port | Heute |
|---|---|
| 4 | Wohnzimmer-Switch |
| 8 | Arbeitszimmer-Switch (`.10`/`.167`/`.247`) |
| 15 | pve (Mac mini) |
| 16 | FB (`.246` auf FB-LAN4) |
**Soll** (nach Phase-B-Cutover):
| Port | Ziel | Modus |
|---|---|---|
| 16 | FB-Uplink | Access untagged vlan100 |
| 2 oder 3 | hAP ax² #1 (Trunk) | Trunk tagged 10,20,30,40,90,100 |
| 2 oder 3 | hAP ax² #2 (Trunk) | Trunk tagged 10,20,30,40,90 |
| 4, 8, 15 | interim MAIN | Access untagged vlan10 |
| 1 oder 16 | Lifeboat bis Mgmt sicher | Access untagged vlan1 |
> ⚠️ **Port-Map noch nicht final** — wird beim Cutover ausgefüllt, abhängig von hAP-Standorten.
## 3. Phase A (VLAN-Vorbereitung) — ✅ ABGESCHLOSSEN 2026-06-09
Alles hier änderte **nichts** am laufenden Flach-Netz (FB blieb Gateway, alle Live-Ports blieben VLAN1 untagged).
1. ✅ **Config-Backup:** `show running-config` → `switch/cli/running-PRE.txt` (Netzmasken-Syntax `mask 255.255.255.0` bestätigt)
2. ✅ **Firmware-Update:** 1.0 (2014) → 2.2.1.2956 (2018). Details: `docs/firmware-flash-runbook.md`
3. ✅ **VLAN-DB angelegt + benannt:** 10=MAIN, 20=INFRA, 30=IOT, 40=UNTRUSTED, 90=GUEST, 99=MGMT, 100=WAN. **Alle Static, keine Port-Membership → null Disruption.**
4. ✅ **Save** (Success), `show vlan` verifiziert.
5. ✅ CLI-Reference (`switch/cli/CLI-REFERENCE.md`) mit bestätigter Syntax aktualisiert.
**Reproduzierbar:**
```bash
cd ~/dev/bf-network-r6/switch
. ./.secrets
expect cli/02-vlan-names.exp # benennt die VLANs (idempotent)
# ODER: manuell:
# expect cli/01-vlan-db.exp # legt VLANs an (aus 01-vlan-db.cli)
```
## 4. Phase B (hAP-Cutover) — AUSSTEHEND (MikroTik hAP ax² bestellt, noch nicht da)
**Voraussetzungen:**
- 2× MikroTik hAP ax² produktiv
- Technitium-DNS läuft (pve + fm)
- Switch-Phase-A abgeschlossen ✅
**Schritte (geplant, Details in `HANDOVER.md` §5.B):**
1. Trunk-Ports (2 & 3) am Switch auf Trunk tagged 10,20,30,40,90,100 konfigurieren
2. hAP #1 + #2 einstecken
3. hAP #1 = Router/Gateway (10.40.<vlan>.1), DHCP, DNS, CAKE/SQM, CAPsMAN
4. FB umstellen: DHCP aus, "Exposed Host" → hAP#1-WAN-IP. FB-Port (16) → Access untagged vlan100.
5. Live-Ports (4, 8, 15) → Access untagged vlan10 (PVID 10).
6. Switch-Mgmt → vlan99, IP 10.40.99.2.
7. **Gateway-Migration .254 → .1** via Secondary-IP auf hAP#1 (siehe Gotcha §6).
## 5. ⚠️ Gotchas (Cutover-kritisch)
- **Telnet-VTY-Lockout:** Nur 1 VTY-Line. Stale Sessions blockieren ~15 min. **Immer serialisiert, sauber ausloggen.** Bei "busy" warten statt hämmern. Recovery: Switch rebooten.
- **Mgmt-VLAN-Lockout:** Ziel-VLAN muss existieren UND der Mgmt-Port muss es tragen, sonst Reachability weg. Reset-Button ist einziger Fallback (kein serieller Konsolen-Port).
- **Gateway-Migration .254 → .1:** Alt-Lease-Clients zeigen noch auf .254. FB verlässt aber das LAN → Clients tot. **Mitigation:** hAP#1 temporär Secondary-IP `.254` bis alle Leases renewen.
- **CLI-Semantik:** In `expect`-Scripts `exit` aus `(config-vlan)` benutzen, nicht `end` (`end` aus config-vlan geht DIREKT zu `sw1#` und überspringt die config-Ebene).
- **Web-UI skripten ist tot:** FW 2.2.1 hat die Realtek-`dispatcher.cgi`-cmd-Codes geändert. Telnet-CLI ist der einzige automatisierbare Weg.
## 6. Offene Punkte
- [x] VLAN-Schema final (mit 90=GUEST statt 40=Guest — eigene ID für Spielekonsole als IoT-Verschärfung)
- [x] Firmware geflasht (1.0 → 2.2.1.2956)
- [x] VLAN-DB angelegt + benannt + saved
- [ ] **MikroTik hAP ax²** (bestellt, Lieferung ausstehend)
- [ ] **Echte Port-Belegung finalisieren** (hAP-Standorte unbekannt → Trunk-Port-Wahl offen)
- [ ] **Phase B:** Trunk-Config, hAP-Bestückung, Cutover-Plan detail
- [ ] **Phase C:** Firewall Least-Privilege-Regelwerk
- [ ] **Phase D:** Adress-Migrationen (MAIN 10.40.41 → 10.40.10, INFRA 172.x → 10.40.20, NAS .10 → INFRA)