找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 5025|回复: 3

[脚本] ROS用的DDNS更新不了

[复制链接]
发表于 2014-3-12 00:11:23 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?注册

×
本人用的ros是5.25板本,有谁能知到问题在那呀!
:global ddnsuser "jxwxb"
:global ddnspass "xxxx"
:global ddnshost "xxx.changeip.net"
:global ddnsinterface "pppoe-out1"
:global ddnslastip

:global ddnsip [ /ip address get [/ip address find dynamic=yes inter ] address ]
: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 [ /tool dns-update name=$ddnshost address=[:pick $ddnsip 0 [:find $ddnsip "/"] ] key-name=$ddnsuser key=$ddnspass ]
    :global ddnslastip $ddnsip
} else={
    :log info "DDNS: No change"
}
}
:log info "DDNS: End“




下一个更新时间







"

routeros
 楼主| 发表于 2014-3-12 00:13:55 | 显示全部楼层
脚本执行时间
/system scheduler add name="changeDDNS" on-event="DDNS" interval=1200s

之后重起ROS后,更新不了公网IP了。还是上一次没重起时的IP,真想知到问题在那。。。。
routeros
回复

使用道具 举报

发表于 2014-3-12 08:54:29 | 显示全部楼层
自己在程序里加无限多“ :log info”,手工执行,看那一步出了问题。
没有调试信息,其它人很难帮上忙。
routeros
回复

使用道具 举报

发表于 2014-3-12 09:12:42 | 显示全部楼层
没有添加定时计划任务,执行定时执行。在system scheduler里面
routeros
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|Archiver|手机版|小黑屋|软路由 ( 渝ICP备15001194号-1|渝公网安备 50011602500124号 )

GMT+8, 2024-5-8 10:44 , Processed in 0.047331 second(s), 4 queries , Gzip On, Redis On.

Powered by Discuz! X3.5 Licensed

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表