I have No-IP domine subscription and I have static IP address I would like to run script on Mikrotik RB5009 v7.12 to update No-IP
with regards
/tool fetch url="https://dynupdate.no-ip.com/nic/update?myip=<YOUR_IP>&hostname=<YOUR_NO_IP_HOST>" user=<USERNAME> password=<PASSWORD>
# Data to be modified
:local noipuser "username"
:local noippass "MyStr0ngPassWoRd!"
:local noiphost "mydomain.sytes.net"
# From now on, do not modify
:local cIP [/ip cloud get public-address]
:if ([:resolve $noiphost] != $cIP) do={
# Important, has been replaced "?" with "\3F" to avoid problems.
/tool fetch url="http://$noipuser:$noippass@dynupdate.no-ip.com/nic/update\3Fhostname=$noiphost&myip=$cIP" keep-result=no
:log info "NO-IP: $noiphost -> IP updated: $cIP"
} else={
:log info "No-IP: No update needed. Current: $cIP"
}
This worked perfectly for me on RouterOS 7.x Thank you. This is so simple and exactly what I needed!Example of noip script without global variables (simpler).
Code: Select all# Data to be modified :local noipuser "username" :local noippass "MyStr0ngPassWoRd!" :local noiphost "mydomain.sytes.net" # From now on, do not modify :local cIP [/ip cloud get public-address] :if ([:resolve $noiphost] != $cIP) do={ # Important, has been replaced "?" with "\3F" to avoid problems. /tool fetch url="http://$noipuser:$noippass@dynupdate.no-ip.com/nic/update\3Fhostname=$noiphost&myip=$cIP" keep-result=no :log info "NO-IP: $noiphost -> IP updated: $cIP" } else={ :log info "No-IP: No update needed. Current: $cIP" }
Create a Scheduler task and run it a couple of times a day or every x time (according to your needs).
Username - user@mikrotik.com
Password - mikrotik
Hostname - mikrotik.ddns.net
user@mikrotik.com:mikrotik
dXNlckBtaWtyb3Rpay5jb206bWlrcm90aWs=
/tool fetch url="https://dynupdate.no-ip.com/nic/update?hostname=mikrotik.ddns.net" \
http-header-field="Authorization: Basic dXNlckBtaWtyb3Rpay5jb206bWlrcm90aWs=" \
keep-result=no