Worked on Mikrotik OS ver. 7.13.3 behind NATUpdated the script. Tested on 7.1beta6:Code:#Dynamic DNS Update Script for No-IP DNS behind NAT# Set needed variables No-ip:local username "YOUR USERNAME":local password "YOUR PASSWORD":local host "YOUR HOSTNAME"# Get Previous IP:local previousIP [/put [:resolve $host]]# Get Current IP using MikroTik IP Cloud feature/ip cloud force-update:delay 5:local currentIP [/ip cloud get public-address]# Logging IPs:log info "No-IP: Previous IP = $previousIP":log info "No-IP: Current IP = $currentIP"#compare IPs and update host if needed:if ($currentIP != $previousIP) do={:log info "No-IP: Current IP ($currentIP) is not equal to previous IP ($previousIP), update needed"#current IP overrides previous:local url "https://dynupdate.no-ip.com/nic/update/?hostname=$host":log info "No-IP: Sending update for $host"#sending infos which are required in the no-ip API via https/tool fetch url=$url http-method=post user=$username password=$password mode=https keep-result=no http-data="{\"myip\"=\"$currentIP\"}":log info "No-IP: Host $host updated on No-IP with IP $currentIP"} else={:log info "No-IP: update not needed "}# end
Statistics: Posted by parsaaalm — Sun Jan 28, 2024 3:41 am