I have a puplic IP address from my ISP.
For external access over vpn I have a Domain with Dynamic DNS Update Function.
Sorry for my bad english, I hope its understandable
When I bought my Mikrotik Router a few years ago, I set up the following script that worked fine:
Code: Select all
:global actualIP value=[/ip address get [find where interface=pppoe-out1] value-name=address];
:global actualIP value=[:pick $actualIP -1 [:find $actualIP "/" -1] ];
:if ([:len [/file find where name=ipstore.txt]] < 1 ) do={
/file print file=ipstore.txt where name=ipstore.txt;
/delay delay-time=2;
/file set ipstore.txt contents="0.0.0.0";
};
:global previousIP value=[/file get [find where name=ipstore.txt ] value-name=contents];
:if ($previousIP != $actualIP) do={
:log info message=("Try to Update DNS with actual IP ".$actualIP." - Previous IP are ".$previousIP);
/tool fetch mode=https keep-result=yes dst-path=dns-result.txt address=[:resolve dyndns.regfish.de] port=443 host=dyndns.regfish.de src-path=("/?fqdn=mydomain.eu.&forcehost=1&authtype=secure&token=myaccesstoken=".$actualIP);
/delay delay-time=5;
:global lastChange value=[/file get [find where name=dns-result.txt ] value-name=contents];
:global previousIP value=$actualIP;
/file set ipstore.txt contents=$actualIP;
:if ($lastChange = "OK") do={:log warning message=("DNS update successfull with IP ".$actualIP);};
:if ($lastChange = "KO") do={:log error message=("Fail to update DNS with new IP ".$actualIP);};
};
I don't know if there was any change in RouterOS. My system is up to Date with 6.46.1. But I think I have read anything, but I doesn't find it anymore.
Does anyone have an idea what could be the problem with this script?