Mikrotik Script

Here is simple script which sends your IP address to your email, it will save you paying for a fix IP service from your ISP, unless you have a different case.

:global ipadd;
:global extinterface "ether1-gateway"
:local thisip [/ip address get [/ip address find interface=$extinterface ] address];

:if ($ipadd != $thisip) do={
 /tool e-mail send to="youremail@address.org" subject="ip change" body="IP $thisip";
 set ipadd $thisip;
 }

For this you’ll need an email account from where you’re sending the emails, that can be set up here: /tool e-mail

You can find the scripts under /system script and you can schedule them under /system scheduler. For example you can run the script above each morning so you’ll receive the IP while enjoying your coffee. There is so much more that can be done with them, I might cover a few later.

More on scripts here: https://wiki.mikrotik.com/wiki/Manual:Scripting

Leave a Reply

Your email address will not be published. Required fields are marked *