Community discussions

MikroTik App
 
milda
just joined
Topic Author
Posts: 4
Joined: Thu Nov 19, 2009 7:30 am

dst-nat dont work, what is wrong ?

Thu Nov 19, 2009 7:59 am

Hi,
please, help me ... My Port forwarding dont work
On IP Address 192.168.100.55 ( LAN ) is www server whitch I want make visible on internet / WAN= 80.xxx.xxx.218

there is my configuration >

/ip firewal nat chain=srcnat action=masquerade src-address=192.168.100.0/24 out-interface=Wan
/ip firewal nat chain=srcnat action=src-nat to-addresses=80.xxx.xxx.218 to-ports=0-65535 src-address=192.168.100.55
/ip firewal nat chain=dstnat action=dst-nat to-addresses=192.168.100.55 to-ports=80
dst-address=80.xxx.xxx.218 dst-port=80 protocol=tcp
---------
/ip firewall filter
1 chain=forward action=accept src-address=192.168.100.55
------------
Route Table :
0 A S 0.0.0.0/0 r 80.xxx.xxx.217 1 Wan
1 ADC 80.xxx.xxx.216/29 80.xxx.xxx.218 0 Wan
2 ADC 192.168.100.0/24 192.168.100.98 0 LAN

OS - ver 3.10
 
User avatar
DannyZ
Member Candidate
Member Candidate
Posts: 230
Joined: Mon Sep 07, 2009 2:21 pm
Location: Latvia

Re: dst-nat dont work, what is wrong ?

Thu Nov 19, 2009 5:53 pm

Why u wanna forward all ports? As action use masquarde if u are connected to AP with single IP for all clients.
 
bobertperry
newbie
Posts: 44
Joined: Tue Jan 06, 2009 4:05 am

Re: dst-nat dont work, what is wrong ?

Thu Nov 19, 2009 9:43 pm

I am new at this too and am probably wrong but it looks like you have things a little backwards and don't need some things.

Things happen in order, this needs to go below the src-nat(which you dont need).
/ip firewal nat chain=srcnat action=masquerade src-address=192.168.100.0/24 out-interface=Wan
You don't need this, its covered by what the masquerade does in what I understand your configuration to be.
/ip firewal nat chain=srcnat action=src-nat to-addresses=80.xxx.xxx.218 to-ports=0-65535 src-address=192.168.100.55
Looks good.
/ip firewal nat chain=dstnat action=dst-nat to-addresses=192.168.100.55 to-ports=80 dst-address=80.xxx.xxx.218 dst-port=80 protocol=tcp

If your router had two IPs (one for the server, one for everyone else); it's a slightly different story
 
milda
just joined
Topic Author
Posts: 4
Joined: Thu Nov 19, 2009 7:30 am

Re: dst-nat dont work, what is wrong ?

Thu Nov 19, 2009 10:07 pm

[quote="bobertperry"]I am new at this too and am probably wrong but it looks like you have things a little backwards and don't need some things.

Things happen in order, this needs to go below the src-nat(which you dont need).
/ip firewal nat chain=srcnat action=masquerade src-address=192.168.100.0/24 out-interface=Wan
You don't need this, its covered by what the masquerade does in what I understand your configuration to be.
/ip firewal nat chain=srcnat action=src-nat to-addresses=80.xxx.xxx.218 to-ports=0-65535 src-address=192.168.100.55
Looks good.
/ip firewal nat chain=dstnat action=dst-nat to-addresses=192.168.100.55 to-ports=80 dst-address=80.xxx.xxx.218 dst-port=80 protocol=tcp
------------------------
Thanks for your reply, Now www server works propertly !
but I have next problem - how can I set ftp port forward ? I try set port 21 like 80 but it seems be not the same thing ...
 
bobertperry
newbie
Posts: 44
Joined: Tue Jan 06, 2009 4:05 am

Re: dst-nat dont work, what is wrong ?

Fri Nov 20, 2009 2:35 am

Make sure you have port 20 and 21. Also no need for another rule, just separate each port with a comma.
ie:
/ip firewal nat chain=dstnat action=dst-nat to-addresses=192.168.100.55 to-ports=80 dst-address=80.xxx.xxx.218 dst-port=20,21,80 protocol=tcp
 
milda
just joined
Topic Author
Posts: 4
Joined: Thu Nov 19, 2009 7:30 am

Re: dst-nat dont work, what is wrong ?

Fri Nov 20, 2009 7:11 am

Make sure you have port 20 and 21. Also no need for another rule, just separate each port with a comma.
ie:
/ip firewal nat chain=dstnat action=dst-nat to-addresses=192.168.100.55 to-ports=80 dst-address=80.xxx.xxx.218 dst-port=20,21,80 protocol=tcp
It must be probably in separated rules , becaouse on action page of rule is not posible set ports 20,21,

is port 20 udp or tcp ?
 
fewi
Forum Guru
Forum Guru
Posts: 7717
Joined: Tue Aug 11, 2009 3:19 am

Re: dst-nat dont work, what is wrong ?

Fri Nov 20, 2009 7:19 am

TCP. And it will let you set comma separated lists of ports there.
 
milda
just joined
Topic Author
Posts: 4
Joined: Thu Nov 19, 2009 7:30 am

Re: dst-nat dont work, what is wrong ?

Fri Nov 20, 2009 8:24 am

TCP. And it will let you set comma separated lists of ports there.
I mean, that NO .
action=dst-nat to-addresses=192.168.100.55 to-ports=80
here is action to-ports only one port , how can I translate port 21 to 80 ?
I don't understand this
 
bobertperry
newbie
Posts: 44
Joined: Tue Jan 06, 2009 4:05 am

Re: dst-nat dont work, what is wrong ?

Fri Nov 20, 2009 8:46 am

Oh ya, my bad. If you do it in one rule everything would be forwarded to port 80. My bad.