Setting Up InterVlan Routing on Mikrotik CRS226

hi,

I have a mirkotik crs226.

What I want to accomplish:

  1. setup 2 vlans that can route between each other on the same switch.
  2. A routed port to route the VLANs to other subnets outside the switch.

Ive attached an image of what I want the design to be.
Mikrotik Vlan Design.png
What interface will I assign as the SVI? How do I accomplish this. Could someone help me with the configs. :question:

Thanks!!

anyone there?

#link all ports to switch
/interface ethernet set [find] master-port=sfp1

#convert ether24 to “routed” port and assign ip address
/interface ethernet set ether24 master-port=none comment=uplink

(static ips)
/ip address add interface=ether24 address=x.x.x.x/y
/ip route add gateway=x.x.x.x

(or using dhcp client)

/ip dhcp-client remove [find]
/ip dhcp-client add interface=ether24

#create vlans in router and assign IPs to them
/interface vlan add interface=sfp1 vlan-id=2 name=vlan2
/interface vlan add interface=sfp1 vlan-id=3 name=vlan3
/ip address add interface=vlan2 address=10.0.2.1/24
/ip address add interface=vlan3 address=10.0.3.1/24

#create vlans in switch
/interface ethernet switch
vlan add vlan-id=2 learn=yes ports=switch1-cpu,ether1,…
vlan add vlan-id=3 learn=yes ports=switch1-cpu,ether10,…

egress-vlan-tag add tagged-ports=switch1-cpu vlan-id=2
egress-vlan-tag add tagged-ports=switch1-cpu vlan-id=3

ingress-vlan-translation add new-customer-vid=2 ports=(the same ports you listed before)
ingress-vlan-translation add new-customer-vid=3 ports=(the same ports you listed before)

this is the official way to do it.

if you will only use 2 VLANs in the future, and don’t want to use .1q VLAN trunking, it can be done more easily.

just assign a bunch of ports to one master-port, say ether2-ether10 to ether1
and the others (say ether12-ether23) to ether11. leave ether24 with master port none.
assign IPs in router to ether1 and ether11. you will have now two isolated LANs in the
switch. VLAN id is not set, but they can only access each other through routing.
this works up to 3 “VLANs”, e.g. 3 different master-ports can be set.
but this is less flexible than the previous.

off you go. you can still add dhcp-server for the VLANs using vlan2 and vlan3 (or ether1 & ether11 if you choose the 2nd approach) interfaces respectively.

sorry. did not fully read the pic, use vlan10 and 20 instead of 2 and 3