qdcv123 发表于 2010-5-16 02:16:53

4.6 ddns 脚本

:global ddnsuser "用户名"
:global ddnspass "密码"
:global ddnshost "域名"
:global ddnsinterface "pppoe-out1"
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# END OF USER DEFINED CONFIGURATION
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

:global ddnssystem ("mt-" . version] )
:global ddnsip [ /ip address get address ]
:global ddnslastip

:if ([:len ] = 0 ) do={ :log info "DDNS: No interface named $ddnsinterface, please check configuration." }

:if ([ :typeof $ddnslastip ] = "nothing" ) do={ :global ddnslastip 0.0.0.0/0 }

:if ([ :typeof $ddnsip ] = "nothing" ) 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 ] key-name=$ddnsuser key=$ddnspass ] ]
    :global ddnslastip $ddnsip

} else={

    :log info "DDNS: No changes necessary."

}

}

# END OF SCRIPT

kapook007 发表于 2010-5-16 03:09:19

4.6
script can be used if you have more than 1 WAN????

kekolike 发表于 2010-5-17 12:39:09

global ddnsinterface "pppoe-out1"

wugalang88 发表于 2010-5-17 15:41:42

顶一下

needback 发表于 2010-5-17 18:06:11

通用代码,不知道兼容性如何~~,嘿嘿....马克一下,待会儿来try~

xxxyyy888 发表于 2010-5-17 21:39:13

我顶一下

lgd325 发表于 2010-5-18 00:05:17

顶       顶

nostradamus 发表于 2010-5-25 01:10:59

不错不错

testdl 发表于 2010-5-25 08:45:34

.
.
RouterOS 动态更新IP到 ChangeIP.com
RouterOS 动态更新IP到 DynDNS

cpanda 发表于 2010-5-25 08:49:41

谢谢楼主分享

outstrip 发表于 2010-5-25 11:27:02

弄来试试看
页: [1]
查看完整版本: 4.6 ddns 脚本