GithubHelp home page GithubHelp logo

amilus668 / routeros-ddns-cloudflare Goto Github PK

View Code? Open in Web Editor NEW

This project forked from akkias7/routeros-ddns-cloudflare

0.0 0.0 0.0 7 KB

RouterOS / ROS / MikroTik script for Cloudflare DDNS using API_Token as authorization.

routeros-ddns-cloudflare's Introduction

RouterOS-DDNS-Cloudflare

RouterOS script for Cloudflare DDNS using API_Token as authorization.

一. 环境准备

  1. 你需要将 JParseFunctions 导入至RouterOS的 scripts
    导入后在RouterOS终端运行以下命令
    /system script run "JParseFunctions"; global JSONLoad; global JSONLoads; global JSONUnload
  2. 从Cloudflare获取API_TOKENS
    注意本脚本并不需要你的API_KEY与邮箱
    仅需要拥有 编辑区域DNS 权限的 API_TOKENS 即可完成任务
  3. ros-ddns-sample 导入至RouterOS的 scripts
    你可能想要重命名并复制这个文件,如果你需要创建多个DDNS记录

二. 使用脚本

  1. 根据 ros-ddns-sample 文件中的提示修改对应键值
    你需要输入的是 uniqueID , WANInterface , CFdomain , CFzone , TTL , CFproxied , CFapitoken
  2. uniqueID 必须唯一,它用于记录 zoneIDdomainID
    为多个DDNS脚本设置相同的 uniqueID 会导致DNS记录错误更新
  3. TTL 单位为秒
  4. CFproxied 用于开关 Cloudflare's DNS Proxy 功能 (橙色云朵图标)
  5. WANInterface 填入获取ip的目标接口名
    (pppoe拨号则填pppoe接口名)

三. 清理

  1. RouterOS终端中运行 $JSONUnload
    这将自动清除所有 JParseFunctions加载的全局变量
  2. RouterOS终端中运行 set $CFarray
    这将删除本脚本所加载的全局变量

四. 异常解决

  1. 几乎所有异常均可以通过移除 CFarray 全局变量解决
    在RouterOS终端中运行 set $CFarray
    在这之后脚本将会在下次运行时重新获取 zoneIDdomainID
  2. 其他问题欢迎在issue中提出

Thanks:

https://github.com/Winand/mikrotik-json-parser
https://github.com/kiss2u/ros-cloudflare-ddns

routeros-ddns-cloudflare's People

Contributors

akkias7 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.