MikroTik VLAN Configuration with Bridge VLAN Filtering
Create VLANs on a MikroTik router the modern way with bridge VLAN filtering: access ports, a trunk port, VLAN interfaces with their own subnets, and how to avoid locking yourself out.
Problem
You want separate networks (for example Staff on VLAN 10 and Guests on VLAN 20) on one MikroTik router or switch, with access ports for PCs and a trunk port to another switch or access point.
Symptoms
- Devices on different ports can still see each other.
- After turning on VLAN filtering you lost access to the router.
- Tagged traffic from the trunk does not reach the right subnet.
Likely causes
Older guides use VLAN interfaces on physical ports or the switch chip menu. Since RouterOS v6.41 the recommended method is bridge VLAN filtering: one bridge, a PVID per access port, and a VLAN table that says which ports are tagged or untagged.
Prerequisites
- Plan:
ether2= Staff access (VLAN 10),ether3= Guest access (VLAN 20),ether5= trunk with both VLANs tagged. - Manage the router from a port that stays reachable, or use WinBox Safe Mode.
Solution (WinBox / CLI)
1. Bridge and ports (VLAN filtering stays off until the end):
/interface bridge add name=bridge1 vlan-filtering=no
/interface bridge port add bridge=bridge1 interface=ether2 pvid=10
/interface bridge port add bridge=bridge1 interface=ether3 pvid=20
/interface bridge port add bridge=bridge1 interface=ether52. VLAN table. The bridge itself is tagged so the router can route the VLANs:
/interface bridge vlan add bridge=bridge1 vlan-ids=10 tagged=bridge1,ether5 untagged=ether2
/interface bridge vlan add bridge=bridge1 vlan-ids=20 tagged=bridge1,ether5 untagged=ether33. VLAN interfaces and addresses for routing:
/interface vlan add interface=bridge1 name=vlan10-staff vlan-id=10
/interface vlan add interface=bridge1 name=vlan20-guest vlan-id=20
/ip address add address=192.168.10.1/24 interface=vlan10-staff
/ip address add address=192.168.20.1/24 interface=vlan20-guestAdd a DHCP server on each VLAN interface (see Basic internet setup) and add both VLAN interfaces to the LAN interface list.
4. Turn VLAN filtering on last:
/interface bridge set bridge1 vlan-filtering=yesWarning: If you manage the router through a port on this bridge, give that port a PVID and a management VLAN interface first, or you will lose access the moment filtering is enabled.
Verification
/interface bridge vlan print
/interface bridge port printA PC on ether2 gets a 192.168.10.x address, a PC on ether3 gets 192.168.20.x, and the switch on ether5 receives both VLANs tagged.
Common errors
- Forgot
bridge1in the tagged list: the VLANs work as a switch but the router cannot route them. - Turned on filtering before building the VLAN table: access lost.
- Guests can reach Staff: VLANs separate Layer 2 only. Add a forward rule to drop traffic from
vlan20-guestto192.168.10.0/24.
Rollback
/interface bridge set bridge1 vlan-filtering=noWith filtering off, the bridge forwards all ports together again.
This topic is covered hands-on in MTCSWE — MikroTik Certified Switching Engineer.
View MTCSWE