tournet 发表于 2009-12-16 11:30:02

ros 3.x changeip动态域名脚本,来自routeros官网

本帖最后由 tournet 于 2009-12-16 11:40 编辑

# Define User Variables
:global ddnsuser "你在changeip注册的用户名"
:global ddnspass "你在chageip注册的密码"
:global ddnshost "你在changeip注册的域名,如:xxx.changeip.org"

# Define Global Variables
:global ddnsip
:global ddnslastip
:if ([ :typeof $ddnslastip ] = nil ) do={ :global ddnslastip "0" }

:global ddnsinterface
:global ddnssystem ("mt-" . )

# Define Local Variables
:local int

# Loop thru interfaces and look for ones containing
# default gateways without routing-marks
:foreach int in= do={
:if ([:typeof ] != str ) do={
   :global ddnsinterface
}
}

# Grab the current IP address on that interface.
:global ddnsip [ /ip address get address ]

# Did we get an IP address to compare?
: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 ] key-name=$ddnsuser key=$ddnspass ] ]
    :global ddnslastip $ddnsip

} else={
    :log info "DDNS: No update required."
}

}

# End of script



ROS3.22,电信ADSL单线验证有效。
试了坛子上的好几个脚本,未成功,奇怪,然后搜索到ROS官网,发现2.X、3.X、4.X分别有不同的ddns示例,粘贴过来就行了。且这个脚本貌似有回流作用(待验证中……)?

tmd 发表于 2009-12-16 17:30:25

你是从那个官网下的?

47771885 发表于 2009-12-16 17:43:35

你是从那个官网下的?
tmd 发表于 2009-12-16 17:30 http://bbs.routerclub.com/images/common/back.gif


    官方当然是 M 咯 还能网大啊

tlze 发表于 2009-12-17 12:23:01

记号,收藏,有时用得着。

heguo2008 发表于 2010-2-19 00:33:47

记号,收藏,有时用得着

qq3475534 发表于 2010-5-11 02:44:16

有没927的脚本呀。贴个啊。我在官方没找到。
页: [1]
查看完整版本: ros 3.x changeip动态域名脚本,来自routeros官网