Failover with NAT

Hi everyone,

this should be something simple but it`s not working for me.

I`m trying to setup two gateway fail over as described in Mikrotik Wiki:

/ip route add gateway=82.114.70.1 check-gateway=ping
/ip route add gateway=172.16.0.1 distance=2

this works as expected but there is another issue

I`m having trouble NAT-ing the traffic.

what I thought I should do is setup two src-nat rules as below

chain=srcnat out-interface=wan src-address=10.10.10.0/30 action=src-nat to-addresses=82.114.70.154 to-ports=0-65535

chain=srcnat out-interface=wan src-address=10.10.10.0/30 action=src-nat to-addresses=172.16.0.2 to-ports=0-65535

than I setup netwatch rules to check the gateway 82.114.70.154 and on down it should execute the command:

ip firewall nat disable 0

on up it should execute

ip firewall nat enable 0

My problem is that netwatch does not execute this commands, my doubt is that it first needs to use the print command to get the values and than execute the command, with that being said, how do you execute multiple commands in netwatch?

i tried :


ip firewall nat print
ip firewall nat disable 0

but it does not work :S

I`m using Router OS 2.9.51


all the help is appreciated


thanks,
Dardan

You can us simple NAT rule,
/ip firewall nat add action=masquerade src-address=local_IP_address

That would not work,

I failed to mention that both of these gateways are reachable through the same interface… basically making masquerade unusable, that is why I went with src-nat option.

I have fixed this issue by using scripts, rather simple ones but if anybody cares I can post them.


thanks,
Dardan