ddns di mikrotik 2.9.x
Here is a 2.9 script we have whipped up. It has not been 100% fully tested, but is supported. Please test this out and if there are any problems please let us know. This script is for 2.9, not 2.8 as the previous script is.
Create this script as 'ddnsUpdate' and schedule it to run once each 1-5 minutes or so. Change the information on the first few lines to your specific details.
Code:
:log info "DDNS: Begin":global ddns-user "YOURUSERID"
:global ddns-pass "YOURPASSWORD"
:global ddns-host "*1"
:global ddns-interface "EXACTINTERFACENAME"
:global ddns-system ("mt-" . [/system package get [/system package find name=system] version] )
:global ddns-ip [ /ip address get [/ip address find interface=$ddns-interface] address ]
:if ([ :typeof $ddns-lastip ] = nil ) do={ :global ddns-lastip 0.0.0.0/0 }
:if ([ :typeof $ddns-ip ] = nil ) do={
:log info ("DDNS: No ip address present on " . $ddns-interface . ", please check.")
} else={
:if ($ddns-ip != $ddns-lastip) do={
:log info "DDNS: Sending UPDATE!"
:log info [ /tool dns-update name=$ddns-host address=[:pick $ddns-ip 0 [:find $ddns-ip "/"] ] key-name=$ddns-user key=$ddns-pass ]
:global ddns-lastip $ddns-ip
} else={
:log info "DDNS: No change"
}
}
:log info "DDNS: End"
------------------------------------------------------------------------
URL:
http://forum.mikrotik.com/viewtopic.php?f=9&t=34575
http://forum.mikrotik.com/viewtopic.php?t=3534