From 9a519432b001858506d836379b0093d23bf496b5 Mon Sep 17 00:00:00 2001 From: CroneKorkN Date: Thu, 10 Jul 2025 10:34:27 +0200 Subject: [PATCH] nodes/home.switch-rack-poe.py: introduce --- bundles/routeros/README.md | 12 ++++++- bundles/routeros/items.py | 19 +++++----- nodes/home.switch-rack-poe.py | 55 +++++++++++++++++++++++++++++ nodes/home.switch-wohnzimmer-10g.py | 2 +- 4 files changed, 75 insertions(+), 13 deletions(-) create mode 100644 nodes/home.switch-rack-poe.py diff --git a/bundles/routeros/README.md b/bundles/routeros/README.md index 8119b90..22af32b 100644 --- a/bundles/routeros/README.md +++ b/bundles/routeros/README.md @@ -1,3 +1,4 @@ +initialization: - reset (hold reset for 5-10 seconds, until user light starts flashing) - open webinterface under 192.168.88.1 - set password @@ -5,4 +6,13 @@ - for example add 10.0.0.62/24 to "home" vlan - this happens on the first apply - when vlan filering gets enabled, the apply freezes and the switch is no longer available under the old ip -- now that filtering is active, the switch is available under its new ip, because now you dont speak to the bridge anymore, where the old ip was residing, but to the vlan interface, where the new ip is residing \ No newline at end of file +- now that filtering is active, the switch is available under its new ip, because now you dont speak to the bridge anymore, where the old ip was residing, but to the vlan interface, where the new ip is residing + +bw bug: +- f"/interface/bridge/vlan?vlan-ids={vlan_id}&dynamic=false" fails, you need to remove &dynamic=false on create and then add it again + +old 6.x Routeros firmware vlan filtering not working: +- update firmware first +- upload to files and just reboot +- didnt work via web interface, log said firmware image broken +- didi work via winbox diff --git a/bundles/routeros/items.py b/bundles/routeros/items.py index 8c9b0ee..8b1a89e 100644 --- a/bundles/routeros/items.py +++ b/bundles/routeros/items.py @@ -37,18 +37,18 @@ routeros['/system/identity'] = { # 'write-access': False, # } -# routeros['/system/clock'] = { -# 'time-zone-autodetect': False, -# 'time-zone-name': 'UTC', -# } +routeros['/system/clock'] = { + 'time-zone-autodetect': False, + 'time-zone-name': 'UTC', +} # routeros['/ip/neighbor/discovery-settings'] = { # 'protocol': 'cdp,lldp,mndp', # } -# routeros['/ip/route?dst-address=0.0.0.0/0'] = { -# 'gateway': node.metadata.get('routeros/gateway'), -# } +routeros['/ip/route?dst-address=0.0.0.0/0'] = { + 'gateway': node.metadata.get('routeros/gateway'), +} for vlan_name, vlan_id in node.metadata.get('routeros/vlans').items(): routeros[f'/interface/vlan?name={vlan_name}'] = { @@ -57,12 +57,9 @@ for vlan_name, vlan_id in node.metadata.get('routeros/vlans').items(): 'tags': { 'routeros-vlan', }, - 'needs': { - #'routeros:/interface/bridge?name=bridge', - }, } - routeros[f"/interface/bridge/vlan?vlan-ids={vlan_id}&dynamic=false"] = { + routeros[f"/interface/bridge/vlan?vlan-ids={vlan_id}&dynamic=false"] = { # bw bug: remove &dynamic=false on first apply 'bridge': 'bridge', 'untagged': sorted(node.metadata.get(f'routeros/vlan_ports/{vlan_name}/untagged')), 'tagged': sorted(node.metadata.get(f'routeros/vlan_ports/{vlan_name}/tagged')), diff --git a/nodes/home.switch-rack-poe.py b/nodes/home.switch-rack-poe.py new file mode 100644 index 0000000..c770db8 --- /dev/null +++ b/nodes/home.switch-rack-poe.py @@ -0,0 +1,55 @@ +{ + 'hostname': '192.168.88.1', + 'password': '!decrypt:encrypt$gAAAAABob2elR_Sm13u-oG1ff_zOeEsay8PZ0Wgbl810hAZNhvuTYWJuNAJ1oyelC6sy7WsD2CC33oVLeb6m0EtNARtMs-2gKu9KlT7Xat1MvV-iatDKvro=', + 'groups': [ + 'routeros', + ], + 'metadata': { + 'id': 'f5ee3f48-f8a4-4fbc-9b82-e9510fb316ba', + 'routeros': { + 'ips': { + '10.0.0.64/24': { + 'interface': 'home', + }, + }, + 'ports': { + 'ether1': { + 'vlan_group': 'infra', + }, + 'ether2': { + 'vlan_group': 'infra', + }, + 'ether3': { + 'vlan_group': 'infra', + }, + 'ether4': { + 'vlan_group': 'infra', + }, + 'ether5': { + 'vlan_group': 'infra', + }, + 'ether6': { + 'vlan_group': 'infra', + }, + 'ether7': { + 'vlan_group': 'infra', + }, + 'ether8': { + 'vlan_group': 'infra', + }, + 'sfp9': { + 'vlan_group': 'infra', + }, + 'sfp10': { + 'vlan_group': 'infra', + }, + 'sfp11': { + 'vlan_group': 'infra', + }, + 'sfp12': { + 'vlan_group': 'infra', + }, + }, + }, + }, +} diff --git a/nodes/home.switch-wohnzimmer-10g.py b/nodes/home.switch-wohnzimmer-10g.py index e90b213..8e8c8bd 100644 --- a/nodes/home.switch-wohnzimmer-10g.py +++ b/nodes/home.switch-wohnzimmer-10g.py @@ -5,7 +5,7 @@ 'routeros', ], 'metadata': { - 'id': 'e6a24df7-eed1-404e-af78-15ebcbcc02a2', + 'id': '6d4b95dd-5d8a-4481-8c5f-8ee714d9f0cc', 'routeros': { 'ips': { '10.0.0.62/24': {