Community discussions

MikroTik App
 
voodie
just joined
Topic Author
Posts: 4
Joined: Fri Nov 28, 2014 11:50 am

different gateways for Vlans

Fri Nov 28, 2014 12:18 pm

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
 
User avatar
pants6000
Frequent Visitor
Frequent Visitor
Posts: 91
Joined: Fri Sep 26, 2014 5:30 am

Re: different gateways for Vlans

Sat Nov 29, 2014 8:26 am

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
 
voodie
just joined
Topic Author
Posts: 4
Joined: Fri Nov 28, 2014 11:50 am

Re: different gateways for Vlans

Tue Dec 02, 2014 10:37 am

Hi Pants,

your way... works 100% as a charm

Thank u for your help!

[SOLVED]