nodes/home.switch-rack-poe.py: introduce

This commit is contained in:
CroneKorkN 2025-07-10 10:34:27 +02:00
parent 6a3424faf4
commit 9a519432b0
Signed by: cronekorkn
SSH key fingerprint: SHA256:v0410ZKfuO1QHdgKBsdQNF64xmTxOF8osF1LIqwTcVw
4 changed files with 75 additions and 13 deletions

View file

@ -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
- 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

View file

@ -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')),

View file

@ -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',
},
},
},
},
}

View file

@ -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': {