Policy based routing issue on Mikrotik !!

Hello,

I was using Cisco router to configure SBR = Source based routing

Now I’m trying to move to Mikrotik devices and I’m trying to do that same with no result

On Cisco it’s to easy create an access list then add this access list to SBR and then assign it to the interface with next hop

so If I receive a packet from Source A send it to next hop B


I tried on Mikrotik and I couldn’t make it !! I don’t why


Can anyone help me in this issue ? IF I receive a packet from 3.3.3.0/24 then go to 192.168.50.1 and 192.168.50.1 is a GRE tunnel IP address and that will be the next hop ?



Best Regards

Hey,

If you are in ROS v6 you can do this on IP → ROUTES → RULES in v7 goto Routing → Rules

Thanks a lot for the answer, so I don’t have to configure NAT to have SBR ?

Best Regards

it depends on your configuration if you don’t want fully routed solution you can NAT/masquerade any subnet of your choice

The last question so I need to create Routing Mark and new Tables ?

the Action will be Lookup ?

If you use lookup, in case that Gateway is not reachable it will fall back to the Main Routing Table, whatever that may be.
If you use lookup-only-in-table, if the Gateway is not reachable, you won’t be routed at all to any other Gateway, including the Main.

To answer your question yes, and this is the syntax on top of my head please use mikrotik tab completion feature to fill in the gaps but the geist is this please see below

gateway = gre1 interface or ip address

/ip route add dst-address=0.0.0.0/0 routing-mark=tun1 gateway=gre1
/ip route rule add src-address=src_subnet dst-address=dst_subnet action=lookup table=tun1