DDNS正确的更新设置
:log info "DDNS: Begin":global ddns-user "用户名"
:global ddns-pass "密码"
:global ddns-host "用户名.changeip.net"
:global ddns-interface "pppoe拨号的interface我的是pppoe-out"
:global ddns-system ("mt-" . version] )
:global ddns-ip [ /ip address get 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" :hug: 3.0可以用吗????哈哈 支持 3.0 才是正道 不知道3.0的是否能用,高手们也不研究一下。 太阳,终于找到V3.0支持的DDNS代码了。
无意中找到的
复制以下部分:
:global ddnsuser "user"
:global ddnspass "password"
:global ddnshost "my.dyn.ip"
:global ddnsip
:global ddnslastip [:tostr [:resolve $ddnshost] ]
:if ([ :typeof $ddnslastip ] = nil ) do={ :global ddnslastip "0" }
:global ddnsinterface "pppoe-out1"
:global ddnssystem ("mt-" . )
:local int
:local ddnsipfn [ /ip address get address ]
:global ddnsip [:pick $ddnsipfn 0 [:find $ddnsipfn "/"]]
:if ([ :typeof $ddnsip ] = nil ) do={
:log info ("DDNS: No ip address present on " . $ddnsinterface . ", please check.")
} else={
:if ($ddnsip != $ddnslastip) do={
:log info "DDNS: Sending UPDATE!"
:log info [ :put ]
:global ddnslastip $ddnsip
} else={
:log info "DDNS: No update required."
}
}
复制以上部分就可以了。太阳一下专卖精子
[ 本帖最后由 redcom 于 2008-4-12 03:07 编辑 ]
页:
[1]