Page 1 of 1

Routing based on dst-address

Posted: Tue Dec 22, 2015 10:43 pm
by downther0ad
Hi,

As stated in title I need to make routing decision based on destiny address.

I have following rules:

mangle
chain=prerouting action=mark-routing new-routing-mark=to-172 passthrough=no dst-address=172.30.0.0/16
nat
chain=srcnat action=masquerade src-address=192.168.88.0/24 dst-address=172.30.0.0/16 out-interface=ether1-gateway
route
#      DST-ADDRESS        PREF-SRC        GATEWAY            DISTANCE
 0 A S  172.30.0.0/16                      172.30.250.1              1
I can see two gateways, the one that I cannot reach and the one that is always decided, I know this because with /tools trace always I get the same gateway even if I ping explicity to 172.30.x.x

192.168.88.0 is my router lan on eth3 and 172.30.0.0 is a remote visible network

I followed this:
http://wiki.mikrotik.com/wiki/Load_Bala ... e_Gateways

Thanks in advance

Re: Routing based on dst-address

Posted: Wed Dec 23, 2015 4:41 pm
by telnetpr
Did you create the static route with the new routing mark ??

Re: Routing based on dst-address

Posted: Wed Dec 23, 2015 4:50 pm
by downther0ad
yes, I have this route:
0 A S  dst-address=172.30.0.0/16 gateway=172.30.x.x gateway-status=172.30.x.x reachable via  ether1-gateway distance=1 scope=30 target-scope=10 
        routing-mark=to-172

Re: Routing based on dst-address

Posted: Wed Dec 23, 2015 7:18 pm
by telnetpr
yes, I have this route:
0 A S  dst-address=172.30.0.0/16 gateway=172.30.x.x gateway-status=172.30.x.x reachable via  ether1-gateway distance=1 scope=30 target-scope=10 
        routing-mark=to-172

Try your masquerade only with the source address. And see what happen
chain=srcnat action=masquerade src-address=192.168.88.0/24