Todas las colecciones
MikroTik
Mas
MikroTik - Configuración de VLAN en Layer2
MikroTik - Configuración de VLAN en Layer2

En este artículo se explicara como configurar las VLANs en Layer2, para tener el mejor rendimiento del switch

Raúl Aragón avatar
Escrito por Raúl Aragón
Actualizado hace más de una semana

Nivel: Avanzado.

Como sabemos el rendimiento de un CRS1xx/CRS2xx no es el mismo con una configuración de tipo Bridge a una de tipo Switch Layer2:


NOTA IMPORTANTE:

Para poder realizar la siguiente configuración es recomendado hacerlo desde el puerto de Consola.


Una vez conectado al switch realizaremos los siguientes pasos:

  • Crear un bridge y agregar todos los puertos a este bridge:

/interface bridge
add name=bridge1
/interface bridge port
add bridge=bridge1 interface=ether1 hw=yes
add bridge=bridge1 interface=ether2 hw=yes
add bridge=bridge1 interface=ether3 hw=yes
add bridge=bridge1 interface=ether5 hw=yes
add bridge=bridge1 interface=ether4 hw=yes
add bridge=bridge1 interface=ether6 hw=yes
add bridge=bridge1 interface=ether7 hw=yes
add bridge=bridge1 interface=ether8 hw=yes
add bridge=bridge1 interface=sfp9 hw=yes
add bridge=bridge1 interface=sfp10 hw=yes
add bridge=bridge1 interface=sfp11 hw=yes
add bridge=bridge1 interface=sfp12 hw=yes
  • Configuración de los parámetros de Network básicos.

/ip address 
add address=192.168.88.2/24 interface=bridge1
/ip dns
set servers=192.168.88.1
/ip route
add distance=1 gateway=192.168.88.1
  • Configuración de las VLAN

Aquí vamos a dar de alta las VLANs en los puertos donde van a operar:

/interface ethernet switch vlan
add ports=ether1,ether2,ether3,ether4 vlan-id=2 comment=VLAN-Telefonia
add ports=ether1,ether5,ether6,ether7 vlan-id=3 comment=VLAN-CCTV

Indicar en que puertos van a trabajar con el TAG

/interface ethernet switch egress-vlan-tag
add tagged-ports=ether1,ether2,ether3,ether4 vlan-id=2 Tag_VLAN-Telefonia
add tagged-ports=ether1 vlan-id=3 comment=Tag_VLAN-CCTV

Ahora de esta forma generamos el UnTagg de las VLAN en los puertos requeridos

/interface ethernet switch ingress-vlan-translation
add customer-vid=0 new-customer-vid=3 ports=ether5,ether6,ether7 comment=Access_VLAN-CCTV

Excluir las VLANS que no estan dados de alta en la sección VLAN

/interface ethernet switch 
set drop-if-invalid-or-src-port-not-member-of-vlan-on-ports= ether1,ether2,ether3,ether4,ether5,ether6,ether7,ether8,sfp9,sfp10,sfp11,sfp12

De esta forma el Puerto ether1 llegan las VLANS ID = 2,3.

En los puertos "ether2, ether3, ether4" se manda la VLAN ID = 2.

En los puertos "ether5, ether6, ether7" se hace unTag de la VLAN ID = 3

¿Ha quedado contestada tu pregunta?