Configurazione MultiSid + Vlan tra Ubiquiti UniFi e Mikrotik CRS-125

UBIQUITI_UNIFI

Le RouterBoard si sono evolute molto come hardware negli ultimi anni, Mikrotik sta rilasciando vari modelli
per la distribuzione di grande potenza di calcolo, questi modelli vengono classificati nella
serie CCR (Cloud Core RouterOS).
Ma Mikrotik non si è limitata solo alla serie CCR, ma ha introdotto dei modelli definiti CRS (Cloud Router Switch)
per venire incontro all’esigenza di chi cercava uno switch avanzato ed affidabile.

La cosa interessante dei CRS e che avendo abbordo sempre RouterOS può essere utilizzato siamo come Router che
come Switch in Layer 3.
Proprio di quest’ultima funzionalità, nel software è disponibile un menu speciale dedicato a tutte le operazioni
di configurazioni tipiche di uno switch entry level eccone alcune di esempio:

• Configure ports as switch, or for routing
• Trunk Ports with optional “Native” VLAN
• Allow us a “VLAN’s” section of the cli / Winbox where we define VLANs for the switch
something like / switch vlans add name=”VLAN Name” vlan-id=1234 S-VLAN=yes/no
• Use the VLAN’s defined to then add to a trunk port with the VLAN’ on it like we add channel
scan into wireless
• Allow VLAN Groups like frequency scan groups to easily make regular trunks
for deployment (like we have 3 VLANS we deploy on most ports)
• Port Mirroring
• Ethernet, Fiber, or 4G (with optional USB modem) gateway connection to Internet
• RouterOS gateway/firewall/VPN router
• Up to twenty-five gigabit switch ports (1xSFP and 24xRJ45)

In questo articolo vedremo come figurare un Access Point Unifi con 3 network su uno
Switch Mikrotik CRS usando il Vlan Tagging ed ogni network avrà sil suo DHCP Server.

Nel precedente articolo avevo mostrato come fare la stessa configurazione con una Mikrotik  1000

http://ww.ubuntuserver.it/configurazione-multisid-vlan-tra-ubiquiti-unifi-e-routerboard-mikrotik/

Va bene veniamo a noi :-D

Procediamo per punti:

1) Per abilitare le funzioni switch dobbiamo prima definire una master-port ed in questo caso useremo al ether1

/interface ethernet
set [ find default-name=ether2 ] master-port=ether1
set [ find default-name=ether3 ] master-port=ether1
set [ find default-name=ether4 ] master-port=ether1
set [ find default-name=ether5 ] master-port=ether1
set [ find default-name=ether6 ] master-port=ether1
set [ find default-name=ether7 ] master-port=ether1
set [ find default-name=ether8 ] master-port=ether1
set [ find default-name=ether9 ] master-port=ether1
set [ find default-name=ether10 ] master-port=ether1
set [ find default-name=ether11 ] master-port=ether1
set [ find default-name=ether12 ] master-port=ether1
set [ find default-name=ether13 ] master-port=ether1
set [ find default-name=ether14 ] master-port=ether1
set [ find default-name=ether15 ] master-port=ether1
set [ find default-name=ether16 ] master-port=ether1
set [ find default-name=ether17 ] master-port=ether1
set [ find default-name=ether18 ] master-port=ether1
set [ find default-name=ether19 ] master-port=ether1
set [ find default-name=ether20 ] master-port=ether1
set [ find default-name=ether21 ] master-port=ether1
set [ find default-name=ether22 ] master-port=ether1
set [ find default-name=ether23 ] master-port=ether1
set [ find default-name=ether24 ] master-port=ether1

2) Qui impostiamo l’indirizzo ip per la rete non taggata (dove risiede il controller unifi), infatti lo mettiamo sulla master-port

/ip address
add address=192.168.30.1/24 interface=ether1 network=192.168.30.0

3) Qui specifichiamo le vlan nel modo classico visto che il routing è terminato sullo stesso switch (dhcp server ecc…)

/interface vlan
add interface=ether1 l2mtu=1584 name=vlan40 vlan-id=40
add interface=ether1 l2mtu=1584 name=vlan50 vlan-id=50

4) Qui configuriamo l’indirizzo ip per le Vlan appena configurate (40 e 50)

/ip address
add address=192.168.50.1/24 interface=vlan50 network=192.168.50.0
add address=192.168.40.1/24 interface=vlan40 network=192.168.40.0

5) Qui configuriamo i pool ed i dhcp server

/ip pool
add name=lan-pool ranges=192.168.30.50-192.168.30.90
add name=vlan40-pool ranges=192.168.40.2-192.168.40.254
add name=vlan50-pool ranges=192.168.50.2-192.168.50.254
/ip dhcp-server
add address-pool=lan-pool disabled=no interface=ether1 lease-time=1d name=dhcp-lan
add address-pool=vlan40-pool disabled=no interface=vlan40 lease-time=1d name=dhcp-vlan40
add address-pool=vlan50-pool disabled=no interface=vlan50 lease-time=1d name=dhcp-vlan50

6) Qui configuriamo le Vlan lato switch e aggiungiamo anche lo “switch1-cpu” in quanto il routing di quelle due vlan (dhcp server ecc..)
viene terminato sullo stesso apparato, in caso contrario non riuscirebbe ad assegnarci un ip sulle rispettive vlan 40 e 50

/interface ethernet switch egress-vlan-tag
add tagged-ports=ether22-slave-local,ether23-slave-local,ether24-slave-local,switch1-cpu vlan-id=40
add tagged-ports=ether22-slave-local,ether23-slave-local,ether24-slave-local,switch1-cpu vlan-id=50
/interface ethernet switch ingress-vlan-translation
add customer-vid=0 disabled=yes new-customer-vid=40 ports=ether20-slave-local sa-learning=yes

7) Qui configuriamo il Masquerade cosi da permettici di uscire su internet tramite la nostra connessione ad internet

/ip firewall nat
add action=masquerade chain=srcnat comment=Primary out-interface=pppoe-out1 src-address=192.168.0.0/16

Adesso non ci resta che collegarci al nostro controller UniFI https://IP-ADDREASS:8443
e configurare i 3 sid dove uno è untagged mentre gli altri
tagged come nel printscreen qui sotto:

vlan-unifi-esempio

Una volta finita la configurazione lato UniFI proviamo a collegarci alle singole vlan e vediamo se il traffico ruota in maniera corretta.

Spero l’articolo sia utile a molti visto che per questo tipo di configurazione ho avuto difficoltà a reperire le informazioni su internet ;-)

About Francesco Gabriele

Inserisci un commento

Il tuo indirizzo email non sarà pubblicato. Required fields are marked *

*

È possibile utilizzare questi tag ed attributi XHTML: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>