Doing VLAN trunk and access ports on MikroTik CRS/RouterOS

Most of the switches in my homelab are MikroTik CRS switches, although I am getting a UniFi PoE switch (MikroTik didn’t make a 2.5G PoE switch, that’s why).

I use two CRS304-4XG-IN switches to connect desktop computers to the 10G LAN, but wanted my desktops on a separate VLAN.

On my network, I use VLAN 4 for desktops.

The configuration you need is:

/interface bridge
add admin-mac=XX:XX:XX:XX:XX:XX auto-mac=no name=bridge vlan-filtering=yes
/interface bridge port
add bridge=bridge comment=defconf interface=ether1
add bridge=bridge comment=defconf interface=ether2 pvid=4
add bridge=bridge comment=defconf interface=ether3 pvid=4
add bridge=bridge comment=defconf interface=ether4 pvid=4
add bridge=bridge comment=defconf interface=ether5
/interface bridge vlan
add bridge=bridge tagged=ether1 untagged=ether2,ether3,ether4 vlan-ids=4

The bold parts are important, and I will explain what they are:

  • vlan-filtering=yes in the /interface bridge means you will filter for VLANs. This is required for VLAN trunk/access ports.
  • pvid=4 in the /interface bridge port means the specific port will use VLAN 4.
  • tagged=ether1 in the /interface bridge vlan means the trunk/tagged port is ether1.
  • untagged=ether2,ether3,ether4 means the ether2-4 ports are access ports
  • vlan-ids=4 means we are establishing a bridge on VLAN 4.

Hopefully, this helps you set up VLAN trunking on a MikroTik CRS/RouterOS switch.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.