Page 1 of 1

Can I NAT on different ports?

Posted: Thu Oct 21, 2010 5:19 pm
by Ick
Just purchased a PowerRouter 732 and am setting it up on my network as a core router. I have 4 different legs that go North South East and West. I am going to use one Ethernet port for each leg. I am also using different networks on each leg, and it is a statically routed network. The 5th port will connect to my upstream providers router.

I would like to NAT on each Ethernet port individually running different public IP's, using different subnets. Is this possible?

Eric

Re: Can I NAT on different ports?

Posted: Thu Oct 21, 2010 5:23 pm
by fewi
Of course. Below an example. ether1 is the WAN port, one LAN is 192.168.0.0/24 and it is translated to 1.1.1.1 out ether1, a second LAN is 10.0.0.0/24 and it is translated to 1.1.1.2 out ether1.
/ip firewall nat
add chain=srcnat out-interface=ether1 src-address=192.168.0.0/24 action=src-nat to-address-1.1.1.1
add chain=srcnat out-interface=ether1 src-address=10.0.0.0/24 action=src-nat to-address=1.1.1.2
Whenever you have static IPs you should use src-nat and not masquerade, masquerade is for dynamically addressed interfaces (PPP, DHCP).
http://wiki.mikrotik.com/wiki/Manual:IP/Firewall/NAT