Hi,
I apologize at the beginning if I am repeating this topic, but I didn’t find any already posted that refers to the same problem I have.
I need some advice from more experienced MikroTik users regarding VLAN configuration on CRS switches.
Scenario is following:
I have two CRS226-24G-2S. I do not need any routing on them, I just need to create multiple VLAN domains.
Here is the configuration I implemented on both switches:
CRS1:
/interface vlan
add interface=ether2 l2mtu=1584 name=Mgmt_VLAN vlan-id=10
/interface ethernet
set [ find default-name=ether1 ] none
set [ find default-name=ether2 ] none
set [ find default-name=ether3 ] master-port=ether2
set [ find default-name=ether4 ] master-port=ether2
set [ find default-name=ether5 ] master-port=ether2
set [ find default-name=ether6 ] master-port=ether2
set [ find default-name=ether7 ] master-port=ether2
set [ find default-name=ether8 ] master-port=ether2
set [ find default-name=ether9 ] master-port=ether2
set [ find default-name=ether10 ] master-port=ether2
set [ find default-name=ether11 ] master-port=ether2
set [ find default-name=ether12 ] master-port=ether2
set [ find default-name=ether13 ] master-port=ether2
set [ find default-name=ether14 ] master-port=ether2
set [ find default-name=ether15 ] master-port=ether2
set [ find default-name=ether16 ] master-port=ether2
set [ find default-name=ether17 ] master-port=ether2
set [ find default-name=ether18 ] master-port=ether2
set [ find default-name=ether19 ] master-port=ether2
set [ find default-name=ether20 ] master-port=ether2
set [ find default-name=ether21 ] master-port=ether2
set [ find default-name=ether22 ] master-port=ether2
set [ find default-name=ether23 ] master-port=ether2
set [ find default-name=ether24 ] master-port=ether2
/interface ethernet switch vlan
add ports=switch1-cpu,ether2,ether3 vlan-id=10
add ports=ether2,ether4,ether5,ether6,ether7,ether8 vlan-id=20
/interface ethernet switch egress-vlan-tag
add tagged-ports=ether2 vlan-id=20
add tagged-ports=ether2,switch1-cpu vlan-id=10
/interface ethernet switch ingress-vlan-translation
add new-customer-vid=10 ports=ether3 sa-learning=yes
add new-customer-vid=20 ports=ether4 sa-learning=yes
add new-customer-vid=20 ports=ether5 sa-learning=yes
add new-customer-vid=20 ports=ether6 sa-learning=yes
add new-customer-vid=20 ports=ether7 sa-learning=yes
add new-customer-vid=20 ports=ether8 sa-learning=yes
/ip address
add address=10.0.0.1/24 interface=Mgmt_VLAN network=10.0.0.0
CRS2:
/interface vlan
add interface=ether2 l2mtu=1584 name=Mgmt_VLAN vlan-id=10
/interface ethernet
set [ find default-name=ether1 ] none
set [ find default-name=ether2 ] none
set [ find default-name=ether3 ] master-port=ether2
set [ find default-name=ether4 ] master-port=ether2
set [ find default-name=ether5 ] master-port=ether2
set [ find default-name=ether6 ] master-port=ether2
set [ find default-name=ether7 ] master-port=ether2
set [ find default-name=ether8 ] master-port=ether2
set [ find default-name=ether9 ] master-port=ether2
set [ find default-name=ether10 ] master-port=ether2
set [ find default-name=ether11 ] master-port=ether2
set [ find default-name=ether12 ] master-port=ether2
set [ find default-name=ether13 ] master-port=ether2
set [ find default-name=ether14 ] master-port=ether2
set [ find default-name=ether15 ] master-port=ether2
set [ find default-name=ether16 ] master-port=ether2
set [ find default-name=ether17 ] master-port=ether2
set [ find default-name=ether18 ] master-port=ether2
set [ find default-name=ether19 ] master-port=ether2
set [ find default-name=ether20 ] master-port=ether2
set [ find default-name=ether21 ] master-port=ether2
set [ find default-name=ether22 ] master-port=ether2
set [ find default-name=ether23 ] master-port=ether2
set [ find default-name=ether24 ] master-port=ether2
/interface ethernet switch vlan
add ports=switch1-cpu,ether2,ether3 vlan-id=10
add ports=ether2,ether4,ether5,ether6,ether7,ether8 vlan-id=20
/interface ethernet switch egress-vlan-tag
add tagged-ports=ether2 vlan-id=20
add tagged-ports=ether2,switch1-cpu vlan-id=10
/interface ethernet switch ingress-vlan-translation
add new-customer-vid=10 ports=ether3 sa-learning=yes
add new-customer-vid=20 ports=ether4 sa-learning=yes
add new-customer-vid=20 ports=ether5 sa-learning=yes
add new-customer-vid=20 ports=ether6 sa-learning=yes
add new-customer-vid=20 ports=ether7 sa-learning=yes
add new-customer-vid=20 ports=ether8 sa-learning=yes
/ip address
add address=10.0.0.2/24 interface=Mgmt_VLAN network=10.0.0.0
This configuration is just for testing purposes.
The idea is to connect two switches using port 2, which is configured as tagged port (two VLANs need to cross over this port, VLAN 10 and VLAN 20). On each switch there is: one access port (untagged) in VLAN 10 (port 3), and 5 access ports in VLAN 20.
This configuration need to achieve following:
- If I connect two switches through port 2, I must be able to ping from CRS1 10.0.0.2 and from CRS2 to ping 10.0.0.1 (port 2 on both switches allows VLAN 10 tagged and these addresses are bind to vlan 10 interface). —> THIS IS OK.
- If I additionally connect my PC with static IP address 10.0.0.254/24, to port 3 on either switch, I must be able to ping both vlan 10 interfaces on switches. ----> THIS IS OK.
- If I connect my PC with static IP address 10.0.0.254/24, to any port from 4-8 (ports that belong to VLAN 20), I must NOT be able to ping vlan 10 interfaces on either of two switches. -----> THIS IS OK.
- If I connect two PCs, one, with static IP address 10.0.0.254/24 to port 3 on CRS1 and the other one with static IP 10.0.0.253/24 to port 3 on CRS2, these two PCs must be able to ping each other (they are both connected to access ports in VLAN 10, and two switches are connected through tagged port that allows VLAN 10 to pass through). ------> THIS IS OK.
- If I connect two PCs, one with static IP address 10.0.0.254/24 to port 3 on CRS1 (access port in VLAN 10) and the other one with static IP 10.0.0.253/24 to port 4 on CRS2 (access port in VLAN20), these two PCs must NOT be able to ping each other because they are connected to different VLANs, even though they have IP parameters as if they are in the same subnet. -------> THIS IS NOT OK!!!
As you can see from tests explained above, what is confusing me, is why am I able to ping one PC from another, if I connect them to two different VLANs?? Just to make a note: I have tested also to connect these two PCs (with above given IP settings) to two ports on the SAME switch, one PC in port 3 (VLAN10) and other PC in port 4 (VLAN20), and they can not ping each other, as it should be.
It appears as though, when traffic passes through link between switches, something happens and the ping is successful (and it shouldn’t be if my PCs are in different VLANs).
Note for the end: I am not using port from 9 through 24 at all in this testing, so they do not have any relation to these tests…
Can anybody give me some advice or opinion what is happening?
Also, one more question. Is it possible that there is no STP support at all if I use VLAN switching instead of bridging? Because, with this given configuration, I also tested if there is STP running (even though I couldn’t find anywhere under switch options where can I configure STP, unless I use bridges - which I do not want), and STP is not running. If I connect directly, for example, port 4 on CRS1 with port 5 on CRS1 (both ports in the same VLAN 20), loop is created (none of the ports turns to blocking state) and of course, as it is always when loop is present, CPU of the switch is overwhelmed until I unplug one side of the cable…
Thanks a lot.
Kind regards,
Jovana