Skip to content

MikroTik RouterOS VLAN Configuration โ€” Complete Example

A working example of configuring tagged VLANs on a MikroTik router, from interface setup to inter-VLAN routing.

MikroTik RouterOS VLAN Configuration โ€” Complete Example
Table of Contents
  1. Before You Begin
  2. Step 1 โ€” Create the VLAN interfaces
  3. Step 2 โ€” Assign IP addresses to each VLAN
  4. Step 3 โ€” Configure DHCP per VLAN
  5. Step 4 โ€” Set the switch port to trunk mode
  6. Useful Commands
  7. Watch the Video
  8. Frequently Asked Questions
  9. Do I need a managed switch for VLANs to work?
  10. Can two VLANs communicate by default?
  11. Conclusion
  12. Related Articles

VLANs let you segment a single physical network into multiple logical networks โ€” separating, say, staff and guest Wi-Fi, or isolating a VoIP network from general data traffic. This example configures two VLANs on a MikroTik router with a trunk port to a managed switch.

Before You Begin

Info

Have your physical topology mapped out first: which port is the trunk to your switch, and which VLAN IDs you’re using (this example uses VLAN 10 for staff and VLAN 20 for guest).

Step 1 โ€” Create the VLAN interfaces

Add VLAN interfaces on the trunk port

Create VLAN interfaces tagged on your uplink/trunk interface (ether1 in this example) โ€” see the commands below.

Step 2 โ€” Assign IP addresses to each VLAN

Address each VLAN subnet

Give each VLAN interface its own subnet, e.g. 10.10.10.1/24 for staff, 10.10.20.1/24 for guest.

Step 3 โ€” Configure DHCP per VLAN

Set up DHCP pools

Create a separate DHCP server and address pool for each VLAN so devices in each segment get appropriate addresses automatically.

Step 4 โ€” Set the switch port to trunk mode

Configure the downstream switch

On the managed switch side, configure the port connecting to the MikroTik router as a trunk (tagged) port carrying both VLAN 10 and VLAN 20, and configure access ports for end devices as untagged members of the relevant VLAN.

Useful Commands

MikroTik RouterOS
/interface vlannadd name=vlan10-staff interface=ether1 vlan-id=10nadd name=vlan20-guest interface=ether1 vlan-id=20nn/ip addressnadd address=10.10.10.1/24 interface=vlan10-staffnadd address=10.10.20.1/24 interface=vlan20-guestnn/ip poolnadd name=pool-staff ranges=10.10.10.10-10.10.10.200nadd name=pool-guest ranges=10.10.20.10-10.10.20.200nn/ip dhcp-servernadd interface=vlan10-staff address-pool=pool-staff name=dhcp-staffnadd interface=vlan20-guest address-pool=pool-guest name=dhcp-guest
Important

Guest VLANs should be isolated from internal resources with firewall rules โ€” by default, creating a VLAN does not automatically block guest traffic from reaching your staff network.

Tip

Test each VLAN’s connectivity independently before combining changes โ€” plug a laptop into an access port on each VLAN and confirm it receives the correct subnet via DHCP before moving on to firewall rules.

Watch the Video

Prefer watching? This tutorial covers the same steps.

How to Configure MikroTik VLAN โ€” Video Tutorial [DEMO VIDEO โ€” replace with your own]

A working example of configuring tagged VLANs on a MikroTik router, from interface setup to inter-VLAN routing.

Watch on YouTube →

Frequently Asked Questions

Do I need a managed switch for VLANs to work?

Yes โ€” an unmanaged switch can’t read or respect VLAN tags, so any switch between the router and your access ports needs to support 802.1Q tagging.

Can two VLANs communicate by default?

On MikroTik, VLAN interfaces are just separate Layer 3 interfaces โ€” if both have IP addresses configured, the router will route between them unless you add explicit firewall rules to block that traffic.

Conclusion

This four-step pattern โ€” VLAN interfaces, addressing, DHCP, and a trunk port to your switch โ€” covers the vast majority of small-to-medium office VLAN setups on MikroTik.

How to Troubleshoot VLAN Connectivity Problems Related Article How to Troubleshoot VLAN Connectivity Problems → Cisco Switch Port Not Working โ€” Troubleshooting Steps Related Article Cisco Switch Port Not Working โ€” Troubleshooting Steps → MikroTik Internet Not Working โ€” Basic Troubleshooting Guide Related Article MikroTik Internet Not Working โ€” Basic Troubleshooting Guide →

Was this guide helpful?

Share it with someone who needs it, or subscribe for more practical IT tutorials.

Leave a Reply

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

Get practical IT tutorials in your inbox

No spam โ€” just useful troubleshooting guides and tips.