:if ($currentIP != $previousIP) do={
:log info “No-IP: Current IP ($currentIP) is not equal to previous IP ($previousIP), update needed”
The update URL. Note the “\3F” is hex for question mark (?). Required since ? is a special character in commands.
:local url “> http://dynupdate.no-ip.com/nic/update\3Fmyip=$currentIP> "
:local noiphostarray
:set noiphostarray [:toarray $noiphost]
:foreach host in=$noiphostarray do={
:log info “No-IP: Sending update for $host”
/tool fetch url=($url . “&hostname=$host”) user=$noipuser password=$noippass mode=http dst-path=(“no-ip_ddns_update-” . $host . “.txt”)
:log info “No-IP: Host $host updated on No-IP with IP $currentIP”
/file print file=(“no-ip_ddns_previousip.txt”)
:delay 3
/file set contents=”$currentIP" (“no-ip_ddns_previousip.txt”)
}
} else={
:log info “No-IP: Previous IP $previousIP is equal to current IP, no update needed”
}
} else={
:log info “No-IP: $inetinterface is not currently running, so therefore will not update.”
}
error code that i am getting:
“No-IP: Current IP (x.x.x.x) is not equal to previous IP(), update needed” → that’s IP(blank)
“No-IP:Sending update for x.myftp.org”
no update at the site.
ran again, identical error, and it is still IP() → IP(blank).
username and password is correct. i can also see a file been created when click Files.
then i thought maybe i should manually put 1.1.1.1 in there and see how it works. no luck still.
then i triple checked user/pass are correct.
then i delete the host.txt file. and something interesting happened. it does not create this host txt file any more.
in case i messed it up somewhere, recopy your entire script and entered the variable again, no luck, it still doesn’t create the txt file.
i thought maybe reboot would help it. no luck, still not creating that file. free space is 76% so out of space isn’t the problem. and the script policy, all 8 are checked.
i was going to create another no-ip account to see maybe my acc is bad, but now it somehow doesn’t create that file…
any suggestion?
by the way i got confused, in this place it’s RB750, not RB2011 - i doubt that makes any diff though.
i manually created no-ip_ddns_previousip.txt and put 8.8.8.8 in it. now the log is no longer showing “previous IP ()”, but correctly showing “previous IP (8.8.8.”. however it still doesn’t update.
and in addition, when i ran again, the log is showing identical previous IP (8.8.8. - that is, it’s not writing to the file. but it has all the rights checked…
My scripts it just an update from that (I did not created it).
Check the right for the job too… it’s that job who write the file.
My script/schedule have : Read, Write, Test (owner ‘admin’)
Schedule run at each 5 minutes from the startup.
When you say the file say “nohost”, you are talking about the “no-ip_ddns_previousip.txt”, not the “no-ip_ddns_update-x.myftp.org.txt” ?
Also, on the log, the “CurrentIP” is good?
You did set the “WAN” interface in the script (mine is “ether1-gateway”) ?
actually, the txt file i saw was created by another ddns script. i mistaken it to be yours.
but when i manually created no-ip_ddns_previousip.txt, it then read from it, but does not write into it.
i guess it’s rights issue, so i made sure i gave it all the rights (reboot, write, test, sniff, read, policy, password, sensitive), no luck. the owner isn’t admin because i renamed it to some other name. but then i created user admin again, and re-login, made sure the script owner is admin (who’s group is “full”). but still does not write to the txt.
oh, i didn’t wait for the schedule, i clicked run script.
i got a few more mikrotik routers. it’s 2am here. as i am out of idea to try, tomorrow i’d try it on other mikrotik routers and see if same works on my other routers but just not this RB750.
interestingly, when i tried it on a different mikrotik router (this is RB751G with v6.6 on it), it worked. it creates two txt files and it updates to no-ip correctly.
then i tried it on a RB2011 with v6.7 on it. it worked too.
all three mikrotik routers are with about the same settings. definitely something must be causing it though. RB751G and RB2011 are with fixed ip, only this problematic RB750 is with dynamic ip. so, well, i know what i am going to be busy with this weekend
I’m using RB951G-2HnD with RouterOS 6.9 and 6.10. I tried to use above script but I cannot access my router from the Internet even no-ip was updated with the current Public IP Addresses I got from my ISP.
I was able to verify when I ask my friend to access my router via my no-ip host.
I temporarily disabled those firewall rules of mine. I just saw those set of rules upon searching on how to prevent the login attempts I’m seeing before. Those rules really prevented the login attempts via ssh and telnet though I’m not sureif it also affects why my no ip script is now working before, when those rules were still activated.
Does it have an effect why my no ip script is not working?
With this suggested firewall rule, do I still need to re-enable my firewall rules? Will it not affect my no-ip script and the firewall rule you’re suggesting?