Community discussions

 
David1234
Forum Guru
Forum Guru
Topic Author
Posts: 1264
Joined: Sun Sep 18, 2011 7:00 pm

I want to do NAT for 3 devices,possible?

Wed Mar 06, 2013 5:27 pm

I have one router that connect to the internet
connect to him 3 more devices - I want to be able to get to them from away
I know how to do NAT to 1 device
but how can I do it to 3 devices?
all of them use the same port ( but different address : 192.168.1.1,192.168.1.2,192.168.1.3, port 554)
can I do this?


Thanks ,
 
CelticComms
Forum Guru
Forum Guru
Posts: 1766
Joined: Wed May 02, 2012 5:48 am

Re: I want to do NAT for 3 devices,possible?

Wed Mar 06, 2013 5:30 pm

Use different ports externally and map each to the same port internally - but different device.
Interlynx | Networking and Information Security Consultants & Trainers | Email: routerlynx@gmail.com
BGP | EIGRP | OSPF | MPLS | Firewall | VPN | IPsec | Multicast | QOS | IPv4/6 | STP | VLAN | PON | AE | M2M | and more!

 
David1234
Forum Guru
Forum Guru
Topic Author
Posts: 1264
Joined: Sun Sep 18, 2011 7:00 pm

Re: I want to do NAT for 3 devices,possible?

Wed Mar 06, 2013 8:24 pm

can you show me 1 example?
how do to NAT to 192.168.1.2 and I change the port to 1500?

Do I need to change dst port and in the action port?
 
User avatar
shahbazian
Trainer
Trainer
Posts: 166
Joined: Fri Sep 09, 2011 6:22 pm
Location: Iran
Contact:

Re: I want to do NAT for 3 devices,possible?

Wed Mar 06, 2013 8:47 pm

David1234
If your public ip address is 1.2.3.4 and your private addresses is 192.168.1.1, 192.168.1.2, 192.168.1.3 you must add this rules:
/ip firewall nat
add chain=dstnat dst-address=1.2.3.4 protocol=tcp dst-port=1 action=dst-nat to-addresses=192.168.1.1 to-ports=100
add chain=dstnat dst-address=1.2.3.4 protocol=tcp dst-port=2 action=dst-nat to-addresses=192.168.1.2 to-ports=100
add chain=dstnat dst-address=1.2.3.4 protocol=tcp dst-port=3 action=dst-nat to-addresses=192.168.1.3 to-ports=100
By adding this rules every tcp traffic come to 1.2.3.4:1 then go to 192.168.1.1:100
Learn MikroTik to improve your network.
( MTCNA, MTCRE, MTCWE, MTCTCE, MTCUME, MTCIPv6E, MTCINE )
MikroTik Certified Trainer & Consultant
RIPE NCC Trainer
 
David1234
Forum Guru
Forum Guru
Topic Author
Posts: 1264
Joined: Sun Sep 18, 2011 7:00 pm

Re: I want to do NAT for 3 devices,possible?

Thu Mar 07, 2013 5:33 pm

Thanks!

Who is online

Users browsing this forum: No registered users and 68 guests