# Set needed variables
:global username "your-username"
:global password "your-password"
:global hostname "your-hostname"
:global wanInt "your-Interface"
:global noipForce
:global previousIP2
# print some debug info
#:log info ("DDNS: username = $username")
#:log info ("DDNS: password = $password")
:log info ("DDNS: hostname = $hostname")
:log info ("DDNS: previousIP = $previousIP2")
# Grab the current IP address on that interface.
:global ddnsip [/ip address get [/ip address find interface="$wanInt"] address]
:global currentIP [:pick $ddnsip 0 [:find $ddnsip "/"]]
#:log info ("DDNS: ddnsip = $ddnsip")
:log info ("DDNS: currentIP = $currentIP")
# Remove the # on next line to force an update every single time - useful for debugging, but you could end up getting blacklisted by No-IP!
#:set noipForce true
# Determine if no-ip update is needed
# more no-ip updater request details available at http://www.no-ip.com/integrate/request/
:if (($currentIP != $previousIP2) || ($noipForce = true)) do={
:set noipForce false
:set previousIP2 $currentIP
:log info ("DDNS: No-IP update needed")
:log info ("DDNS: Start of Fetch")
global tmp [/tool fetch mode=http port=80 address=dynupdate.no-ip.com host=dynupdate.no-ip.com src-path="/nic/update?hostname=$hostname&myip=$currentIP" user=$username password=$password dst-path="/noip2.txt"]
:log info ("DDNS: End of Fetch")
:global result [/file get noip2.txt contents]
:log info ("DDNS: No-IP Update Result: $result")
:put ("No-IP Update Result: $result")
# Update HE.net Tunnel
# :execute script=HE-NET
} else={
:log info ("DDNS: No No-IP update needed")
}
I’m trying to find/create script for updating ddns service no-ip.org from RB750 (OS 5.7). My Internet router doesn’t support ddns so I must do it with MT.
All scripts I can find involve getting real IP from my interface, but I need to get the current IP address from the internet (case of double-NAT).