Community discussions

MikroTik App
 
josu
Member Candidate
Member Candidate
Topic Author
Posts: 152
Joined: Wed May 27, 2015 6:20 pm

Simple NAT rule

Thu May 28, 2015 6:33 pm

Hello,

I want to create simple NAT rule to forward FTP (21) port to my LAN server (192.168.88.10).

I create this way:
/ip firewall nat add action=dst-nat chain=dstnat disabled=no dst-port=21 in-interface=ether1-gateway protocol=tcp to-addresses=192.168.88.10 to-ports=21
But in the web interface I got this:

Image

There is nothing about the server IP, is there something wrong?

Kind regards.
 
User avatar
lordkappa
Member Candidate
Member Candidate
Posts: 133
Joined: Wed May 16, 2012 1:53 pm
Location: Vancouver, Canada

Re: Simple NAT rule

Sat May 30, 2015 10:37 pm

If you click on the rule, you can see the full list. It will include the to-address.
 
josu
Member Candidate
Member Candidate
Topic Author
Posts: 152
Joined: Wed May 27, 2015 6:20 pm

Re: Simple NAT rule

Sat May 30, 2015 11:57 pm

Thanks, but I want to do it with command-line.

Then configure some scripts.

Regards.
 
User avatar
BartoszP
Forum Guru
Forum Guru
Posts: 3137
Joined: Mon Jun 16, 2014 1:13 pm
Location: Poland

Re: Simple NAT rule

Sun May 31, 2015 1:48 am

Set it up in Winbox and then open terminal end do EXPORT command.
You will see your configuration as commands so you can see how to do it in CLI.
 
travisres
just joined
Posts: 17
Joined: Wed May 29, 2013 11:53 pm

Re: Simple NAT rule

Sun May 31, 2015 10:23 pm


There is nothing about the server IP, is there something wrong?
Check your columns. the image shows src address and dst address, but your script is using in-interface and to-address. If you don't have those columns turned on, you won't see them.
 
josu
Member Candidate
Member Candidate
Topic Author
Posts: 152
Joined: Wed May 27, 2015 6:20 pm

Re: Simple NAT rule

Mon Jun 01, 2015 10:40 am

Thanks!

One question, which "action" must I use to do a simple NAT from wan interface to LAN server?

Regards.
 
josu
Member Candidate
Member Candidate
Topic Author
Posts: 152
Joined: Wed May 27, 2015 6:20 pm

Re: Simple NAT rule

Mon Jun 01, 2015 12:40 pm

I got it!
/ip firewall nat add action=dst-nat chain=dstnat dst-address=10.X.X.X dst-port=21 in-interface=ether1-gateway protocol=tcp to-addresses=192.168.88.10 to-ports=21
But I have a problem, my WAN interface is a dynamic public one, is it possible to put a alias for it?

Best regards.
 
User avatar
pukkita
Trainer
Trainer
Posts: 3051
Joined: Wed Dec 04, 2013 11:09 am
Location: Spain

Re: Simple NAT rule

Mon Jun 01, 2015 12:56 pm

IP > Cloud
 
josu
Member Candidate
Member Candidate
Topic Author
Posts: 152
Joined: Wed May 27, 2015 6:20 pm

Re: Simple NAT rule

Mon Jun 01, 2015 1:17 pm

IP > Cloud
Thanks!

I enable the Cloud service, now I have a public domain.

So need I to use the "xxxxxxxxxxxx.sn.mynetname.net" in the "dst-address" configuration?

Best regards.
 
User avatar
pukkita
Trainer
Trainer
Posts: 3051
Joined: Wed Dec 04, 2013 11:09 am
Location: Spain

Re: Simple NAT rule

Mon Jun 01, 2015 1:43 pm

No, just use wan as in-interface
 
josu
Member Candidate
Member Candidate
Topic Author
Posts: 152
Joined: Wed May 27, 2015 6:20 pm

Re: Simple NAT rule

Tue Jun 02, 2015 10:11 am

Thanks! It works for me.

Best regards.