ap1-Seite gestaged in routeros/tp10-cutover-apply.rsc (idempotent, am Bridge-Tag anwenden): WG-Peers säubern (Transfernetz-/32 raus) + enable, peer1/FM bidirektional (Endpoint abxhutfgsid9snmy.myfritz.net:52476, kein CGNAT), peer2/DW Dial-in; Spoke- Routen → wg-hub; Input-Chain WAN-Seal (schließt Mgmt-Dienste + offenen Resolver, sobald ether1 die Public-IP hält); ether1 use-peer-dns=no. FB-Seite (kein MCP → Klickanleitung): neue fritzbox-bf-bridge-cutover-klickanleitung.md (Passthrough + alte FM/DW-WG-Teardown + Rollback); fritzbox-wg-lanlan-klickanleitung.md mit Schnellpfad (FM nur Peer-Endpoint auf bf4 umbiegen) + IPsec-Korrektur. Doku: tp10-vpn-migration.md Status → CUTOVER-READY, Live-Stand verifiziert; FM=FB-WG (IPsec längst gekillt) korrigiert. wan-cutover-runbook.md als permanenter Cutover markiert. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
71 lines
4.2 KiB
Plaintext
71 lines
4.2 KiB
Plaintext
# =====================================================================
|
|
# TP10 Cutover-Apply (ap1) — WG-Hub scharf + WAN-Input-Seal
|
|
# =====================================================================
|
|
# Zweck: ap1 in einem Rutsch von "geparkt" auf "Edge + VPN-Hub" bringen.
|
|
# WANN ANWENDEN: am Bridge-Tag, SCHRITT 2 des Runbooks — VOR dem Umstecken
|
|
# von ether1 an den FB-Passthrough-Port.
|
|
# SICHERHEIT: im Double-NAT harmlos — Peers warten auf die Spokes, der
|
|
# WAN-Drop trifft nur das (noch tote) ether1. Kein LAN-Lockout
|
|
# (Drop greift ausschliesslich in-interface-list=WAN = ether1).
|
|
# IDEMPOTENT: alle Blöcke sind wiederholbar (find-Guards / set).
|
|
# ROLLBACK: Peers disabled=yes, WG-Routen + TP10-seal-* Regeln entfernen.
|
|
#
|
|
# Anwenden via MikroMCP: upload_file -> run_script (oder /import)
|
|
# Vorab IMMER: export_config / create_backup
|
|
# ---------------------------------------------------------------------
|
|
|
|
:log info "TP10-cutover: apply start"
|
|
|
|
# --- A) WireGuard-Hub: Peers säubern (Transfernetz raus) + scharf schalten
|
|
# peer1/FM: erreichbar (eigener myfritz-Endpoint, KEIN CGNAT) -> Endpoint setzen
|
|
# => bidirektional (ap1 ODER FM kann aufbauen). peer2/DW bleibt Dial-in (CGNAT, Endpoint leer).
|
|
/interface/wireguard/peers
|
|
set [find where name="peer1"] allowed-address=10.101.0.0/24 \
|
|
endpoint-address=abxhutfgsid9snmy.myfritz.net endpoint-port=52476 disabled=no
|
|
set [find where name="peer2"] allowed-address=192.168.178.0/24,10.95.10.0/24 disabled=no
|
|
|
|
# --- B) Routen zu den Spoke-Netzen (Gateway = Interface wg-hub)
|
|
# RouterOS leitet aus allowed-address KEINE Routen ab -> explizit.
|
|
/ip/route
|
|
:if ([:len [find where dst-address="10.101.0.0/24" gateway="wg-hub"]]=0) do={ \
|
|
add dst-address=10.101.0.0/24 gateway=wg-hub comment="TP10: FM spoke -> wg-hub" }
|
|
:if ([:len [find where dst-address="192.168.178.0/24" gateway="wg-hub"]]=0) do={ \
|
|
add dst-address=192.168.178.0/24 gateway=wg-hub comment="TP10: DW spoke (heute) -> wg-hub" }
|
|
:if ([:len [find where dst-address="10.95.10.0/24" gateway="wg-hub"]]=0) do={ \
|
|
add dst-address=10.95.10.0/24 gateway=wg-hub comment="TP10: DW spoke (kuenftig) -> wg-hub" }
|
|
|
|
# --- C) Input-Chain abdichten (WAN-Seal). Reihenfolge oben->unten:
|
|
# est/rel | drop invalid | [WG 51821 vorhanden] | dhcp68 | icmp | LAN | drop WAN
|
|
/ip/firewall/filter
|
|
# 1+2 ueber die bestehende WG-Regel schieben (est zuerst, dann invalid)
|
|
:if ([:len [find where comment="TP10-seal-est"]]=0) do={ \
|
|
add chain=input action=accept connection-state=established,related,untracked \
|
|
comment="TP10-seal-est" place-before=[find where comment="TP10: WG hub listen (51821)"] }
|
|
:if ([:len [find where comment="TP10-seal-inv"]]=0) do={ \
|
|
add chain=input action=drop connection-state=invalid \
|
|
comment="TP10-seal-inv" place-before=[find where comment="TP10: WG hub listen (51821)"] }
|
|
# 4-7 NACH der WG-Regel anhaengen (in dieser Reihenfolge)
|
|
:if ([:len [find where comment="TP10-seal-dhcp"]]=0) do={ \
|
|
add chain=input action=accept protocol=udp dst-port=68 in-interface-list=WAN \
|
|
comment="TP10-seal-dhcp" }
|
|
:if ([:len [find where comment="TP10-seal-icmp"]]=0) do={ \
|
|
add chain=input action=accept protocol=icmp comment="TP10-seal-icmp" }
|
|
:if ([:len [find where comment="TP10-seal-lan"]]=0) do={ \
|
|
add chain=input action=accept in-interface-list=LAN comment="TP10-seal-lan" }
|
|
:if ([:len [find where comment="TP10-seal-wandrop"]]=0) do={ \
|
|
add chain=input action=drop in-interface-list=WAN comment="TP10-seal-wandrop" }
|
|
|
|
# --- D) ether1-DHCP-Client: kein ISP-DNS-Leak (DoH bleibt einzige Quelle)
|
|
# default-route-distance=1 ist bereits gesetzt (Auto-Switchover < Bridge-Fallback@2)
|
|
/ip/dhcp-client
|
|
set [find where interface="ether1"] use-peer-dns=no
|
|
|
|
:log info "TP10-cutover: apply done"
|
|
# =====================================================================
|
|
# NICHT Teil dieses Skripts (bereits korrekt auf ap1):
|
|
# - NAT: masquerade out-interface=ether1 (*3) + no-NAT 10.40.0.0/16 (*4)
|
|
# - Forward-FW: accept in/out-interface=wg-hub (*E/*F)
|
|
# - Default-Fallback-Route 0.0.0.0/0 via 10.40.41.254 distance=2
|
|
# VPN-Traffic egresst ueber wg-hub -> matcht keine Masquerade -> echte LAN-IPs.
|
|
# =====================================================================
|