hi
i connect a ADSL Router/Modem to mikrotik RB951Ui . but internet ip adress is dynamic and not static. so i want to have new ip every time for Remote Mikrotik.
i need one script that getting new internet ip adress every 6hours and save in txt file and send to ftp or mail or any way that i know what is new ip.
please help me
no person to help me?
Add a comment to your /ip dhcp-client entry. Then change the comment in the code below to match. Decide how you want to send the file (email, ftp), and finish the code at the bottom.
Finally, create a schedule that runs the script every 6 hours. A new file will be send if the address has changed.
{
:if ([:len [/file find name="ip.txt"]] != 1) do={
/file print file=ip
:delay 2s;
}
:local ip [/ip dhcp-client get [find comment="dynamicIP"] address]
:if ([/file get ip.txt content] != $ip) do={
/file set ip.txt contents=$ip;
/tool e-mail send file=ip.txt ...
/tool fetch mode=ftp upload=yes src-path=ip.txt ...
}
}