dynamic dns update with mikrotik

ето го и скрипта за changeip.com ,който ползвам на един от    рутерите -2.9.27

:log info “DDNS: Begin”

:global ddns-user “user”
:global ddns-pass “pass”
:global ddns-host “*2”
:global ddns-interface “int”

:global ddns-ip [ /ip address get [/ip address find interface=$ddns-interface] address ]

:if ([ :typeof $ddns-lastip ] = nil ) do={ :global ddns-lastip }

: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”

съответно юзер,пас и интерфейс замествате с вашите

Leave a Reply

Your email address will not be published. Required fields are marked *