|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?注册
×
DDNS 第一次可以第二次就....
:log info "DDNS: Begin"
:global ddns-user "username"
:global ddns-pass "userpassword"
:global ddns-host "username.changeip.net"
:global ddns-interface "pppoe-out1"
: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"
是用这个脚本,第一次就可以登录二级域名,重起路由,就用不了(system Scheduler )5分钟运行一次. 可以PING但反顾 的IP是美国的. |
|