Community discussions

MikroTik App
 
elnino54
just joined
Topic Author
Posts: 5
Joined: Wed Jan 11, 2023 2:20 pm

Can't seem to get my vlans to work

Wed Jan 11, 2023 2:45 pm

Hi all, I've got some experience with Microtik but this is the first time I have played with a Microtik switch (CRS326-24g-2S+).

It currently has routerOS on it and it is working fine as a generic router - I'm using it now to post this.

Where i'm struggling is with the VLANS. I have:
VLAN 1 - Main Network
VLAN 20 - IP Cameras
VLAN 99 - Guest Wifi

VLAN 20 was easy - I created a new bridge for just the cameras, untagged 20, added an IP, some firewall rules, DHCP etc. That works fine.

What I can't seem to configure the AP ports as trunks for VLAN 99.

Initially I had:
Bridge1 = Ports 2-20
Bridge1 vlans 99 Tagged 2-6 (where the AP can be plugged in)

Works fine for anything on vlan 1 over wifi but not vlan 99

I don't need a real port to be active (untagged) for this VLAN as it is only used by wifi which is tagged at the ap (Unifi) but obviously I need an IP bound to it. I created a vlan interface and assigned an IP to it. I'm just completely confused on how best to get this to work and the Microtik way of doing things is not yet logical to me.

Just now, I thought perhaps I create a new bridge just for the trunk ports, Untagged 1, tagged 99 etc but that does not seem to work either. My logic says it should because the VLANS match, despite being on a different 'bridge' since it's still just layer 2 but It's doing my head in!

Please can someone explain this to me. I thought this would be just like a normal switch that I can set tagged/untagged/allowed/excluded but i'm confused by having to create bridge interfaces etc.
 
User avatar
mkx
Forum Guru
Forum Guru
Posts: 11593
Joined: Thu Mar 03, 2016 10:23 pm

Re: Can't seem to get my vlans to work

Wed Jan 11, 2023 8:42 pm

It seems your concept is all wrong. You really should have single bridge ... see this nice tutorial, it covers quite a few typical use cases.

BTW, this is the only configuration style which allows your CRS to switch traffic at wirespeed.
 
elnino54
just joined
Topic Author
Posts: 5
Joined: Wed Jan 11, 2023 2:20 pm

Re: Can't seem to get my vlans to work

Thu Jan 12, 2023 12:04 am

Thanks mkx, I'll review the configs - That was not something I came across when determining how to do the initial config.

I must say - I started out with a single bridge but the vlans did not seem to work at all, hence I split off the cameras to a separate bridge. Hopefully with that I should be able to understand it and get it to work. Perhaps deceptively the VLANs aren't working at all still, since the bridge is providing the isolation rather than VLAN.
 
elnino54
just joined
Topic Author
Posts: 5
Joined: Wed Jan 11, 2023 2:20 pm

Re: Can't seem to get my vlans to work

Thu Jan 12, 2023 1:36 am

So I've reviewed my current settings vs the 'switch' config and I've basically already at that config.

VLAN 1 being the default network VLAN for general network access.
VLAN 99 - Guest Wifi

If we ignore the camera bridge for the moment, I have:
/interface bridge port
add bridge=BR1 interface=ether2
.....
add bridge=BR1 interface=ether20
/interface bridge vlan
add bridge=BR1 tagged=ether2,ether3,ether4,ether5,ether6 vlan-ids=99

/interface bridge port
set bridge=BR1 ingress-filtering=yes frame-types=admit-all [find interface=ether2]
...
set bridge=BR1 ingress-filtering=yes frame-types=admit-all [find interface=ether20]
So that seems right.

I then have:
/interface vlan
add interface=BR1 name=VLAN99 vlan-id=99

/ip address
add address=192.168.0.254/24 interface=BR1 network=192.168.0.0
add address=192.168.99.254/24 interface=VLAN99 network=192.168.99.0
So I think I was pretty on the mark for how it should be but I can't seem to get it to work.
 
elnino54
just joined
Topic Author
Posts: 5
Joined: Wed Jan 11, 2023 2:20 pm

Re: Can't seem to get my vlans to work

Thu Jan 12, 2023 4:00 am

Answering my own question:
/interface bridge vlan
add bridge=BR1 tagged=BR1,ether2,ether3,ether4,ether5,ether6 vlan-ids=99
Adding BR1 to the tagged statement

It's not overly logical to me why I need to add the bridge but it solved the issue
 
User avatar
mkx
Forum Guru
Forum Guru
Posts: 11593
Joined: Thu Mar 03, 2016 10:23 pm

Re: Can't seem to get my vlans to work

Thu Jan 12, 2023 8:41 am

It's not overly logical to me why I need to add the bridge but it solved the issue

This short tutorial should help you understand the reason.
 
elnino54
just joined
Topic Author
Posts: 5
Joined: Wed Jan 11, 2023 2:20 pm

Re: Can't seem to get my vlans to work

Fri Jan 13, 2023 12:17 am

That actually really does clear it up. Completely makes sense when you consider it as two separate devices.

My initial internal logic was the opposite, in that the bridge was somehow overriding the port, but effectively the port is a child of the bridge so it needs to be included as well.

Who is online

Users browsing this forum: No registered users and 28 guests