首页
登录 | 注册

mikrotik ros设置3322的ddns


  1. :global ednsuser "ixxxxn"
  2. :global ednspass "yxxxx7"
  3. :global ednshost "ixxxxn.3322.org"
  4. :global ednsinterface "pppoe-out1"
  5. :global members "http://members.3322.org/dyndns/update\?system=dyndns"
  6. :global status
  7. :global status [/interface get [/interface find name=$ednsinterface] running]
  8. :if ($status!=false) do={
  9. :global ednslastip [:resolve $ednshost]
  10. :if ([ :typeof $ednslastip ] = nil ) do={ :global ednslastip "0" }
  11. :global ednsiph [ /ip address get [/ip address find interface=$ednsinterface ] address ]
  12. :global ednsip [:pick $ednsiph 0 [:find $ednsiph "/"]]
  13. :global ednsstr "&hostname=$ednshost&myip=$ednsip"
  14. :if ($ednslastip != $ednsip) do={
  15. /tool fetch url="$members$ednsstr" mode=http user=$ednsuser password=$ednspass dst-path=$ednshost
  16. :delay 4
  17. :global result [/file get $ednshost contents]
  18. :log info ($ednshost . " " .$result)
  19. /file remove $ednshost ;
  20. }
  21. }

  1. 改变默认网关
  2. /ip route set [/ip route find dst-address=0.0.0.0/0] gateway=xxx.xxx.xxx.xxx
  3. 定时重起
  4. /system scheduler add name=reboot interval=24h start-time=11:59:00 on-event={/system reboot} disabled=no
  5. 定时执行
  6. system scheduler add name=DDNSs interval=00:05:00 start-time=00:00:00 on-event=":execute DDNS"
收集的代码,将来也许会用到

相关文章


2020 unjeep.com webmaster#unjeep.com
12 q. 0.012 s.
苏ICP备12049786号-20