different gateways for Vlans

Hi,

im new to Mikrotik and VLANs
I have played now some days with my CRS125, and got my first 3 Test Vlans with srcnat - masq running.
Till here its clear, and the performance is great.

But now i stuck a bit, and im not sure, how to handle this case

I need 2 dif. Gateways for my Vlans

So e.g.

  • Vlan-Art → Vlan id 10 → ip adr 192.168.10.0/24 → Gateway 192.168.0.253

Vlan-Dev → Vlan id 20 → ip adr 192.168.20.0/24 → Gateway 192.168.0.254

Port 24 got the Uplink to these to Gateway IPs.

I would be cool if u can push me in the right direction

Thank u very much for your help and your time
Cheers

Marking packets and then routing based on the mark is what you want, I think:

ip firewall mangle add action=mark-routing chain=prerouting new-routing-mark=use-artgw src-address=192.168.10.0/24
ip route add distance=1 gateway=192.168.0.253 routing-mark=use-artgw

ip firewall mangle add action=mark-routing chain=prerouting new-routing-mark=use-devgw src-address=192.168.20.0/24
ip route add distance=1 gateway=192.168.0.254 routing-mark=use-devgw

Hi Pants,

your way… works 100% as a charm

Thank u for your help!

[SOLVED]