Page 1 of 1

NAT rules to and from

Posted: Sun Apr 30, 2023 4:12 am
by cavaughan
So I have a block of 5 public IPs. Let's say 173.160.187.9-13
The MK router is on x.9
Now one mail server is at x.10, then next at x.11
Any traffic to x.10 gets NAT-ed over to 10.0.1.13, and for x.11 to 10.0.1.14. All works great!
But I need traffic coming out to 10.0.1.13 and 10.0.1.14 to exit through their corresponding public IPS (i.e., 172.160.187.10 and x.11)

I thought the following rule would work, but it doesn't:
/ip/firewall/nat
add action=src-nat chain=srcnat src-address=10.0.1.13 to-addresses=173.160.187.10
add action=src-nat chain=srcnat src-address=10.0.1.14 to-addresses=173.160.187.11

All traffic exits through the router address 173.160.187.9

Re: NAT rules to and from

Posted: Sun Apr 30, 2023 11:45 am
by Guscht
I tested this in my lab and it worked as (you) expected.
Maybe your "general" SNAT rule is simply above your custom-SNAT-rules?

Re: NAT rules to and from

Posted: Sun Apr 30, 2023 4:00 pm
by cavaughan
Guscht, thank you so much! Yep, just had to move the rules to the very beginning of the NAT rules and it worked. So simple....