Community discussions

MikroTik App
 
Derell
just joined
Topic Author
Posts: 17
Joined: Thu Sep 22, 2016 11:41 am

port forwarding

Thu Dec 01, 2016 4:00 pm

hi there guys
today im asking about port forwarding
so i just started to replace my router from tp link to mikrotik and i just realy confused
so tp link is so easy like u just type start port end port protocol and ur ip
but in mikrotik it was so diffrent or mayBE u guys can help :P thanks
 
erlinden
Forum Guru
Forum Guru
Posts: 2699
Joined: Wed Jun 12, 2013 1:59 pm
Location: Netherlands

Re: port forwarding

Thu Dec 01, 2016 10:36 pm

 
TyBermea
newbie
Posts: 29
Joined: Mon Nov 02, 2015 3:18 am
Contact:

Re: port forwarding

Fri Dec 02, 2016 4:41 am

Here is an example of destination NAT (port forwarding):
/ip firewall nat
add action=dst-nat chain=dstnat comment="Unifi Video" dst-port=7443,7446 protocol=tcp to-addresses=10.11.43.4
add action=dst-nat chain=dstnat comment="RDP" dst-port=3389 protocol=tcp to-addresses=10.11.43.254
 
Derell
just joined
Topic Author
Posts: 17
Joined: Thu Sep 22, 2016 11:41 am

Re: port forwarding

Fri Dec 02, 2016 11:24 am

none of them work
i make uttorent to listen to the port that i want but when i see in canyouseeme it still say couldnt see you ... on port 1337
 
User avatar
tslytsly
Frequent Visitor
Frequent Visitor
Posts: 65
Joined: Tue Oct 27, 2015 6:52 pm
Location: Nottingham
Contact:

Re: port forwarding

Fri Dec 02, 2016 11:49 am

Hi derell
Don't forget to add a filter rule to allow the traffic:
ip firewall filter add chain=forward connection-nat-state=dstnat action=accept comment="allow NAT'd traffic" disabled=no
hope that helps.
 
Derell
just joined
Topic Author
Posts: 17
Joined: Thu Sep 22, 2016 11:41 am

Re: port forwarding

Fri Dec 02, 2016 1:09 pm

yi already done that but sadly it gave me same result so i did i do something wrong so this is my rule
chain dst nat
dst port 1337
action dst nat
to port 1337
to addres my ip4 addres
 
User avatar
tslytsly
Frequent Visitor
Frequent Visitor
Posts: 65
Joined: Tue Oct 27, 2015 6:52 pm
Location: Nottingham
Contact:

Re: port forwarding

Fri Dec 02, 2016 1:20 pm

yi already done that but sadly it gave me same result so i did i do something wrong so this is my rule
chain dst nat
dst port 1337
action dst nat
to port 1337
to addres my ip4 addres
Hmm, can you please paste the output of:
ip firewall filter print
Make sure to delete or obscure any private data.
 
Derell
just joined
Topic Author
Posts: 17
Joined: Thu Sep 22, 2016 11:41 am

Re: port forwarding

Fri Dec 02, 2016 2:48 pm

how u can do that there no filter print
 
User avatar
tslytsly
Frequent Visitor
Frequent Visitor
Posts: 65
Joined: Tue Oct 27, 2015 6:52 pm
Location: Nottingham
Contact:

Re: port forwarding

Fri Dec 02, 2016 3:10 pm

If you are using winbox you can open a terminal and export bits of the config with the print command.

On the left side if Winbox, under Tools you should see New Terminal, click this.

in the terminal window that opens type:
ip firewall filter print
this will output something like this in the terminal window:
Flags: X - disabled, I - invalid, D - dynamic 
 3    ;;; default configuration
      chain=input action=accept protocol=icmp log=no log-prefix="" 

 4    ;;; default configuration
      chain=input action=accept connection-state=established log=no log-prefix="" 

 5    ;;; default configuration
      chain=input action=accept connection-state=related log=no log-prefix="" 
Using the mouse highlight and right-click, select copy.

You can now paste into the forum, although make sure to remove any sensitive info.
 
Derell
just joined
Topic Author
Posts: 17
Joined: Thu Sep 22, 2016 11:41 am

Re: port forwarding

Fri Dec 02, 2016 3:17 pm

Flags: X - disabled, I - invalid, D - dynamic
0 ;;; allow NAT'd traffic
chain=forward action=accept connection-nat-state=dstnat log=no
log-prefix=""
there u go hope u can help me
 
User avatar
tslytsly
Frequent Visitor
Frequent Visitor
Posts: 65
Joined: Tue Oct 27, 2015 6:52 pm
Location: Nottingham
Contact:

Re: port forwarding

Fri Dec 02, 2016 3:56 pm

Flags: X - disabled, I - invalid, D - dynamic
0 ;;; allow NAT'd traffic
chain=forward action=accept connection-nat-state=dstnat log=no
log-prefix=""
there u go hope u can help me
Hmm, that looks ok. And if it is the only rule then it would work anyway because ROS is default accept.

Can you do that same with:
ip firewall nat print
 
Derell
just joined
Topic Author
Posts: 17
Joined: Thu Sep 22, 2016 11:41 am

Re: port forwarding

Sun Dec 04, 2016 8:38 am

chain=dstnat action=dst-nat to-addresses=my ip4 to-ports=1334
protocol=tcp dst-port=1334 log=no log-prefix=""
and
chain=dstnat action=dst-nat to-addresses=my ip4 to-ports=1337
protocol=tcp dst-port=1337 log=no log-prefix=""
 
Derell
just joined
Topic Author
Posts: 17
Joined: Thu Sep 22, 2016 11:41 am

Re: port forwarding

Sun Dec 04, 2016 8:38 am

i tried port forwarding both of them none of them work
 
User avatar
tslytsly
Frequent Visitor
Frequent Visitor
Posts: 65
Joined: Tue Oct 27, 2015 6:52 pm
Location: Nottingham
Contact:

Re: port forwarding

Mon Dec 05, 2016 10:25 am

chain=dstnat action=dst-nat to-addresses=my ip4 to-ports=1334
protocol=tcp dst-port=1334 log=no log-prefix=""
and
chain=dstnat action=dst-nat to-addresses=my ip4 to-ports=1337
protocol=tcp dst-port=1337 log=no log-prefix=""

OK, make sure you specify which interface the traffic will arrive in, so in each rule either add the interface or the IP of the interface as the destination.

Otherwise those rules will match any traffic traversing the router on those ports.
 
Derell
just joined
Topic Author
Posts: 17
Joined: Thu Sep 22, 2016 11:41 am

Re: port forwarding

Thu Dec 08, 2016 1:16 am

So What i should do
In interface or out interface
And What should i pick
Thanks btw u help ke This far
 
User avatar
dgnevans
Member
Member
Posts: 469
Joined: Fri Mar 08, 2013 11:24 am
Location: Zimbabwe
Contact:

Re: port forwarding

Thu Dec 08, 2016 10:22 am

Destination address if you have a static IP from your ISP Or In Interface and choose your wan interface as the traffic is coming in on that interface.
 
User avatar
tslytsly
Frequent Visitor
Frequent Visitor
Posts: 65
Joined: Tue Oct 27, 2015 6:52 pm
Location: Nottingham
Contact:

Re: port forwarding

Thu Dec 08, 2016 10:27 am

This:
Destination address if you have a static IP from your ISP Or In Interface and choose your wan interface as the traffic is coming in on that interface.

If you are going to specify the interface you need to use
in-interface=
this is because you want to translate traffic arriving in your WAN interface.
 
Derell
just joined
Topic Author
Posts: 17
Joined: Thu Sep 22, 2016 11:41 am

Re: port forwarding

Thu Dec 08, 2016 4:57 pm

so if i just wanted to open the port
so that canyouseeme succses
what interface should i put thanks though :):):)