MikroTik — Management VLAN via SSH
Comandi testati e funzionanti per gestire un MikroTik via SSH tramite VLAN X di management, che arriva taggata dal trunk su
ether1.
Prerequisito
Esegui i comandi da una porta da cui non ti tagli fuori (porta LAN diversa da ether1, oppure console).
Comandi
# 1. Safe Mode
[Ctrl+X]
# 2. Creare il bridge
/interface bridge add name=bridge
# 3. vlanX di management sul bridge
/interface vlan add name=vlanX vlan-id=X interface=bridge
/ip address add address=XXXX/24 interface=vlanX
# 4. ether1 nel bridge
/interface bridge port add bridge=bridge interface=ether1
# 5. tabella VLAN: vlanX taggata su ether1 + alla CPU
/interface bridge vlan add bridge=bridge vlan-ids=X tagged=bridge,ether1
# 6. firewall SSH
/ip firewall filter add chain=input action=accept protocol=tcp \
dst-port=22 in-interface=vlanX src-address=XXXX/24 comment="SSH mgmt"
# 7. filtering ON
/interface bridge set bridge vlan-filtering=yes
Sposta la regola SSH sopra il drop !LAN
/ip firewall filter print
/ip firewall filter move [numero-SSH] destination=[numero-drop-!LAN]
Test e conferma
Da un dispositivo in VLAN X: ssh admin@XXXXX
Se entra, esci dalla Safe Mode con Ctrl+X per rendere permanente.
/system backup save name=mgmt-ok
/export file=config-mgmt
No comments to display
No comments to display