找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 5934|回复: 6

[脚本] 求ROS 3.30 DDNS更新脚本?

[复制链接]
发表于 2011-2-22 22:45:31 | 显示全部楼层 |阅读模式

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

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

×
ros 3.30 DDNS更新脚本?要能用的,网上查了好多都更新不了,可能是设置问题也可能是脚本问题,请高人指点
routeros
发表于 2011-2-22 23:08:46 | 显示全部楼层
吧你的拿出来看看不就知道了
routeros
回复

使用道具 举报

发表于 2011-2-23 12:41:32 | 显示全部楼层
据说是官方的,全自动更新。肌肉男发的
不需要设置端口。
只是会有LOG输出,刷log。感觉不爽自己把log行删除

  1. :global ddnsuser "用户名"
  2. :global ddnspass "密码"
  3. :global ddnshost "域名"
  4. :global ddnsip
  5. :global ddnslastip
  6. :if ([ :typeof $ddnslastip ] = nil ) do={ :global ddnslastip "0" }
  7. :global ddnsinterface
  8. :global ddnssystem ("mt-" . [/system package get system version] )
  9. :local int
  10. :foreach int in=[/ip route find dst-address=0.0.0.0/0 active=yes ] do={
  11.   :if ([:typeof [/ip route get $int routing-mark ]] != str ) do={
  12.      :global ddnsinterface [/ip route get $int interface]
  13.   }
  14. }
  15. :global ddnsip [ /ip address get [/ip address find interface=$ddnsinterface ] address ]
  16. :if ([ :typeof $ddnsip ] = nil ) do={
  17.    :log info ("DDNS: No ip address present on " . $ddnsinterface . ", please check.")
  18. } else={
  19.   :if ($ddnsip != $ddnslastip) do={
  20.     :log info "\BF\AA\CA\BC\B8\FC\D0\C2\D4\B6\B3\CC\D3\F2\C3\FB"
  21.     :log info [ :put [/tool dns-update name=$ddnshost address=[:pick $ddnsip 0 [:find $ddnsip "/"] ] key-name=$ddnsuser key=$ddnspass ] ]
  22.     :global ddnslastip $ddnsip
  23.   } else={
  24.     :log info "ip\B5\D8\D6\B7\CE\DE\B1\E4\BB\AF,\D3\F2\C3\FB\B2\BB\D3\C3\B8\FC\D0\C2"
  25.   }
  26. }
  27. #end
复制代码

评分

参与人数 1铜板 +20 收起 理由
YAWPYNG + 20

查看全部评分

routeros
回复

使用道具 举报

发表于 2011-2-23 14:46:37 | 显示全部楼层
我记得我很久以前发过你找下吧
routeros
回复

使用道具 举报

 楼主| 发表于 2011-2-23 15:32:25 | 显示全部楼层
多谢了各位
routeros
回复

使用道具 举报

发表于 2011-2-24 02:58:33 | 显示全部楼层
菜鸟用最简单的那个mini版本,就一行,所有版本通用
routeros
回复

使用道具 举报

 楼主| 发表于 2012-3-4 17:53:04 | 显示全部楼层
感谢taijiang 他的脚本可用
多谢
routeros
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-6-2 10:34 , Processed in 0.065274 second(s), 5 queries , Gzip On, Redis On.

Powered by Discuz! X3.5 Licensed

© 2001-2023 Discuz! Team.

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