{"id":430,"date":"2021-12-20T20:56:53","date_gmt":"2021-12-20T20:56:53","guid":{"rendered":"https:\/\/sznetwork.systems\/?p=430"},"modified":"2025-05-29T13:18:50","modified_gmt":"2025-05-29T11:18:50","slug":"mikrotik-send-wan-ip-address-to-email","status":"publish","type":"post","link":"https:\/\/sznetwork.systems\/?p=430","title":{"rendered":"Mikrotik send WAN IP address to email (Migrated)"},"content":{"rendered":"\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe loading=\"lazy\" title=\"Mikrotik send WAN IP address to email\" width=\"500\" height=\"281\" src=\"https:\/\/www.youtube.com\/embed\/SYlAOYqA_0g?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe>\n<\/div><\/figure>\n\n\n\n<pre class=\"wp-block-preformatted has-black-color has-cyan-bluish-gray-background-color has-text-color has-background\">Small script that detects WAN IP and sends it to email. It can be used when you have dynamically changing wan ip.<\/pre>\n\n\n\n<pre class=\"wp-block-preformatted has-black-color has-cyan-bluish-gray-background-color has-text-color has-background\">Winbox is connected and internal email client is configured.<\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"555\" src=\"https:\/\/sznetwork.systems\/wp-content\/uploads\/2021\/12\/screenshot.1-1-1024x555.jpg\" alt=\"\" class=\"wp-image-432\" srcset=\"https:\/\/sznetwork.systems\/wp-content\/uploads\/2021\/12\/screenshot.1-1-1024x555.jpg 1024w, https:\/\/sznetwork.systems\/wp-content\/uploads\/2021\/12\/screenshot.1-1-300x163.jpg 300w, https:\/\/sznetwork.systems\/wp-content\/uploads\/2021\/12\/screenshot.1-1-768x416.jpg 768w, https:\/\/sznetwork.systems\/wp-content\/uploads\/2021\/12\/screenshot.1-1-1536x832.jpg 1536w, https:\/\/sznetwork.systems\/wp-content\/uploads\/2021\/12\/screenshot.1-1.jpg 1920w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<pre class=\"wp-block-preformatted has-black-color has-cyan-bluish-gray-background-color has-text-color has-background\">Go to System, Scripts<\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"555\" src=\"https:\/\/sznetwork.systems\/wp-content\/uploads\/2021\/12\/screenshot.2-1-1024x555.jpg\" alt=\"\" class=\"wp-image-433\" srcset=\"https:\/\/sznetwork.systems\/wp-content\/uploads\/2021\/12\/screenshot.2-1-1024x555.jpg 1024w, https:\/\/sznetwork.systems\/wp-content\/uploads\/2021\/12\/screenshot.2-1-300x163.jpg 300w, https:\/\/sznetwork.systems\/wp-content\/uploads\/2021\/12\/screenshot.2-1-768x416.jpg 768w, https:\/\/sznetwork.systems\/wp-content\/uploads\/2021\/12\/screenshot.2-1-1536x832.jpg 1536w, https:\/\/sznetwork.systems\/wp-content\/uploads\/2021\/12\/screenshot.2-1.jpg 1920w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<pre class=\"wp-block-preformatted has-black-color has-cyan-bluish-gray-background-color has-text-color has-background\">Add new script<\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"555\" src=\"https:\/\/sznetwork.systems\/wp-content\/uploads\/2021\/12\/screenshot.3-1-1024x555.jpg\" alt=\"\" class=\"wp-image-434\" srcset=\"https:\/\/sznetwork.systems\/wp-content\/uploads\/2021\/12\/screenshot.3-1-1024x555.jpg 1024w, https:\/\/sznetwork.systems\/wp-content\/uploads\/2021\/12\/screenshot.3-1-300x163.jpg 300w, https:\/\/sznetwork.systems\/wp-content\/uploads\/2021\/12\/screenshot.3-1-768x416.jpg 768w, https:\/\/sznetwork.systems\/wp-content\/uploads\/2021\/12\/screenshot.3-1-1536x832.jpg 1536w, https:\/\/sznetwork.systems\/wp-content\/uploads\/2021\/12\/screenshot.3-1.jpg 1920w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<pre class=\"wp-block-preformatted has-black-color has-cyan-bluish-gray-background-color has-text-color has-background\">Fill name of script and enter script<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Script<\/h2>\n\n\n\n<pre class=\"wp-block-preformatted has-black-color has-cyan-bluish-gray-background-color has-text-color has-background\">\/<strong>tool fetch url=\"http:\/\/myip.dnsomatic.com\/\" mode=http dst-path=mypublicip.txt\nlocal ip [file get mypublicip.txt contents ]\nput $ip\n:log info $ip\n\/tool e-mail send from=\"simplelbase@gmail.com\"  to=simplelbase@gmail.com body=$ip subject=\"$[\/system identity get name] WAN_IP\"\n<\/strong><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"555\" src=\"https:\/\/sznetwork.systems\/wp-content\/uploads\/2021\/12\/screenshot.4-1-1024x555.jpg\" alt=\"\" class=\"wp-image-435\" srcset=\"https:\/\/sznetwork.systems\/wp-content\/uploads\/2021\/12\/screenshot.4-1-1024x555.jpg 1024w, https:\/\/sznetwork.systems\/wp-content\/uploads\/2021\/12\/screenshot.4-1-300x163.jpg 300w, https:\/\/sznetwork.systems\/wp-content\/uploads\/2021\/12\/screenshot.4-1-768x416.jpg 768w, https:\/\/sznetwork.systems\/wp-content\/uploads\/2021\/12\/screenshot.4-1-1536x832.jpg 1536w, https:\/\/sznetwork.systems\/wp-content\/uploads\/2021\/12\/screenshot.4-1.jpg 1920w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<pre class=\"wp-block-preformatted has-black-color has-cyan-bluish-gray-background-color has-text-color has-background\">Save, run script and check in log file that all work.<\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"555\" src=\"https:\/\/sznetwork.systems\/wp-content\/uploads\/2021\/12\/screenshot.5-1024x555.jpg\" alt=\"\" class=\"wp-image-436\" srcset=\"https:\/\/sznetwork.systems\/wp-content\/uploads\/2021\/12\/screenshot.5-1024x555.jpg 1024w, https:\/\/sznetwork.systems\/wp-content\/uploads\/2021\/12\/screenshot.5-300x163.jpg 300w, https:\/\/sznetwork.systems\/wp-content\/uploads\/2021\/12\/screenshot.5-768x416.jpg 768w, https:\/\/sznetwork.systems\/wp-content\/uploads\/2021\/12\/screenshot.5-1536x832.jpg 1536w, https:\/\/sznetwork.systems\/wp-content\/uploads\/2021\/12\/screenshot.5.jpg 1920w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"has-black-color has-cyan-bluish-gray-background-color has-text-color has-background\">If all work, add script to the schedule<\/p>\n","protected":false},"excerpt":{"rendered":"<p>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. <a class=\"read-more-link\" href=\"https:\/\/sznetwork.systems\/?p=430\">read more&#8230;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[37],"tags":[33,48,31,32,49],"class_list":["post-430","post","type-post","status-publish","format-standard","hentry","category-mikrotik","tag-email","tag-ip","tag-mikrotik","tag-script","tag-wan"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/sznetwork.systems\/index.php?rest_route=\/wp\/v2\/posts\/430","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sznetwork.systems\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sznetwork.systems\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sznetwork.systems\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/sznetwork.systems\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=430"}],"version-history":[{"count":4,"href":"https:\/\/sznetwork.systems\/index.php?rest_route=\/wp\/v2\/posts\/430\/revisions"}],"predecessor-version":[{"id":1900,"href":"https:\/\/sznetwork.systems\/index.php?rest_route=\/wp\/v2\/posts\/430\/revisions\/1900"}],"wp:attachment":[{"href":"https:\/\/sznetwork.systems\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=430"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sznetwork.systems\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=430"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sznetwork.systems\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=430"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}