This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
networking:router:mikrotik_dyndns [2015/01/10 21:42] gcooper |
networking:router:mikrotik_dyndns [2022/10/24 09:34] (current) gcooper |
||
---|---|---|---|
Line 2: | Line 2: | ||
===== Mikrotik Cloud Method ===== | ===== Mikrotik Cloud Method ===== | ||
+ | |||
+ | http:// | ||
* Super simple to enable and no configuration required | * Super simple to enable and no configuration required | ||
Line 10: | Line 12: | ||
To make a more memorable hostname, you can create a CNAME record in another DNS domain name that you control using this DNS Name as the target. | To make a more memorable hostname, you can create a CNAME record in another DNS domain name that you control using this DNS Name as the target. | ||
- | < | + | ==== Winbox ==== |
- | /ip cloud set enabled=yes update-time=yes | + | |
- | /ip cloud print | + | **IP -> Cloud** |
- | </file> | + | |
- | ===== Script Method ===== | + | * Enable DDNS |
+ | * Enable Update Time | ||
- | http:// | + | ==== CLI ==== |
- | + | ||
- | http:// | + | |
- | + | ||
- | - Add a script | + | |
- | - Add a scheduler entry to run the script | + | |
- | + | ||
- | ==== Create the Script | + | |
- | + | ||
- | Copy and paste this script at the CLI to generate a script to be scheduled: | + | |
< | < | ||
- | /system script add name=dyndns policy=\ | + | /ip cloud set enabled=yes update-time=yes |
- | | + | |
- | \n# Dynamic DNS Update Script\r\ | + | |
- | | + | |
- | \n# Name resolution must be working.\r\ | + | |
- | | + | |
- | \n# Set needed variables\r\ | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | \n# print some debug info\r\ | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | \n# get the current IP address from the Internet (in case of double-nat)\r\ | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | \n# parse the current IP result\r\ | + | |
- | | + | |
- | | + | |
- | \n:set startLoc (\$startLoc + 2)\r\ | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | \n# Remove the # on next line to force an update | + | |
- | \n# but you could end up getting blacklisted by DynDNS!\r\ | + | |
- | | + | |
- | | + | |
- | | + | |
- | \n# Determine if dyndns update is needed\r\ | + | |
- | \n# more dyndns updater request details http:// | + | |
- | | + | |
- | \n:if ((\$currentIP != \$previousIP) || (\$dyndnsForce = true)) do={\r\ | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | \n} else={\r\ | + | |
- | | + | |
- | | + | |
- | </ | + | |
- | ==== Run the Script ==== | + | /ip cloud print |
- | + | ||
- | < | + | |
- | /system script run dyndns | + | |
- | </ | + | |
- | + | ||
- | ==== Create a Schedule ==== | + | |
- | < | + | |
- | + | ||
- | /system scheduler add comment=" | + | |
- | on-event=dyndns policy=reboot, | + | |
- | start-date=jan/ | + | |
</ | </ |