找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
广告投放联系QQ68610888
查看: 2731|回复: 5

[Router OS] DynDNS更新脚本

[复制链接]
发表于 2022-8-2 00:40 | 显示全部楼层 |阅读模式
本帖最后由 mantouboji 于 2024-3-2 13:40 编辑

可以挂在pppoe profile的On Up后面,拨号后同时更行dynv6.net、duckdns.org、ipv64.net 上的动态域名。

同时更新IPv4和IPv6地址。

你可以按照自己的需要去掉你不需要的动态域名供应商语句。

按照你自己的情况修改脚本里面几个大写字母的参数哦。



  1. :local theinterface "pppoe-out1"

  2. #dynv6
  3. :local token YOUR_DYNV6_TOKEN
  4. :local ddnshost YOUR_DYNV6_HOSTNAME

  5. #duckdns
  6. :local ducktoken YOUR_DUCKDNS_TOKEN
  7. :local duckhost  YOUR_DUCKDNS_HOSTNAME

  8. #ipv64
  9. :local ipv64token YOUR_IPV64_TOKEN
  10. :local ipv64host  YOUR_IPV64_HOSTNAME

  11. # IPv4
  12. :local test [ /ip address get [/ip address find interface=$theinterface ] address ]
  13. :local ipv4 [ :pick $test 0 [find $test "/"]]

  14. #IPv6
  15. :set   test [/ipv6/address get [:pick [find global interface=$theinterface ] 0 ] address]
  16. :local ipv6 [:pick $test 0 [:find $test "/"]]

  17. :if ( ([ :typeof $ipv6 ] = nil ) \
  18.     || ( $ipv6 = "::1" ) \
  19.    ) do={
  20.    :log info ("DynDNS: IPv6 no change or No ip address on $theinterface .")

  21. } else={

  22.    #ipv64.net
  23.    :local str1 "key=$ipv64token&host=$ipv64host&ip=$ipv4&ip6=$ipv6"
  24.    :local t2 ([/tool/fetch url="https://ipv64.net/nic/update?$str1" as-value output=user]->"data")

  25.    #ducknds
  26.    :set   str1 "domains=$duckhost&token=$ducktoken&ip=$ipv4&ipv6=$ipv6"
  27.    :local t3 ([/tool fetch url="https://www.duckdns.org/update?$str1" as-value output=user]->"data")

  28.    #dynv6.net
  29.    :set   str1 "zone=$ddnshost&ipv4=$ipv4&ipv6=$ipv6&token=$token"
  30.    :local t1 ([/tool fetch url="https://dynv6.com/api/update?$str1" as-value output=user]->"data")

  31.    :local logstr  "DynDNS: IP updated to $ipv4 and $ipv6!, dynv6: $t1, ipv64: $t2, duckdns: $t3"
  32.    :log info $logstr
  33. }

复制代码

我的恩山、我的无线 The best wifi forum is right here.
发表于 2022-8-8 23:58 来自手机 | 显示全部楼层
啥个用法?
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2022-8-14 15:32 | 显示全部楼层
兄弟,出个图文教程呗

点评

楼主,请教一下!您这个代码不限定动态域名对应提供的运营商吧?我用的是阿里云的IP6v动态域名解析  详情 回复 发表于 2022-10-9 09:30
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2022-10-9 09:30 | 显示全部楼层
Masterchen666 发表于 2022-8-14 15:32
兄弟,出个图文教程呗

楼主,请教一下!您这个代码不限定动态域名对应提供的运营商吧?我用的是阿里云的IP6v动态域名解析

点评

警告过你了,不要用任何中国人厂商提供的这种服务。 每个动态域名供应商对应的更新方式都是不一样的,具体可以看到ddclient里各种乱七八糟的实现。我的帖子只是dyn.com这一家的。 阿里云是什么东西我不知道,  详情 回复 发表于 2022-11-7 14:47
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

 楼主| 发表于 2022-11-7 14:47 | 显示全部楼层
y8y8y8 发表于 2022-10-9 09:30
楼主,请教一下!您这个代码不限定动态域名对应提供的运营商吧?我用的是阿里云的IP6v动态域名解析

警告过你了,不要用任何中国人厂商提供的这种服务。

每个动态域名供应商对应的更新方式都是不一样的,具体可以看到ddclient里各种乱七八糟的实现。我的帖子只是dyn.com这一家的。

阿里云是什么东西我不知道,也不想知道。
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2024-3-2 07:34 | 显示全部楼层
啥都没有啊 是手机不显示吗?
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

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

本版积分规则

有疑问请添加管理员QQ86788181|手机版|小黑屋|Archiver|恩山无线论坛(常州市恩山计算机开发有限公司版权所有) ( 苏ICP备05084872号 )

GMT+8, 2024-4-19 02:41

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

| 江苏省互联网有害信息举报中心 举报信箱:js12377 | @jischina.com.cn 举报电话:025-88802724 本站不良内容举报信箱:68610888@qq.com 举报电话:0519-86695797

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