Mikrotik RouterBoard ROS DDNS for 3322


1、在/System Script下添加如下脚本内容

:local ednsuser "用户名"
:local ednspass "密码"
:local ednshost "域名"
:local ednsinterface "pppoe-out1"
:local members "http://members.3322.org/dyndns/update?system=dyndns"
#:local members "http://members./nic/update?"
:local status
:local status [/interface get [/interface find name=$ednsinterface] running]
:if ($status!=false) do={
:local ednslastip [:resolve $ednshost]
:if ([ :typeof $ednslastip ] = nil ) do={ :local ednslastip "0" }
:local ednsiph [ /ip address get [/ip address find interface=$ednsinterface ] address ]
:local ednsip [:pick $ednsiph 0 [:find $ednsiph "/"]]
:local ednsstr "&hostname=$ednshost&myip=$ednsip"
:if ($ednslastip != $ednsip) do={/tool fetch url=($members . $ednsstr) mode=http user=$ednsuser password=$ednspass dst-path=$ednshost
:delay 2
:local result [/file get $ednshost contents]
:log info ($ednshost . " " .$result)
/file remove $ednshost ;
}
}

脚本名称命名为3322

2、在/System Scheduler下添加一个脚本定时,名称为3322,内容为3322,执行时间为10分钟(时间可自定义)

声明:It小小鸟 itxiaoniao.cn|版权所有,违者必究|如未注明,均为原创|本网站采用BY-NC-SA协议进行授权

转载:转载请注明原文链接 - Mikrotik RouterBoard ROS DDNS for 3322


Carpe Diem and Do what I like.