Routing different subnets through different providers, possible???

Good morning all,
Here is my scenario…
Location A - Provider A (RB1100)
Location B - Provider B (RB1100)
Location A, B, C, D, E, etc are all subnetted using OSPF.

I would like to route all 10.x.x.x traffic through provider A.
I would also like to route all 192.x.x.x traffic through provider B.

What I’ve tried so far:
I’ve setup masquerade at both A and B locations for the subnets I want to pass through it.
Somehow I need to tell location B to route all that traffic that direction through its provider, just not sure how to do it.

Currently everything is going through location A / provider A, I just need to break off some of the load.
Any suggestions would be great.
Thanks in advance,
Ryo

Not sure about your specific scenario, and OSPF setup but a simple approach could be manipulating metrics on C,D,E to weight OSPF towards the preferred exit.

It’s not metrics…
I want all 10.x.x.x traffic from every location to route through Location A / Provider A.
I want all 192.x.x.x. traffic from every location to route through Location B / Provider B.
I think it has to do with masquerade and srcnat, but what I’ve tried hasn’t worked.
Currently I have set:
Chain: srcnat / src address: 192.168.0.0/16 / out.interface: Ether1 (provider b) / action: masquerade

Yes this is correct, what is your problem?

masquerading is just a (needed) part of the equation.

The most simple approach would be manipulating metrics so that OSPF itself weights traffic toward exit A or B, and in the event of one failing, failovers to the working one.

If you want to lock routing to each exit depending on the subnet, you could set each specific gateway (a or B) on those subnets routers.

A network diagram will certainly help. For a viable conditional routing setup using VRF for example, you would have to set a single router with those two gateways, then make it the default gateway of CDE.

It is called policy routing. You can find a lot of example show to do it in our wiki
http://wiki.mikrotik.com/wiki/MikroTik_RouterOS


Two ways how to do it:

  • with routing rules
  • with firewall mangle by marking routing.