Small script that detects WAN IP and sends it to email. It can be used when you have dynamically changing wan ip.
Winbox is connected and internal email client is configured.
Go to System, Scripts
Add new script
Fill name of script and enter script

Script

/tool fetch url="http://myip.dnsomatic.com/" mode=http dst-path=mypublicip.txt
local ip [file get mypublicip.txt contents ]
put $ip
:log info $ip
/tool e-mail send from="simplelbase@gmail.com"  to=simplelbase@gmail.com body=$ip subject="$[/system identity get name] WAN_IP"
Save, run script and check in log file that all work.

If all work, add script to the schedule

Mikrotik Send Backup Files to Email
Configuring PPTP server on Mikrotik

Leave a Comment

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