Community discussions

MikroTik App
 
User avatar
Caci99
Forum Guru
Forum Guru
Topic Author
Posts: 1075
Joined: Wed Feb 21, 2007 2:26 pm
Location: Tirane
Contact:

How to nat local dynamic IP addresses

Thu Sep 04, 2008 9:41 pm

Is there any way to forward ports into local dynamic IP-s?
for example, how to forward port 8291 to a routerboard
which gets dynamic ip address from PPPoE?
further more, how to make routes to dynamic IP-s?

/ip firewall nat
add chain=dst-nat dst-address=80.70.xx.xx protocol=tcp port=8291 action=dst-nat \
to-addresses= (dynamic IP Address)
/ip route
add dst-address=192.168.1.0/24 gateway=(dynamic IP address)

Thank you, Toni
 
egt520
just joined
Posts: 12
Joined: Fri Jul 25, 2008 6:16 am

Re: How to nat local dynamic IP addresses

Fri Sep 05, 2008 4:02 am

not ideal for dynamic IP. i also found this question, until now still haven't get it! -.-|

here have very professor person can help u...
 
User avatar
Muhammad
Member Candidate
Member Candidate
Posts: 141
Joined: Wed Aug 20, 2008 9:15 pm
Location: Pakistan

Re: How to nat local dynamic IP addresses

Fri Sep 05, 2008 10:17 am

AOA
i think is not possible
 
User avatar
butche
Trainer
Trainer
Posts: 428
Joined: Fri May 28, 2004 6:14 pm
Location: Missouri, USA
Contact:

Re: How to nat local dynamic IP addresses

Fri Sep 05, 2008 10:30 am

AOA
i think is not possible
au contraire...

You CAN do this, but it's not quite like was originally asked. Try this for an option:

On the CLIENT (the router you want to do NAT for) do this:
/interface bridge add name=loopbackiface
/ip address add interface=loopbackiface address=10.10.10.10/32
This will create a null bridge and add an IP to it
Then, on the server, set up the pppoe secret like:
/ppp secret add name=test password=testpw routes=10.10.10.10
Now, just do your NAT so that it points to the 10.10.10.10 address, with no need to manually add the route since ppp server will do it for you. :-)
 
User avatar
Muhammad
Member Candidate
Member Candidate
Posts: 141
Joined: Wed Aug 20, 2008 9:15 pm
Location: Pakistan

Re: How to nat local dynamic IP addresses

Fri Sep 05, 2008 9:32 pm

AOA
i think is not possible
au contraire...

You CAN do this, but it's not quite like was originally asked. Try this for an option:

On the CLIENT (the router you want to do NAT for) do this:
/interface bridge add name=loopbackiface
/ip address add interface=loopbackiface address=10.10.10.10/32
This will create a null bridge and add an IP to it
Then, on the server, set up the pppoe secret like:
/ppp secret add name=test password=testpw routes=10.10.10.10
Now, just do your NAT so that it points to the 10.10.10.10 address, with no need to manually add the route since ppp server will do it for you. :-)
AOA
butche
10.10.10.10 address is dynamic IP ?????
i think is manual!
Post subject: How to nat local dynamic IP addresses
 
User avatar
butche
Trainer
Trainer
Posts: 428
Joined: Fri May 28, 2004 6:14 pm
Location: Missouri, USA
Contact:

Re: How to nat local dynamic IP addresses

Fri Sep 05, 2008 10:09 pm

10.10.10.10 address is dynamic IP ?????
i think is manual!
You are correct in this statement, however, the "problem" is in how to create a NAT to a device that has a dynamic address., which the posted solution does. If you want, I can create for you a script that WILL create this NAT to an actual dynamic IP address, but THAT is not a "free" solution.
Post subject: How to nat local dynamic IP addresses
Read the post to see the original question. The question pertained to dynamic IP addresses, but the "problem" that needed to be solved is solved by my solution.
 
SurferTim
Forum Guru
Forum Guru
Posts: 4636
Joined: Mon Jan 07, 2008 10:31 pm
Location: Miramar Beach, Florida

Re: How to nat local dynamic IP addresses

Sat Sep 06, 2008 12:42 am

Hi Caci99

I am not sure how you have this set up. Is the challenge just the device needs dhcp rather than setting a static IP? If the device that provides the dhcp server service is a MikroTik box, you can make a dynamic lease a static lease. It is still dhcp, but It always gets the same IP. Then you can point stuff at it. I do this with network printers. Would that help?
 
User avatar
butche
Trainer
Trainer
Posts: 428
Joined: Fri May 28, 2004 6:14 pm
Location: Missouri, USA
Contact:

Re: How to nat local dynamic IP addresses

Sat Sep 06, 2008 12:55 am

I am not sure how you have this set up. Is the challenge just the device needs dhcp rather than setting a static IP? If the device that provides the dhcp server service is a MikroTik box, you can make a dynamic lease a static lease. It is still dhcp, but It always gets the same IP. Then you can point stuff at it. I do this with network printers. Would that help?
He (she?) said it's pppoe. Either way, the solution I posted is one I've used for various situations and it does work. Your solution works for the purpose you stated (printers, computers, etc). He could, also, set static IPs for the pppoe account, but if he wants to keep it dynamic, then my solution works.
 
User avatar
Muhammad
Member Candidate
Member Candidate
Posts: 141
Joined: Wed Aug 20, 2008 9:15 pm
Location: Pakistan

Re: How to nat local dynamic IP addresses

Sat Sep 06, 2008 1:45 am

AOA
butche u r right
good idea
 
egt520
just joined
Posts: 12
Joined: Fri Jul 25, 2008 6:16 am

Re: How to nat local dynamic IP addresses

Mon Sep 08, 2008 4:36 am

not working for this command?

/ip address add interface=loopbackiface address=10.10.10.10/32
 
User avatar
butche
Trainer
Trainer
Posts: 428
Joined: Fri May 28, 2004 6:14 pm
Location: Missouri, USA
Contact:

Re: How to nat local dynamic IP addresses

Mon Sep 08, 2008 4:59 am

You have to create the bridge named "loopbackiface" first.

Who is online

Users browsing this forum: Bing [Bot], GoogleOther [Bot], JDF, Kanzler and 184 guests