VLAN Isolation

Hi! I want to configure a cAP ac. I need to generate 2 SSID (Working + Guests).
Both SSID are successfully configured (VLAN 1, VLAN 80). The problem is on routing, when I’m connected on SSID Guests (VLAN 80), if I change my IP address for an IP of network Working (VLAN 1) I can do ping for hosts in VLAN 1.

Is it possible that I need to enable some option in Routerboard for a successfull isolation of VLANs??

You can see my cAP ac configuration, on below text:

/interface bridge
add ingress-filtering=yes name=bridge1 vlan-filtering=yes
/interface wireless security-profiles
set [ find default=yes ] supplicant-identity=MikroTik
add authentication-types=wpa2-psk,wpa2-eap management-protection=allowed mode=dynamic-keys name=Work supplicant-identity=“” wpa2-pre-shared-key=***********
add authentication-types=wpa2-psk,wpa2-eap management-protection=allowed mode=dynamic-keys name=Guests supplicant-identity=“” wpa2-pre-shared-key=***********
/interface wireless
set [ find default-name=wlan1 ] band=2ghz-b/g/n country=***** disabled=no mode=ap-bridge security-profile=Empresa ssid=Work2
set [ find default-name=wlan2 ] band=5ghz-a/n/ac country=***** disabled=no mode=ap-bridge security-profile=Empresa ssid=Work5
add disabled=no keepalive-frames=disabled mac-address=C6:AD:34:9E:50:B5 master-interface=wlan1 multicast-buffering=disabled name=wlan3 security-profile=
Invitados ssid=Guests2 wds-cost-range=0 wds-default-cost=0 wps-mode=disabled
add disabled=no keepalive-frames=disabled mac-address=C6:AD:34:9E:50:B6 master-interface=wlan2 multicast-buffering=disabled name=wlan4 security-profile=
Invitados ssid=Guests5 wds-cost-range=0 wds-default-cost=0 wps-mode=disabled
/ip hotspot profile
set [ find default=yes ] html-directory=flash/hotspot
/interface bridge port
add bridge=bridge1 interface=ether1
add bridge=bridge1 interface=ether2 pvid=80
<------------------------------------------------------------ That is the problem, a host connected in ether 1(VLAN 1) answers ICMP requests from ether2 (Acess VLAN 80)
add bridge=bridge1 interface=wlan1
add bridge=bridge1 interface=wlan2
add bridge=bridge1 interface=wlan3 pvid=80
add bridge=bridge1 interface=wlan4 pvid=80
/interface bridge vlan
add bridge=bridge1 tagged=ether1 untagged=wlan3,wlan4,ether2 vlan-ids=80
/interface ethernet switch vlan
add disabled=yes independent-learning=no ports=ether1,ether2 switch=switch1 vlan-id=80
/ip address
add address=10.90.90.91 interface=bridge1 network=255.0.0.0

There’s a clash of a few things:

  1. most windows NIC drivers silently strip VLAN tags on ingress. So when a tagged frame comes in, it will strip VLAN tag and then treat it as untagged frame. On egress it will send out untagged frames (what happens next is up to the link party)
  2. ether1 is not configured to reject untagged and/or alien VLAN frames. Depending on the rest of settings and on bridge implementation in ROS it might mean that it will accept untagged frame, keep it untagged in transit and then forward it untagged to any other bridge member ports.
    To secure trunk port one has to set frame-types=admit-only-vlan-tagged ingress-filtering=yes to make sure only tagged frames are allowed and that frames belonging only to relevant VLANs are accepted.

The problem with above solution is that, if ether1 is intended as hybrid port (one VLAN untagged, the rest tagged[]), port security can’t work on anything. Hence it’s best to have all VLANs tagged on all links between network infrastructure devices (switches, routers, …) and only have untagged (or exceptionally hybrid if device explicitly supports/requires it) ports on edge of network (normal hosts).
[
] Note that VID=1 is implicit default setting throughout ROS and it turns out it’s safe to think of untagged (or “native” in some dialects) frames to belong to VLAN with VID=1.

Recommend use a different vlan from vlan1, that causes problems in configurations especially that diff vendors treat vlan1 differently.
As was pointed out, what are you attempting to connect to OUT of ether2??

You can also try using Split Horizon Bridging…

https://wiki.mikrotik.com/wiki/Manual:MPLSVPLS#Split_horizon_bridging

Thanks for all your answers.
But no one solutions pourposed by all off you resolves my trouble.
I receive a cable with vlan 1(untagged), and vlan 80 tagged which is connected to ether1. I use this VLANs for emit 2 SSID.
The ether2 function is extends vlan1 till a switch for users who connects directly via ethernet cable.

But if AP not separate correctly the both vlans, any computer who is connected on final switch, can received an IP addres from vlan1 (work) or vlan80 (guests) randomly.
MikrotikToruble.jpg
On initial configuration I have used ether2 as access port (vlan80) only for test the behaviour about vlans. But finally ether 2 only transmits vlan1 (untagged)..

You can use this as an example:

https://wiki.mikrotik.com/wiki/Manual:Switch_Chip_Features#VLAN_Example_1_.28Trunk_and_Access_Ports.29
https://wiki.mikrotik.com/wiki/Manual:Switch_Chip_Features#VLAN_Example_2_.28Trunk_and_Hybrid_Ports.29

Configure your ether1 as hybrid port, ether2 as an access port and switch1 cpu - as a trunk port.

Like that:

/interface bridge
add name=bridge1

/interface bridge port
add bridge=bridge1 interface=ether1
add bridge=bridge1 interface=ether2
add bridge=bridge1 interface=wlan1
add bridge=bridge1 interface=wlan2
add bridge=bridge1 interface=wlan3
add bridge=bridge1 interface=wlan4

/interface ethernet switch port
set 0 default-vlan-id=1 vlan-mode=secure
set 1 default-vlan-id=1 vlan-mode=secure
set 2 vlan-mode=secure
/interface ethernet switch vlan
add ports=switch1-cpu,ether1,ether2 switch=switch1 vlan-id=1
add ports=switch1-cpu,ether1 switch=switch1 vlan-id=80

And set vlan-mode=use-tag and needed vlan-id= for your wlan interfaces.

Thanks for yur answer. But I did it, and not works. Same trouble, when I connect thought an SSId who uses VLAN 80, I can do ping for hosts in VLAN 1.

/interface bridge
add name=bridge1
/interface wireless
set [ find default-name=wlan1 ] band=2ghz-b/g/n country=spain disabled=no mode=\
    ap-bridge ssid=Empresa-2.4G
set [ find default-name=wlan2 ] band=5ghz-a/n/ac channel-width=20/40/80mhz-XXXX \
    country=spain disabled=no mode=ap-bridge ssid=Empresa-5G
add disabled=no keepalive-frames=disabled mac-address=C6:AD:34:9E:50:B5 \
    master-interface=wlan1 multicast-buffering=disabled name=wlan3 ssid=\
    Pruebas-2.4G vlan-id=80 vlan-mode=use-tag wds-cost-range=0 \
    wds-default-cost=0 wps-mode=disabled
add disabled=no keepalive-frames=disabled mac-address=C6:AD:34:9E:50:B6 \
    master-interface=wlan2 multicast-buffering=disabled name=wlan4 ssid=\
    Pruebas-5G vlan-id=80 vlan-mode=use-tag wds-cost-range=0 wds-default-cost=0 \
    wps-mode=disabled
/interface ethernet switch port
set 0 default-vlan-id=1 vlan-mode=secure
set 1 default-vlan-id=1 vlan-mode=secure
set 2 vlan-mode=secure
/interface wireless security-profiles
set [ find default=yes ] supplicant-identity=MikroTik
/ip hotspot profile
set [ find default=yes ] html-directory=flash/hotspot
/interface bridge port
add bridge=bridge1 hw=no interface=ether1
add bridge=bridge1 hw=no interface=ether2
add bridge=bridge1 interface=wlan1
add bridge=bridge1 interface=wlan2
add bridge=bridge1 interface=wlan3
add bridge=bridge1 interface=wlan4
/interface ethernet switch vlan
add independent-learning=no ports=ether1,ether2,switch1-cpu switch=switch1 \
    vlan-id=1
add independent-learning=no ports=switch1-cpu,ether1 switch=switch1 vlan-id=80

Disable IP forwarding on the device.

Thanks it WORKS!

But, when I migrate cAP to production environment, Linux machines shows duplicated pings :frowning:

Where are the Linux machines connected?
Where from are you pinging them?
What is you production environment layout?
I can guess, that the problem lies somewhere else, not on the cAP.
But too little information for anything more specific. :slight_smile:

I think the same, but the problem is on cAP, I try to do same test on non-production environment, no good results.

Duplicated pings are produced when I connect a Linux host on ether 2.
If I connect same host on wlan 1,2,3 or 4 answers are not duplicated. Only via ethernet cable.

Where from do your ping it?
And what is connected to ether 1 at this time?

LANTrouble.jpg

Check how many icmp packets to 8.8.8.8 are actually leaving cAP on eth1 and how many are returning.
I still tend to blame the switch on the left for that behaviour.

Disable IP forwarding on mikrotik or on end devise?

On mikrotik.

could you be more specific on disabling IP forwarding, thank you in advance, this topic is very good.

IP → Settings → uncheck “IP Forward”

or from CLI:

/ip settings set ip-forward=no

If you dont want the VLANs to be able to communicate with each other on layer 3, i.e. ICMP traffic, you should block this with firewall rules

Then regarding “duplicate ping packets”, think it will be best to show this in a packet capture as evidence, I personally dont think you should disable IP Forwarding, etc.