Community discussions

MikroTik App
 
Ick
newbie
Topic Author
Posts: 26
Joined: Sat Mar 11, 2006 5:31 pm

Can I NAT on different ports?

Thu Oct 21, 2010 5:19 pm

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
 
fewi
Forum Guru
Forum Guru
Posts: 7717
Joined: Tue Aug 11, 2009 3:19 am

Re: Can I NAT on different ports?

Thu Oct 21, 2010 5:23 pm

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

Who is online

Users browsing this forum: infabo and 63 guests