Guida MikroTik
Interfacce, switching e VLANIntermedio

Ricetta pratica: switch di distribuzione WISP (trunk + access)

Configurazione completa, copia-incolla, di un CRS come switch di distribuzione WISP: trunk verso il core, porte access per clienti, VLAN management isolata, port isolation e protezioni L2.

Questo articolo mette insieme i mattoni degli altri (bridge, VLAN filtering, offload, port isolation, STP) in una configurazione reale e copia-incolla per uno scenario tipico: un CRS usato come switch di distribuzione in un POP/torre WISP. L'obiettivo è da subito OTTIMALE (hardware offload) e SICURO (management isolato, BPDU guard, port isolation tra clienti).

Topologia

  • sfp-sfpplus1 = uplink/trunk verso il router core (BNG): tagged VLAN 100 (clienti) + VLAN 999 (management).
  • ether1..ether20 = porte access verso CPE/antenne dei clienti: tutte VLAN 100, ma isolate tra loro (un cliente non deve vedere l'altro a L2).
  • ether24 = porta access di management on-site (VLAN 999) per il tecnico.
  • Il management dello switch sta su VLAN 999.
1) Bridge con RSTP e VLAN filtering (ancora OFF)
/interface/bridge
add name=br-dist protocol-mode=rstp vlan-filtering=no \
    comment="Switch distribuzione POP Torre Nord"
2) Porte: trunk, access clienti, access management
/interface/bridge/port

# Trunk verso il core (BNG)
add bridge=br-dist interface=sfp-sfpplus1 \
    frame-types=admit-only-vlan-tagged \
    hw=yes comment="Uplink core"

# Porte access clienti (loop creiamo dopo, qui esplicito per chiarezza)
add bridge=br-dist interface=ether1 pvid=100 hw=yes \
    frame-types=admit-only-untagged-and-priority-tagged \
    ingress-filtering=yes bpdu-guard=yes
add bridge=br-dist interface=ether2 pvid=100 hw=yes \
    frame-types=admit-only-untagged-and-priority-tagged \
    ingress-filtering=yes bpdu-guard=yes
# ... ripetere fino a ether20 ...

# Porta management on-site (tecnico)
add bridge=br-dist interface=ether24 pvid=999 hw=yes \
    frame-types=admit-only-untagged-and-priority-tagged \
    ingress-filtering=yes
3) VLAN table: clienti su 100, management su 999
/interface/bridge/vlan

# VLAN 100 clienti: trunk tagged, tutte le porte cliente untagged
add bridge=br-dist vlan-ids=100 \
    tagged=sfp-sfpplus1 \
    untagged=ether1,ether2,ether3,ether4,ether5,ether6,ether7,ether8,ether9,ether10,ether11,ether12,ether13,ether14,ether15,ether16,ether17,ether18,ether19,ether20

# VLAN 999 management: trunk tagged + bridge (per IP) + porta tecnico
add bridge=br-dist vlan-ids=999 \
    tagged=sfp-sfpplus1,br-dist \
    untagged=ether24
4) IP di management SOLO su VLAN 999 (mai sul bridge nudo)
/interface/vlan
add name=mgmt interface=br-dist vlan-id=999

/ip/address
add address=10.255.0.10/24 interface=mgmt comment="Mgmt switch"

/ip/route
add dst-address=0.0.0.0/0 gateway=10.255.0.1
5) Port isolation: i clienti non si vedono tra loro (L2)
# Tutte le porte cliente in horizon 1: stesso horizon = NON si parlano.
# L'uplink resta senza horizon: i clienti raggiungono solo il core.
/interface/bridge/port
set [find interface~"ether([1-9]|1[0-9]|20)\$"] horizon=1
6) Accendere il VLAN filtering (ultimo passo!)
# Sei collegato via VLAN 999 e funziona? Allora:
/interface/bridge
set br-dist vlan-filtering=yes
Perché questo schema è SICURO: (1) il management vive su una VLAN dedicata, non sulla VLAN dati dei clienti; (2) bpdu-guard spegne la porta se un cliente collega uno switch e inietta BPDU; (3) ingress-filtering impedisce ai clienti di iniettare frame taggati su altre VLAN; (4) horizon impedisce ai clienti di vedersi a L2 (niente ARP-scan/MITM tra clienti dello stesso POP).
Hardening aggiuntivo consigliato: dhcp-snooping=yes sul bridge con le porte cliente come untrusted, così un cliente non può fare da DHCP server fasullo. Vedi l'articolo su DHCP snooping / sicurezza L2.
cookbookesempio completoCRSdistribuzioneswitch WISPtrunkaccessmanagement VLANport isolationconfigurazione completa

Configura senza fatica con l'AI

In WispOS l'agente AI genera la configurazione RouterOS dalle tue parole e un tutor ti guida passo passo.

Prova WispOS