66 lines
6.2 KiB
Plaintext
66 lines
6.2 KiB
Plaintext
# TP5 Etappe 2 — NACHTRAG. Vier Luecken, die der Kollektor nach dem ersten
|
|
# Etappe-2-Deploy gezeigt hat, plus eine Vorratsregel.
|
|
#
|
|
# QUELLE: /opt/tp5-syslog/log/tp5-would-drop.log auf dem Docker-LXC,
|
|
# Fenster 2026-08-17 15:00 .. 18:38 (nach dem E2-Deploy um 14:17:16).
|
|
# 119 Zeilen, aggregiert:
|
|
# 92 vlan30->vlan20 udp 10.40.30.227:5540 -> 10.40.20.105
|
|
# 18 vlan20->vlan99 tcp 10.40.20.31 -> .99.2/.99.11/.99.12:22
|
|
# 8 vlan99->vlan20 tcp .99.x:8728 -> 10.40.20.105
|
|
# 1 vlan30->vlan20 tcp 10.40.30.225:80 -> 10.40.20.105
|
|
#
|
|
# Die Behauptung "die Log-Regel ist verstummt" stammte aus einem 70-Sekunden-
|
|
# Fenster. Ueber dreieinhalb Stunden gemessen stimmt sie nicht. Das ist genau
|
|
# der Grund, warum das Runbook ein mehrtaegiges Fenster verlangt.
|
|
#
|
|
# BLOCKIERT NICHTS: ausschliesslich action=accept.
|
|
#
|
|
# Push: python3 nautobot/gc-manual-plan.py --device crs326-core \
|
|
# --commands-file routeros/tp5-etappe2-nachtrag.rsc \
|
|
# --change-id TP5-Etappe2-Nachtrag --deploy \
|
|
# --assert '/ip/firewall/filter?comment=TP5-E2: IOT->INFRA Matter|count=1'
|
|
# ---------------------------------------------------------------------------
|
|
|
|
# 1) MATTER. 92 der 119 Zeilen. 10.40.30.227 = SwitchBot-Stehlampe (DHCP-
|
|
# Reservierung "SwitchBot-floor-lamp"), die per Matter ueber udp/5540 an HA
|
|
# pusht. Die E2-Regel "IOT->INFRA Dienste" ist protocol=tcp — Matter faellt
|
|
# komplett durch. Ohne diese Zeile toetet Etappe 3 die Matter-Anbindung.
|
|
:do { :if ([:len [/ip firewall filter find comment="TP5-E2: IOT->INFRA Matter"]] = 0) do={ /ip firewall filter add chain=forward action=accept in-interface=vlan30 out-interface=vlan20 protocol=udp dst-port=5540 comment="TP5-E2: IOT->INFRA Matter" place-before=[/ip firewall filter find comment="TP5: log-only, Vorstufe zum deny-by-default"] } } on-error={ :log info "tp5n: 01 Matter warf" }
|
|
|
|
# 2) NAUTOBOT-DEPLOY-PFAD. Der Netmiko-Deploy kommt NICHT von 10.40.20.30
|
|
# (Web-Container), sondern von 10.40.20.31 = nautobot-worker. Beleg: die
|
|
# E2-Regel "Nautobot->MGMT ssh" auf .20.30 steht auf 0 Paketen, waehrend im
|
|
# Log 18 SYNs von .20.31 auf .99.{2,11,12}:22 stehen.
|
|
# Address-List statt Einzel-IP, weil der scheduler (.20.32) dieselben Jobs
|
|
# faehrt und ein Stack-Redeploy die Rollen tauschen kann.
|
|
# ⚠️ Ohne diese Zeile sperrt Etappe 3 den einzigen legitimen Config-Weg aus —
|
|
# also genau das Werkzeug fuer den Rueckzieher.
|
|
:do { :if ([:len [/ip firewall address-list find list=nautobot address=10.40.20.30]] = 0) do={ /ip firewall address-list add list=nautobot address=10.40.20.30 comment="nautobot web" } } on-error={ :log info "tp5n: 02a al-30 warf" }
|
|
:do { :if ([:len [/ip firewall address-list find list=nautobot address=10.40.20.31]] = 0) do={ /ip firewall address-list add list=nautobot address=10.40.20.31 comment="nautobot worker = der Deploy-Pfad" } } on-error={ :log info "tp5n: 02b al-31 warf" }
|
|
:do { :if ([:len [/ip firewall address-list find list=nautobot address=10.40.20.32]] = 0) do={ /ip firewall address-list add list=nautobot address=10.40.20.32 comment="nautobot scheduler" } } on-error={ :log info "tp5n: 02c al-32 warf" }
|
|
:do { :if ([:len [/ip firewall filter find comment="TP5-E2: Nautobot->MGMT ssh (list)"]] = 0) do={ /ip firewall filter add chain=forward action=accept src-address-list=nautobot out-interface=vlan99 protocol=tcp dst-port=22 comment="TP5-E2: Nautobot->MGMT ssh (list)" place-before=[/ip firewall filter find comment="TP5: log-only, Vorstufe zum deny-by-default"] } } on-error={ :log info "tp5n: 02d regel warf" }
|
|
|
|
# 3) RUECKRICHTUNG DES MGMT-PFADS. .99.x:8728 -> HA, als connection-state:new
|
|
# im Log. Das sind Pakete einer TCP-Sitzung, deren Conntrack-Eintrag
|
|
# abgelaufen ist, waehrend HA weiterpollt. Ein blanker Drop wuerde sie
|
|
# verschlucken und die mikrotik-Integrationen ins Timeout laufen lassen.
|
|
:do { :if ([:len [/ip firewall filter find comment="TP5-E2: MGMT->INFRA api-rueckweg"]] = 0) do={ /ip firewall filter add chain=forward action=accept in-interface=vlan99 out-interface=vlan20 protocol=tcp src-port=8728 comment="TP5-E2: MGMT->INFRA api-rueckweg" place-before=[/ip firewall filter find comment="TP5: log-only, Vorstufe zum deny-by-default"] } } on-error={ :log info "tp5n: 03 api-rueckweg warf" }
|
|
|
|
# 4) SHELLY-ANTWORT auf demselben Muster (tcp/80 -> HA, als new gesehen).
|
|
# Nur 1 Zeile im Fenster, aber dieselbe Ursache wie 3 und bei 22 gepollten
|
|
# Shellys jederzeit wieder faellig.
|
|
:do { :if ([:len [/ip firewall filter find comment="TP5-E2: IOT->INFRA http-rueckweg"]] = 0) do={ /ip firewall filter add chain=forward action=accept in-interface=vlan30 out-interface=vlan20 protocol=tcp src-port=80 comment="TP5-E2: IOT->INFRA http-rueckweg" place-before=[/ip firewall filter find comment="TP5: log-only, Vorstufe zum deny-by-default"] } } on-error={ :log info "tp5n: 04 http-rueckweg warf" }
|
|
|
|
# 5) VORRATSREGEL DNS -> AdGuard (10.40.20.16).
|
|
# AGH ist per Christophs Vorgabe eingerichtet, aber NICHT scharf geschaltet:
|
|
# die DHCP-Scopes liefern weiter 10.40.X.1 aus. Diese Zeile aendert daran
|
|
# nichts. Sie sorgt dafuer, dass das spaetere Umstellen ein reiner
|
|
# DHCP-Change bleibt und die dann scharfe Firewall nicht angefasst werden
|
|
# muss. Ohne sie waere die Reihenfolge eine Falle: DNS umgestellt, Drop
|
|
# scharf, Haus ohne Namensaufloesung.
|
|
:do { :if ([:len [/ip firewall filter find comment="TP5-E2: LAN->AGH dns (Vorrat)"]] = 0) do={ /ip firewall filter add chain=forward action=accept dst-address=10.40.20.16 protocol=udp dst-port=53 comment="TP5-E2: LAN->AGH dns (Vorrat)" place-before=[/ip firewall filter find comment="TP5: log-only, Vorstufe zum deny-by-default"] } } on-error={ :log info "tp5n: 05a dns-udp warf" }
|
|
:do { :if ([:len [/ip firewall filter find comment="TP5-E2: LAN->AGH dns-tcp (Vorrat)"]] = 0) do={ /ip firewall filter add chain=forward action=accept dst-address=10.40.20.16 protocol=tcp dst-port=53 comment="TP5-E2: LAN->AGH dns-tcp (Vorrat)" place-before=[/ip firewall filter find comment="TP5: log-only, Vorstufe zum deny-by-default"] } } on-error={ :log info "tp5n: 05b dns-tcp warf" }
|
|
|
|
# Zaehlzeile: 17 TP5-E2-Regeln erwartet (11 aus Etappe 2 + 6 hier).
|
|
:log info ("tp5n: ENDE e2-regeln=" . [:tostr [:len [/ip firewall filter find comment~"TP5-E2:"]]] . " nautobot-liste=" . [:tostr [:len [/ip firewall address-list find list=nautobot]]])
|