Page 1 of 1

How to make port forwarding for dynamic IPs?

Posted: Sun Mar 11, 2012 5:40 pm
by ulikroessin
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

Re: How to make port forwarding for dynamic IPs?

Posted: Fri Mar 16, 2012 11:25 am
by w4rh0und
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

Re: How to make port forwarding for dynamic IPs?

Posted: Sat Mar 17, 2012 3:22 am
by ulikroessin
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

Re: How to make port forwarding for dynamic IPs?

Posted: Tue Mar 20, 2012 10:28 am
by w4rh0und
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.

Re: How to make port forwarding for dynamic IPs?

Posted: Wed Mar 21, 2012 10:37 pm
by ulikroessin
Thank you for your help. I will do so.

Saludos