I have 2 MK routers in two different floors connected as following with ethernet on a 24port switch
1st MK)
ether1 - Wan
ether2 - 192.168.0.1 —> to switch A local lan 192.168.0.0/24
vlan2 192.168.10.1
2nd MK)
ether1 - 192.168.0.2 -->to switch A
ether2 - 192.168.1.1 -->local floor lan 192.168.1.0/24
vlan2 192.168.10.2
default route 0.0.0.0 to 192.168.0.1 as GW
Following this wiki https://wiki.mikrotik.com/wiki/Manual:Interface/VLAN#Simple_VLAN_routing example (Layer3 VLAN examples Simple VLAN routing)
I added the vlan , and the static ip 192.168.10.1 and 192.168.10.2 on the secon .
But i cannot ping inside the mikrotik each other .
You got your VLANs on the wrong ports, you’ll need:
MK1 to have VLAN bound to ether2, and MK2 needs the VLAN on ether1 if what you’re trying to replicate is the scenario in the wiki. However, the wiki states a hub, not a switch, like in your setup. Is your switch a managed switch? I’m assuming you’ll need to set the VLAN on there as well.
If I’m not mistaken, the Mikrotiks are tagging the traffic on vlan 2, so you’ll probably want a trunk (usually trunks are for multiple VLANs, but 1 should be ok). That means you will have to tag the ports the Mikrotiks are plugged into for vlan 2, and make a PVID on both that is a unique VLAN id that is not used anywhere else.
Again, I’m still figuring this stuff out myself, so I may be off…
Personally, I would scrap the IPs on the physical ports, and set the default gw to the other devices VLAN IP… (it might require some trial and error)