Community discussions

MUM Europe 2020
 
Heinrich
just joined
Topic Author
Posts: 3
Joined: Tue Aug 01, 2006 1:50 pm

Need Script !

Thu Oct 05, 2006 5:39 pm

Hi,

I need a script that updates my ip address on my mikrotik !

Im running a EoIP tunnel between 2 routerboards and have problem with dynamic ip so I need a script that updates my ip on both sides of the tunnel.
 
User avatar
savagedavid
Trainer
Trainer
Posts: 310
Joined: Thu Aug 25, 2005 12:58 pm
Location: Cape Town, South Africa
Contact:

Fri Oct 06, 2006 1:13 am

I am not understanding your question - please rephrase
 
User avatar
normis
MikroTik Support
MikroTik Support
Posts: 24417
Joined: Fri May 28, 2004 11:04 am
Location: Riga, Latvia

Fri Oct 06, 2006 9:14 am

i think his ISP gives him a dynamic IP, and he needs a script that will change his EoIP configuration when the IP changes. He has two routers connected over EoIP
 
User avatar
savagedavid
Trainer
Trainer
Posts: 310
Joined: Thu Aug 25, 2005 12:58 pm
Location: Cape Town, South Africa
Contact:

Fri Oct 06, 2006 11:56 am

If that is the understanding then he will need a changeip.com account to dynamically track the changing IP address. Then he could use a script with a simple resolve statement to get the current IP of each side and use that to populatethe EOIP tunnel parameters.
 
abyss
Frequent Visitor
Frequent Visitor
Posts: 74
Joined: Wed Sep 21, 2005 10:51 am

Dynamic IP's

Fri Oct 06, 2006 3:31 pm

Hi Normunds,

I use this topic to ask you a simple question... Is mikrotik planning to use dynamic DNS resolution ?
Because actually I've srcipted most of my routers to run dynamically...

For IPSEC I resolve the "proposal name field" to have dynamic policies and for peers, I've put the DNS in the beginning of the secret key (vd.wifx.net/adsf72345°§45blabla) :roll:
For EOIP and PPTP I perform a DNS resolution on the interface name:
# Mise à jour des IP Dynamiques des tunnels EOIP
:foreach i in=[/interface find type=eoip-tunnel] do={
:if ([/interface eoip get $i remote-address] = [:resolve [/interface eoip get $i name]]) do={:put false} else={/interface eoip set $i remote-address=[:resolve [/interface eoip get $i name]]}
}
Image

Is there another solution ?
Thanks,
Julien
 
Heinrich
just joined
Topic Author
Posts: 3
Joined: Tue Aug 01, 2006 1:50 pm

Fri Oct 06, 2006 4:52 pm

Hi abyss, Im looking for a script for the mikrotik that as same faunctionality as the one you pasted !!

Anyone help ???

Thanks
 
cmit
Forum Guru
Forum Guru
Posts: 1552
Joined: Fri May 28, 2004 12:49 pm
Location: Germany

Fri Oct 06, 2006 5:01 pm

I think the script he posted does what you want - right?
In his case he put the (Dyn)DNS name of the remote end as "name" parameter in the EoIP interface.
The script checks if the ip address has changed and - if yes - reconfigures the EoIP tunnel.

Now the only thing left is to run this script regularly via the system scheduler.

Best regards,
Christian Meis
 
abyss
Frequent Visitor
Frequent Visitor
Posts: 74
Joined: Wed Sep 21, 2005 10:51 am

Fri Oct 06, 2006 7:53 pm

So Heinrich, paste the code in the source of a script, it's fully functionnal, you just need to name your EOIP interface (Name) with the dns name, like "blabla.wifx.net", and if you have EOIP tunnels that don't have a DNS, just name it with the IP address directly... :shock:
 
changeip
Forum Guru
Forum Guru
Posts: 3804
Joined: Fri May 28, 2004 5:22 pm

Fri Oct 06, 2006 8:49 pm

Our dynamic dns is great for this. It would be even better to have MT be able to use DNS hostnames for endpoints ... just simply resolve them each time they are dialed. This way if a tunnel drops because of an IP change the next retry causes a dns resolve and uses the correct IP automatically. A script is an excellent workaround - but would be a great enhancement to 3.0 to use dns or ips in those fields.

Sam

Who is online

Users browsing this forum: Chiara and 22 guests