Community discussions

MikroTik App
 
User avatar
ulikroessin
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 55
Joined: Sat Jun 18, 2011 3:02 am
Location: Paraguay

How to make port forwarding for dynamic IPs?

Sun Mar 11, 2012 5:40 pm

Hello @ all,

I need to make a port forwarding for using an ip-cam. The problem is, that the user logs in with hotspot and not has a static IP. And at the other side I have a dynamic public IP.

How I have to make the rules in dnat for this case?

I read the wiki and some topics here, but every time they have rules with staic IPs.

PPPoE works at a RB 333 and the user connects with wlan-hotspot at a RB 435. The UM works at a RB 800. All used software is ROS 5.14.

Saludos

Uli
 
w4rh0und
Member Candidate
Member Candidate
Posts: 107
Joined: Fri Oct 16, 2009 10:58 pm

Re: How to make port forwarding for dynamic IPs?

Fri Mar 16, 2012 11:25 am

If i understand correctly what you want, then you don't need to dnat a certain ip you can do it on an interface:

Ex: for RDP where Ether1 is the internet connection port and 10.124.175.5 is the private ip you can change Ether1 with the name of your pppoe connection or what interface you have.

/ip firewall nat
add action=dst-nat chain=dstnat disabled=no dst-port=3389 in-interface=Ether1
protocol=tcp to-addresses=10.124.175.5 to-ports=3389
 
User avatar
ulikroessin
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 55
Joined: Sat Jun 18, 2011 3:02 am
Location: Paraguay

Re: How to make port forwarding for dynamic IPs?

Sat Mar 17, 2012 3:22 am

Hello w4rh0und,

thank you for your answer. Hmm, but I do not understand what you mean with
10.124.175.5 is the private ip
There are no static IPs. The user logs in by hotspot and may get another IP every time. May be I have to make a binding?

Regards

Uli
 
w4rh0und
Member Candidate
Member Candidate
Posts: 107
Joined: Fri Oct 16, 2009 10:58 pm

Re: How to make port forwarding for dynamic IPs?

Tue Mar 20, 2012 10:28 am

If the private ip that you get from the hotspot is different everytime, you might try to make a dhcp reservation for that ip, to bind it so you get the same private ip address everytime on that host based on mac addess.


From the mikrotik the command to make static is:

/ip dhcp-server lease make-static <lease number>

You need the private ip address to be static, you need an address to where to forward the port.
 
User avatar
ulikroessin
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 55
Joined: Sat Jun 18, 2011 3:02 am
Location: Paraguay

Re: How to make port forwarding for dynamic IPs?

Wed Mar 21, 2012 10:37 pm

Thank you for your help. I will do so.

Saludos

Who is online

Users browsing this forum: No registered users and 3 guests