Community discussions

 
RFischer
newbie
Topic Author
Posts: 27
Joined: Tue Sep 19, 2006 10:18 pm
Location: Northern California

opendns with dynamic ip

Sat Aug 30, 2008 8:44 pm

I would like to have a script to update opendns.com with my router's dynamic ip. Has anyone tried (failed or not) to do this on the router? I know I could just run a updater on a computer on the lan, but I would really like to do it on the router. I am successfuly using the changeIP.com script to update a host name, and would like to add opendns update to that script since it is already figuring out if the ip address has changed and that an update is needed.

I don't have any idea how to relate OpenDNS URL to send updates and the DynDNS api information.
Even if that was understood, I am not sure if you can or how to say:

"https://updates.opendns.com/nic/update?hostname= something??" in a script.

link to opendns support about their API.
http://www.opendns.com/support/article/88

link to DNS update API from DynDNS which is what OpenDNS uses.
http://www.dyndns.com/developers/specs/syntax.html
 
changeip
Forum Guru
Forum Guru
Posts: 3803
Joined: Fri May 28, 2004 5:22 pm

Re: opendns with dynamic ip

Sun Aug 31, 2008 5:54 am

we are adding the ability to update opendns when we receive a ddns update. we already have this built into our windows client. we plan on getting that working on the mikrotik ddns update script (server side) shortly. There will be a place within your account on changeip.com that will let you setup the auxillary update to opendns.
Colo and Wholesale Bandwidth Available! Sales at SanDiegoBroadband dot com
 
RFischer
newbie
Topic Author
Posts: 27
Joined: Tue Sep 19, 2006 10:18 pm
Location: Northern California

Re: opendns with dynamic ip

Mon Sep 01, 2008 1:54 am

That is great. Thanks.

Does this mean also that it is not possible to do this in a script on the router directly? My guess is that the requirement for SSL support on the client side would keep anything fairly easy to do from happening. I envisioned some sort of "telnet port 443" kind of thing.
 
User avatar
hilton
Long time Member
Long time Member
Posts: 635
Joined: Thu Sep 07, 2006 5:12 pm
Location: Jozi (aka Johannesburg), South Africa

Re: opendns with dynamic ip

Mon Sep 01, 2008 12:45 pm

we are adding the ability to update opendns when we receive a ddns update. we already have this built into our windows client. we plan on getting that working on the mikrotik ddns update script (server side) shortly. There will be a place within your account on changeip.com that will let you setup the auxillary update to opendns.
Sam, this is brilliant news. I really look forward to this. If you need a beta tester, just shout.
Regards
Hilton
 
RFischer
newbie
Topic Author
Posts: 27
Joined: Tue Sep 19, 2006 10:18 pm
Location: Northern California

Re: opendns with dynamic ip

Mon Oct 13, 2008 5:07 pm

I am still wondering if there is any way to support this directly from Router OS.
I am also very interested in being able to accomplish this no mater how it is done.
ChangeIP support would be a great way. Any progress on that front?
 
changeip
Forum Guru
Forum Guru
Posts: 3803
Joined: Fri May 28, 2004 5:22 pm

Re: opendns with dynamic ip

Mon Oct 13, 2008 8:23 pm

nothing yet... once i file my taxes I will have more time :)
Colo and Wholesale Bandwidth Available! Sales at SanDiegoBroadband dot com
 
User avatar
superrouter
newbie
Posts: 44
Joined: Wed Feb 23, 2005 12:35 pm
Location: ZA

Re: opendns with dynamic ip

Fri Nov 28, 2008 10:23 am

Hi, Please let me know when you've done the opendns integration changeip , I use the changeip service and its awesome, gonna be even better with opendns support ! yay!
M1Kr0T1k Rocks ;)
 
khaloudy
Frequent Visitor
Frequent Visitor
Posts: 87
Joined: Mon Jun 29, 2009 6:12 am

Re: opendns with dynamic ip

Sat Jul 04, 2009 12:14 am

i have mikrotik 2.9.27
i want use this (((((schedule))))
to send to openDNS the Update for my daynmic Ip
itry this scripts in 5 mintes and not working

wget -O - -q --http-user=khaloudy --http-passwd=123456 https://updates.opendns.com/nic/update

and this

USER=khaloudy
PASS=123456
NETWORK_LABEL=home
/usr/bin/curl -k -m 60 -u $USER:$PASS https://updates.opendns.com/nic/update? ... WORK_LABEL > /dev/null

can u help me?
thank you
 
User avatar
hilton
Long time Member
Long time Member
Posts: 635
Joined: Thu Sep 07, 2006 5:12 pm
Location: Jozi (aka Johannesburg), South Africa

Re: opendns with dynamic ip

Sat Jul 04, 2009 12:25 am

i have mikrotik 2.9.27
First upgrade to an authentic version, then ask questions.
Regards
Hilton
 
khaloudy
Frequent Visitor
Frequent Visitor
Posts: 87
Joined: Mon Jun 29, 2009 6:12 am

Re: opendns with dynamic ip

Tue Jul 14, 2009 6:17 am

i upgrade my mikrotk
i am using now 3.22
how i can update opendns with dynamic ip
opendns.com say:
============================================
hxxps://username:password@updates.opendns.com/nic/update?hostname=network label
(replace xx with tt)

username = your username
password = your password
network label = your network label
-----------------------------------------------------------
i don't understand how?
plz help me
 
User avatar
Letni
Member
Member
Posts: 375
Joined: Tue Dec 05, 2006 5:16 am
Location: South Carolina

Re: opendns with dynamic ip

Tue Jul 14, 2009 2:25 pm

This can _not_ directly be done on RouterOS because the fetch command does not support HTTPS.

-Louis
 
khaloudy
Frequent Visitor
Frequent Visitor
Posts: 87
Joined: Mon Jun 29, 2009 6:12 am

Re: opendns with dynamic ip

Mon Jul 20, 2009 7:37 am

so
you want to say that foget
mikrotik will not work with OpenDNS?
i get mikrotik server for this only
to save my family
no other way to stop porno or adult cites?
if he will not help me
i am not needed too
most of arab user the same
best regards
 
elnagar_ali
newbie
Posts: 27
Joined: Mon Aug 28, 2006 3:14 am

Re: opendns with dynamic ip

Mon Oct 12, 2009 7:23 am

realy i need this script
 
changeip
Forum Guru
Forum Guru
Posts: 3803
Joined: Fri May 28, 2004 5:22 pm

Re: opendns with dynamic ip

Mon Oct 12, 2009 8:09 am

okay okay... i will try to make this a higher priority for us. We will relay an update to opendns upon an update to changeip.com ddns. however, i need to clear this with them first as they would start seeing a lot of updates coming from our single network. need to make sure its okay.
Colo and Wholesale Bandwidth Available! Sales at SanDiegoBroadband dot com
 
User avatar
hilton
Long time Member
Long time Member
Posts: 635
Joined: Thu Sep 07, 2006 5:12 pm
Location: Jozi (aka Johannesburg), South Africa

Re: opendns with dynamic ip

Mon Oct 12, 2009 10:29 pm

Brilliant, thanks Sam.
Regards
Hilton
 
User avatar
hilton
Long time Member
Long time Member
Posts: 635
Joined: Thu Sep 07, 2006 5:12 pm
Location: Jozi (aka Johannesburg), South Africa

Re: opendns with dynamic ip

Fri Oct 30, 2009 2:04 pm

okay okay... i will try to make this a higher priority for us. We will relay an update to opendns upon an update to changeip.com ddns. however, i need to clear this with them first as they would start seeing a lot of updates coming from our single network. need to make sure its okay.
Sam, any news on this? I see OpenDNS have launched their Enterprise content filter and I'd like to sell this service but I need routeros/changeip/opendns to all work together.

Cheers
Regards
Hilton
 
changeip
Forum Guru
Forum Guru
Posts: 3803
Joined: Fri May 28, 2004 5:22 pm

Re: opendns with dynamic ip

Fri Oct 30, 2009 6:39 pm

I am waiting on David from their to give me the okay to start proxying updates to them. They have a special server for me to use as if I used the public one it would get blocked because of the number of updates that will start hitting them.

Sam
Colo and Wholesale Bandwidth Available! Sales at SanDiegoBroadband dot com
 
xskid
just joined
Posts: 3
Joined: Sat Oct 31, 2009 1:25 pm

Re: opendns with dynamic ip

Sat Oct 31, 2009 6:09 pm

realy i need this script
I also need the option to schedule this:
https://myaccount:mypassword@updates.op ... me=network
 
cossil
just joined
Posts: 1
Joined: Sat Jan 09, 2010 3:40 am

Re: opendns with dynamic ip

Sat Jan 09, 2010 3:45 am

Sam, any news on this?
 
grescho
Frequent Visitor
Frequent Visitor
Posts: 57
Joined: Fri Apr 24, 2009 11:07 pm
Location: Murcia, Spain
Contact:

Re: opendns with dynamic ip

Thu Mar 25, 2010 7:54 pm

I am also following this thread with bated breath... any news? I don't know about others, but I would be happy to pay for this service.
 
User avatar
hilton
Long time Member
Long time Member
Posts: 635
Joined: Thu Sep 07, 2006 5:12 pm
Location: Jozi (aka Johannesburg), South Africa

Re: opendns with dynamic ip

Fri Mar 26, 2010 11:19 am

I've since discovered that their content filtering service isn't all that it's cracked up to be.

From my brief googling, there appears to be a distinct lack of cloud based web content filters out their with reasonable granular settings at a fair price.

For the moment, I'm just going to install DansGuardian.
Regards
Hilton
 
rsrinivashan
just joined
Posts: 3
Joined: Wed Mar 03, 2010 12:34 pm

how to assign dynamic address to mikrotik router

Thu May 06, 2010 4:20 pm

hi this is srinivashan

My ISP use following method for connect users to Internet:

my wan Ethernet interface of router connected to service provider with dhcp .

i just want to know that how to configure the wan interface to recive dynamic address.

please let me if any one know .and please let me know with the commands

thanks in Advance

thanks & regards
srinivashan
cnus01@gmail.com
Thanks & Regards
Srinivashan.R
 
User avatar
janisk
MikroTik Support
MikroTik Support
Posts: 6283
Joined: Tue Feb 14, 2006 9:46 am
Location: Riga, Latvia

Re: opendns with dynamic ip

Fri May 07, 2010 10:31 am

rsrinivashan, add dhcp-client on your wan interface to get dynamic address from your ISP
 
rsrinivashan
just joined
Posts: 3
Joined: Wed Mar 03, 2010 12:34 pm

Re: opendns with dynamic ip

Fri May 07, 2010 10:46 am

i got it janisk, thanks a lot for ur replay


thanks srinivashan
Thanks & Regards
Srinivashan.R
 
t3wera
newbie
Posts: 35
Joined: Mon Mar 02, 2009 2:39 am

Re: opendns with dynamic ip

Sat May 08, 2010 11:49 am

try this
# DNSoMatic automatic DNS updates
# User account info of DNSoMatic
:global maticuser "GmailAccount"
:global maticpass "PWD"
:global matichost ""
# No more changes need

:global previousIP

# Print values for debug
:log info "DNSoMatic: Updating dynamic IP on DNS for host $matichost"
:log info "DNSoMatic: User $maticuser y Pass $maticpass"
:log info "DNSoMatic: Last IP $previousIP"

# get the current IP address from the internet (in case of double-nat)
/tool fetch mode=http address="checkip.dyndns.org" src-path="/" dst-path="/dyndns.checkip.html"
:local result [/file get dyndns.checkip.html contents]

# parse the current IP result
:local resultLen [:len $result]
:local startLoc [:find $result ": " -1]
:set startLoc ($startLoc + 2)
:local endLoc [:find $result "</body>" -1]
:global currentIP [:pick $result $startLoc $endLoc]
:log info "DNSoMatic: IP actual $currentIP"

# Touching the string passed to fetch command on "src-path" option
:local str "/nic/update?hostname=$matichost&myip=$currentIP&wildcard=NOCHG&mx=NOCHG&backmx=NOCHG"

:if ($currentIP != $previousIP) do={
:log info "DNSoMatic: Update need"
:set previousIP $currentIP
:log info "DNSoMatic: Sending update $currentIP"
:log info [ :put [/tool fetch host=MT user=$maticuser password=$maticpass mode=http address="updates.dnsomatic.com" src-path=$str dst-path=$matichost]]
:log info "DNSoMatic: Host $matichost updated on DNSoMatic with IP $currentIP"
}  else={
:log info "DNSoMatic: Previous IP $previousIP and current $currentIP equal, no update need"
}

but u must go https://www.dnsomatic.com/account/ and put ur open info
Last edited by t3wera on Sat Jul 13, 2013 4:29 pm, edited 1 time in total.
 
ibeeby
newbie
Posts: 45
Joined: Tue Dec 12, 2006 8:49 am
Location: Matlock, England
Contact:

Re: opendns with dynamic ip

Tue Jun 01, 2010 12:21 am

The above script did most but not all of the work needed - the :global previousIP was not retained by 4.9 so I put in some additional code, using the same variables as the similar section to parse the result gathered from the web.

This script _does_ work for me using 4.9 - the remaining issue is that OpenDNS takes several minutes to update, during which time the script, if repeated at, say, 120s intervals, will try several times to update.

Anyone know how to put in a delay in a script - ideally the script will run every, say, 60s but then wait before completing after an update attempt for, say, 5 minutes to allow the updates to propagate...

# DNSoMatic Account Information
:global maticuser "<username>"
:global maticpass "password"
:global matichost "hostname"
# End of Account Information

:global previousIP

# Recover previous IP address from file
:local result [/file get $matichost contents]
:local resultLen [:len $result]
:local startLoc [:find $result "d " -1]
:set startLoc ($startLoc + 2)
:set previousIP [:pick $result $startLoc $resultLen]

# Print values for debug
:log info "DNSoMatic: Updating dynamic ip on DNS for $matichost"
# :log info "DNSoMatic: User: $maticuser ; Password: $maticpass"
:log info "DNSoMatic: Last ip address: $previousIP"

# Get the current ip address from the internet (in case of double-NAT)
/tool fetch mode=http address="checkip.dyndns.org" src-path="/" dst-path="/dyndns.checkip.html"
:local result [/file get dyndns.checkip.html contents]

# Parse the current ip results
:local resultLen [:len $result]
:local startLoc [:find $result ": " -1]
:set startLoc ($startLoc + 2)
:local endLoc [:find $result "</body>" -1]
:global currentIP [:pick $result $startLoc $endLoc]
:log info "DNSoMatic: IP actual $currentIP"

# Touching the string passed to fetch command on "src-path" option
:local str "/nic/update?hostname=$matichost&myip=$currentIP&wildcard=NOCHG&mx=NOCHG&backmx=NOCHG"

:if ($currentIP != $previousIP) do={
:log info "DNSoMatic: Update needed"
:set previousIP $currentIP
:log info "DNSoMatic: Sending update to $currentIP"
:log info [ :put [/tool fetch host=MT user=$maticuser password=$maticpass mode=http address="updates.dnsomatic.com" src-path=$str dst-path=$matichost]]
:log info "DNSoMatic: Host $matichost updated on DNSoMatic with IP $currentIP"
} else={
:log info "DNSoMatic: Previous IP $previousIP and current IP $currentIP are equal: No update needed"
}

All I have done is to fix this - credit due to the original author, 't3wera', for getting it off the ground...

Ian
 
User avatar
janisk
MikroTik Support
MikroTik Support
Posts: 6283
Joined: Tue Feb 14, 2006 9:46 am
Location: Riga, Latvia

Re: opendns with dynamic ip

Tue Jun 01, 2010 9:37 am

delay in script:
:delay <delay-time> -- time interval (default 1 second)
 
ibeeby
newbie
Posts: 45
Joined: Tue Dec 12, 2006 8:49 am
Location: Matlock, England
Contact:

Re: opendns with dynamic ip

Tue Jun 01, 2010 10:30 am

Ah yes - thanks janisk - I've added the line:

:delay 300s

before the line:

} else={

which _should_ delay termination of the script for 5 minutes - BUT it does not prevent the scheduler from ploughing ahead with the next execution after 2 minutes. However, on a quick test, this does seem to have worked as on the first occasion when the ip changed, the script ran and 2 minutes later it ran again reporting no changes needed - or maybe this is just because the DNS servers are less busy in the European morning...

Not fully conclusive.

The reason for trying to execute the script frequently is that in this case OpenDNS is being used to restrict user activity (no porn etc) and if the ip address changes then there will be a window when the OpenDNS settings will not apply until the addresses are re-synchronised. The internet connection is by way of a 3G link and so it has been found that on some days the ip address does change several times.

If this were a relatively stable xDSL connection, I'd be less bothered and perhaps just execute the script every five minutes...

Thoughts?
 
zero
just joined
Posts: 18
Joined: Fri Nov 20, 2009 9:37 pm

Re: opendns with dynamic ip

Thu Jul 01, 2010 2:35 pm

hi, im looking for a script to update my local ip table

i have local and international internet split by two ethernet ports
i have the local ip table, but need script to update it if there is new ip's

below is example of table:

/ip route remove [/ip route find gateway="adslLOCAL" static=yes]
/ip route add dst-address=41.0.0.0/11 gateway=adsllan1
/ip route add dst-address=41.75.224.0/20 gateway=adsllan1
/ip route add dst-address=41.77.232.0/21 gateway=adsllan1
/ip route add dst-address=41.78.4.0/22 gateway=adsllan1
/ip route add dst-address=41.79.240.0/22 gateway=adsllan1
/ip route add dst-address=41.112.0.0/12 gateway=adsllan1
/ip route add dst-address=41.138.64.0/21 gateway=adsllan1
/ip route add dst-address=41.144.0.0/13 gateway=adsllan1
/ip route add dst-address=41.154.0.0/16 gateway=adsllan1
/ip route add dst-address=41.156.0.0/15 gateway=adsllan1
/ip route add dst-address=41.160.0.0/12 gateway=adsllan1
/ip route add dst-address=41.177.0.0/16 gateway=adsllan1
/ip route add dst-address=41.180.0.0/15 gateway=adsllan1
/ip route add dst-address=41.183.0.0/16 gateway=adsllan1
/ip route add dst-address=41.185.0.0/16 gateway=adsllan1
/ip route add dst-address=41.188.192.0/18 gateway=adsllan1
/ip route add dst-address=41.189.64.0/19 gateway=adsllan1
/ip route add dst-address=41.191.88.0/22 gateway=adsllan1
/ip route add dst-address=41.191.128.0/18 gateway=adsllan1
/ip route add dst-address=41.192.0.0/14 gateway=adsllan1
/ip route add dst-address=41.198.0.0/16 gateway=adsllan1
/ip route add dst-address=41.202.32.0/19 gateway=adsllan1
/ip route add dst-address=41.203.0.0/18 gateway=adsllan1
 
User avatar
janisk
MikroTik Support
MikroTik Support
Posts: 6283
Joined: Tue Feb 14, 2006 9:46 am
Location: Riga, Latvia

Re: opendns with dynamic ip

Mon Jul 05, 2010 10:13 am

if address-list is not expanding every fast, you can add new entries and afterwards, check for duplicates. I would do the following:

*add addresses to the list, even if i make duplicates
*once in a while read whole list using API, that could be done even from several hosts
*compile list that does not contain duplicates and refresh the list on routers
 
User avatar
hilton
Long time Member
Long time Member
Posts: 635
Joined: Thu Sep 07, 2006 5:12 pm
Location: Jozi (aka Johannesburg), South Africa

Re: opendns with dynamic ip

Mon Jul 05, 2010 11:03 am

I think the bigger problem comes in where you need to REMOVE stale addresses from the list.

What else can one do bar removing the entire list and recreating?
Regards
Hilton

Who is online

Users browsing this forum: No registered users and 16 guests