先在 dhcp.biz 注册一个动态域名,并添加你的动态域名
###302
:global ddnsuser ("ddnsusername")
:global ddnspass ("ddnspasswd")
:global ddnshost ("a3.ddnsusername.dhcp.biz")
:global ddnslastip [:tostr [:resolve $ddnshost] ]
:global ddnsnewip1 [ /ip address get [/ip address find interface=CU ] address ] ##"CU" 这个CU说是外网ip那个接口名称是CU
:global ddnsnewip [:pick $ddnsnewip1 0 [:find $ddnsnewip1 "/"]]
:if ($ddnslastip != $ddnsnewip) do={
/tool dns-update name=$ddnshost address=$ddnsnewip key-name=$ddnsuser key=$ddnspass
:log info ("change ddns a3.ddnsusername.dhcp.biz IP:" . $ddnslastip . " to " . $ddnsnewip)
}
阅读(3565) | 评论(1) | 转发(0) |