Community discussions

MikroTik App
 
User avatar
azurtem
Trainer
Trainer
Topic Author
Posts: 224
Joined: Mon May 16, 2011 5:35 pm
Location: Nice, France
Contact:

Determining public IP

Wed Jul 16, 2014 9:32 pm

Hi

I have two Internet links plugged into my CCR1009
One is declared as a default route, while the other is
the default route for a specific set of route mangled
traffic.

Up till now the following script sufficed to update the
current public IP address:
http://wiki.mikrotik.com/wiki/Dynamic_D ... for_dynDNS

Does anyone know how I could modify it so as to have
it use a different route to reach the checkIP link ? Without
of course disrupting the current (active) default route ?

Thanks
yann
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 12001
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: Determining public IP

Wed Jul 16, 2014 10:56 pm

You like fast response and giving solution?

Using this:
http://forum.mikrotik.com/viewtopic.php ... 68#p436788

You can do that:

set myip.dnsomatic.com to be reachable on route 2,

run this each reasonable time:
/tool fetch mode=http keep-result=yes url="http://myip.dnsomatic.com/index.html" dst-path="CURRip";
/delay delay-time=2s;
:global CURRip value=[:toip [/file get "CURRip" value-name=contents]];
/delay delay-time=2s;
/file remove "CURRip";
on global CURRip variable is present the IP value you want...
 
User avatar
azurtem
Trainer
Trainer
Topic Author
Posts: 224
Joined: Mon May 16, 2011 5:35 pm
Location: Nice, France
Contact:

Re: Determining public IP

Mon Jul 21, 2014 9:42 pm

Thanks Rextended
 
thiagomedeiros
just joined
Posts: 24
Joined: Tue Apr 03, 2012 10:38 pm

Re: Determining public IP

Sun Jul 31, 2016 9:44 pm

You like fast response and giving solution?

Using this:
http://forum.mikrotik.com/viewtopic.php ... 68#p436788

You can do that:

set myip.dnsomatic.com to be reachable on route 2,

run this each reasonable time:
/tool fetch mode=http keep-result=yes url="http://myip.dnsomatic.com/index.html" dst-path="CURRip";
/delay delay-time=2s;
:global CURRip value=[:toip [/file get "CURRip" value-name=contents]];
/delay delay-time=2s;
/file remove "CURRip";
on global CURRip variable is present the IP value you want...
You don't need to fetch a file, use this:
:global CURRip [:resolve myip.opendns.com server=208.67.222.222];

Who is online

Users browsing this forum: No registered users and 22 guests