MikroTik - Ubiquiti VLAN

· 3 min di lettura

MIKROTIK - UBIQUITI VLAN

EDGESWITCH VLAN

In questa guida configuriamo le VLAN tra un Router Mikrotik e un Edgeswitch Ubiquiti.

Componenti utilizzati:

  1. Un Mikrotik RB4011
  2. Un Ubiquiti EdgeSwitch ES-5XP

Livello difficoltà: Semplice

Qui di seguito un diagramma che rappresenta la configurazione delle VLAN tra un Router Mikrotik e uno Switch Ubiquiti.

fig.1 - Diagramma di Rete

Obbiettivo 1: Configurariamo il Router Mikrotik.

Verrà mostrato un riepilogo da CLI. Se vuoi approfondire le vlan visita l'articolo: MIKROTIK VLAN.

/interface bridge
add name=bridge-main vlan-filtering=yes

/interface vlan
add interface=bridge-main name=vlan1 vlan-id=1
add interface=bridge-main name=vlan10 vlan-id=10
add interface=bridge-main name=vlan20 vlan-id=20
add interface=bridge-main name=vlan30 vlan-id=30
add interface=bridge-main name=vlan40 vlan-id=40
add interface=bridge-main name=vlan101-WAN vlan-id=101

/interface list
add comment=defconf name=WAN
add comment=defconf name=LAN

/ip pool
add name=pool-dhcp-vlan1 ranges=192.168.201.3-192.168.201.254
add name=pool-dhcp-vlan10 ranges=192.168.10.58-192.168.10.62
add name=pool-dhcp-vlan40 ranges=192.168.40.58-192.168.40.62
add name=pool-dhcp-vlan30 ranges=192.168.30.58-192.168.30.62
add name=pool-dhcp-vlan20 ranges=192.168.40.120-192.168.40.126

/ip dhcp-server
add address-pool=pool-dhcp-vlan1 interface=vlan1 lease-time=12h30m name=dhcp-server-VLAN1
add address-pool=pool-dhcp-vlan10 interface=vlan10 lease-time=12h30m name=dhcp-server-VLAN10
add address-pool=pool-dhcp-vlan40 interface=vlan40 lease-time=12h30m name=dhcp-server-VLAN40
add address-pool=pool-dhcp-vlan30 interface=vlan30 lease-time=12h30m name=dhcp-server-VLAN30
add address-pool=pool-dhcp-vlan20 interface=vlan20 lease-time=12h30m name=dhcp-server-VLAN20

/interface bridge port
add bridge=bridge-main interface=ether2
add bridge=bridge-main interface=ether3
add bridge=bridge-main interface=ether4
add bridge=bridge-main interface=ether5
add bridge=bridge-main interface=ether6
add bridge=bridge-main interface=ether7
add bridge=bridge-main interface=ether8
add bridge=bridge-main interface=ether9
add bridge=bridge-main interface=ether10
add bridge=bridge-main interface=sfp-sfpplus1
add bridge=bridge-main interface=ether1-Wan pvid=101

/ip neighbor discovery-settings
set discover-interface-list=LAN

/interface bridge vlan
add bridge=bridge-main tagged=bridge-main untagged=ether2,ether3,ether4,ether5,ether6,ether7,ether8,ether9,ether10,sfp-sfpplus1 vlan-ids=1
add bridge=bridge-main tagged=bridge-main,ether4 vlan-ids=10
add bridge=bridge-main tagged=bridge-main,ether4 vlan-ids=40
add bridge=bridge-main tagged=bridge-main untagged=ether1-Wan vlan-ids=101
add bridge=bridge-main tagged=bridge-main,ether4 vlan-ids=30
add bridge=bridge-main tagged=bridge-main,ether4 vlan-ids=20

/interface list member
add interface=vlan1 list=LAN
add interface=vlan101-WAN list=WAN
add interface=vlan10 list=LAN
add interface=vlan40 list=LAN
add interface=vlan20 list=LAN
add interface=vlan30 list=LAN

/ip address
add address=192.168.10.1/24 interface=vlan10 network=192.168.10.0
add address=192.168.40.1/24 interface=vlan40 network=192.168.40.0
add address=192.168.201.1/24 interface=vlan1 network=192.168.201.0
add address=192.168.30.1/24 interface=vlan30 network=192.168.30.0
add address=192.168.20.0/24 interface=vlan20 network=192.168.20.0
add address=192.168.1.254/24 interface=vlan101-WAN network=192.168.1.0

/ip dhcp-server network
add address=192.168.10.0/24 dns-server=192.168.10.1 domain=VLAN10GROUP gateway=192.168.10.1 netmask=24
add address=192.168.20.0/24 dns-server=192.168.20.1 domain=VLAN20GROUP gateway=192.168.20.1 netmask=24
add address=192.168.30.0/24 dns-server=192.168.30.1 domain=VLAN30GROUP gateway=192.168.30.1 netmask=24
add address=192.168.40.0/24 dns-server=192.168.40.1 domain=VLAN40GROUP gateway=192.168.40.1 netmask=24
add address=192.168.201.0/24 dns-server=192.168.201.1 domain=WORKGROUP gateway=192.168.201.1 netmask=24
/ip dns
set allow-remote-requests=yes servers=8.8.8.8,8.8.4.4

/ip firewall filter
add action=accept chain=input comment=Main-firewall connection-state=established,related,untracked
add action=drop chain=input connection-state=invalid

/ip firewall nat
add action=masquerade chain=srcnat comment=Main-NAT out-interface-list=WAN

/ip route
add disabled=no dst-address=0.0.0.0/0 gateway=192.168.1.1 routing-table=main suppress-hw-offload=no

/system clock
set time-zone-name=Europe/Rome
/system clock manual
set time-zone=+01:00
/system identity
set name="ROUTERBOARD"

/system ntp client servers
add address=193.204.114.105

Obbiettivo 2: Configurare l'EdgeSwitch Ubiquiti.

Colleghiamoci al nostro Switch da Web Browser:

A differenza di Mikrotik è presente un'interfaccia grafica semplicissima.

Segui i passaggi evidenziati nell'immagine seguente:

fig.2 - VLAN Ubiquiti

Dopo aver eseguito l'accesso al menu VLAN, creiamo le varie VLAN dal menu in alto a destra;

Le VLAN vengono inserite come da immagine con tutte le porte in TRUNK.

Di conseguenza, come da diagramma configuriamo la porta 5 in modalità TRUNK.

La VLAN1 servirà solo per il management e viene inviata untagged mediante il TRUNK.

Per ogni VLAN clicchiamo sui quadratini fino che vengano indicate le porte Untagged e le porte Exclude.

fig.3 Configurazione IP

Ricordiamo di configurare la sezione IP specificando anche la VLAN di management dell'edgeswitch Ubiquiti.

Commenti

Lascia un commento