{"id":39,"date":"2026-08-13T15:43:50","date_gmt":"2026-08-13T09:43:50","guid":{"rendered":"https:\/\/coldroute.net\/blog\/?p=39"},"modified":"2026-10-06T09:55:16","modified_gmt":"2026-10-06T03:55:16","slug":"basic-mikrotik-security-script-part-1","status":"publish","type":"post","link":"https:\/\/coldroute.net\/blog\/basic-mikrotik-security-script-part-1\/","title":{"rendered":"ColdRoute Foundations: The Basic MikroTik Security Script (Part 1 of 2)"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Every MikroTik router I&#8217;ve deployed starts with the same baseline before anything else gets configured. I call it the <strong>Basic-Mikrotik-Security-Script<\/strong>, and it does two things:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Restricts every management and service port to a whitelist of trusted IPs<\/li>\n\n\n\n<li>Detects and stalls connection-flood attempts using RouterOS&#8217;s tarpit action<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">Neither piece is complicated on its own. What matters is understanding <em>why<\/em> each rule exists, because a firewall script you don&#8217;t understand is a script you&#8217;ll misconfigure the first time you need to change it.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\"><strong>Get the script:<\/strong> the full, versioned <code>.rsc<\/code> file lives in the <a href=\"https:\/\/github.com\/coldroute-scripts\" target=\"_blank\" rel=\"noreferrer noopener\">coldroute-scripts<\/a> repo &#8211; grab it from there instead of copy-pasting from this page. WordPress&#8217;s editor has a habit of converting straight quotes into curly quotes, which silently breaks RouterOS syntax.<\/p>\n<\/blockquote>\n\n\n\n<h2 class=\"wp-block-heading\">Step 1: Build the Whitelist<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Everything downstream depends on this address-list. It holds the IPs, your management workstation, a jump host, a VPN pool, that are allowed to reach the router directly.<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism off-numbers lang-plain\"><code>\/ip firewall address-list\nadd address=IP1\/29 list=ACL\nadd address=IPN\/N list=ACL<\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">Replace <code>IP1\/29<\/code> and <code>IPN\/N<\/code> with your actual trusted ranges. If you&#8217;re managing this remotely, add your current IP <em>before<\/em> you apply the drop rules below, locking yourself out of a router with no local access is a mistake you only make once.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Step 2: Drop Everything Not on the Whitelist<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">This is the core of the script, one drop rule per exposed service, each scoped with <code>src-address-list=!ACL<\/code>. The <code>!<\/code> negates the match, so the rule reads as &#8220;drop this traffic if the source is <em>not<\/em> in the ACL list.&#8221;<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism off-numbers lang-plain\"><code>\/ip firewall filter\nadd action=drop chain=input comment=&quot;Winbox - allow only ACL&quot; dst-port=8291 protocol=tcp src-address-list=!ACL\nadd action=drop chain=input comment=&quot;Winbox Alt - allow only ACL&quot; dst-port=6252 protocol=tcp src-address-list=!ACL\nadd action=drop chain=input comment=&quot;Telnet - allow only ACL&quot; dst-port=23 protocol=tcp src-address-list=!ACL\nadd action=drop chain=input comment=&quot;SSH - allow only ACL&quot; dst-port=22 protocol=tcp src-address-list=!ACL\nadd action=drop chain=input comment=&quot;SSH Alt - allow only ACL&quot; dst-port=2200 protocol=tcp src-address-list=!ACL\nadd action=drop chain=input comment=&quot;WebFig - allow only ACL&quot; dst-port=80 protocol=tcp src-address-list=!ACL\nadd action=drop chain=input comment=&quot;Web Alt 8080 - allow only ACL&quot; dst-port=8080 protocol=tcp src-address-list=!ACL\nadd action=drop chain=input comment=&quot;FTP - allow only ACL&quot; dst-port=21 protocol=tcp src-address-list=!ACL\nadd action=drop chain=input comment=&quot;Web Alt 8181 - allow only ACL&quot; dst-port=8181 protocol=tcp src-address-list=!ACL\nadd action=drop chain=input comment=&quot;Web Alt 8880 - allow only ACL&quot; dst-port=8880 protocol=tcp src-address-list=!ACL\nadd action=drop chain=input comment=&quot;Web Alt 81 - allow only ACL&quot; dst-port=81 protocol=tcp src-address-list=!ACL\nadd action=drop chain=input comment=&quot;Web Alt 82 - allow only ACL&quot; dst-port=82 protocol=tcp src-address-list=!ACL\nadd action=drop chain=input comment=&quot;Web Alt 8081 - allow only ACL&quot; dst-port=8081 protocol=tcp src-address-list=!ACL\nadd action=drop chain=input comment=&quot;Web Alt 8082 - allow only ACL&quot; dst-port=8082 protocol=tcp src-address-list=!ACL\nadd action=drop chain=input comment=&quot;Web Alt 8089 - allow only ACL&quot; dst-port=8089 protocol=tcp src-address-list=!ACL\nadd action=drop chain=input comment=&quot;API - allow only ACL&quot; dst-port=8728 protocol=tcp src-address-list=!ACL\nadd action=drop chain=input comment=&quot;SOCKS - allow only ACL&quot; dst-port=2008 protocol=tcp src-address-list=!ACL\nadd action=drop chain=input comment=&quot;SOCKS - allow only ACL&quot; dst-port=1080 protocol=tcp src-address-list=!ACL\nadd action=drop chain=input comment=&quot;SOCKS - allow only ACL&quot; dst-port=4153 protocol=tcp src-address-list=!ACL<\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">Grouped by what they actually protect:<\/p>\n\n\n\n<figure class=\"wp-block-table is-style-stripes\"><table class=\"has-fixed-layout\"><thead><tr><th>Category<\/th><th>Ports<\/th><th>Why it matters<\/th><\/tr><\/thead><tbody><tr><td>Remote management<\/td><td>8291 (Winbox), 6252 (custom Winbox), 22\/2200 (SSH), 23 (Telnet), 8728 (API)<\/td><td>These are the ports that give someone full router control if compromised. Telnet in particular sends credentials in plaintext \u2014 it&#8217;s included here for legacy compatibility, but disabling it entirely is worth considering if nothing on your network still needs it.<\/td><\/tr><tr><td>Web\/admin interfaces<\/td><td>80, 81, 82, 8080, 8081, 8082, 8089, 8181, 8880<\/td><td>Covers WebFig and any reverse-proxied or alternate-port admin panels running behind the router.<\/td><\/tr><tr><td>FTP<\/td><td>21<\/td><td>Blocks the built-in file service, which is a common lateral-movement target if left open.<\/td><\/tr><tr><td>SOCKS proxy<\/td><td>2008, 1080, 4153<\/td><td>Prevents the router from being used as an open relay if a SOCKS service is ever enabled, intentionally or by misconfiguration.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">The effect of these rules together: brute-force protection isn&#8217;t something you bolt on after the fact, it&#8217;s structural. An attacker outside your ACL never reaches the login prompt to begin with, so there&#8217;s nothing to brute-force.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Step 3: Detect and Tarpit Connection Floods<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The whitelist handles unauthorized access. This next pair of rules handles a different problem, a high volume of connections from a single source, which usually signals a DoS attempt or aggressive scanning rather than a normal login attempt.<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism off-numbers lang-plain\"><code>add action=add-src-to-address-list address-list=Dos_Attack address-list-timeout=5m chain=input comment=&quot;Dos Attack&quot; connection-limit=10,32 protocol=tcp\nadd action=tarpit chain=input comment=&quot;Dos Attack&quot; connection-limit=10,32 protocol=tcp src-address-list=Dos_Attack<\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\"><code>connection-limit=10,32<\/code> means: if a single source IP (the <code>\/32<\/code> mask) has more than 10 concurrent TCP connections open, it matches. The first rule adds that IP to the <code>Dos_Attack<\/code> list for 5 minutes. The second rule catches anything already on that list and applies <code>tarpit<\/code> instead of an outright drop.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Tarpit is the detail that makes this more than a basic rate-limit. Instead of silently dropping packets, RouterOS completes the TCP handshake and then stalls the connection, no data flows, but the connection stays technically open. For the attacker&#8217;s tooling, this means tied-up sockets and threads instead of a fast failure they can immediately retry. It costs them more than it costs you.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Applying It<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Trusted IPs go into the ACL list first, the script runs top to bottom, and as with any input-chain change test from a session you can afford to lose before you close your only connection to the router.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">The Caveat: This Script Assumes a Simple Topology<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Everything above works cleanly if the router&#8217;s only job is routing and management. But most small-business MikroTik deployments aren&#8217;t that simple, the same box is often running DHCP, DNS, a VPN endpoint, and BGP peering all at once.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">That&#8217;s a problem this script doesn&#8217;t address, and it&#8217;s not a small one: RouterOS&#8217;s default input chain policy is <code>accept<\/code>. Any port <em>not<\/em> explicitly covered by a rule above is still reachable by anyone, from anywhere including the internet. This script secures the ports it knows about; it says nothing about the ports it doesn&#8217;t.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For a management-only router, the fix is simple: add a catch-all drop at the bottom. But on a combo box running DHCP\/DNS\/VPN\/BGP, a blind catch-all breaks local services the moment you apply it DNS resolution for your LAN, VPN handshakes, routing adjacencies all live in that same <code>accept<\/code>-by-default gap.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Closing that gap properly means scoping rules by <em>interface<\/em> trusting the LAN side, restricting the WAN side to only what&#8217;s supposed to be internet-facing, and whitelisting BGP peers by IP rather than leaving port 179 open to the world. That&#8217;s a distinct enough problem that it gets its own post: <strong>Part 2 &#8211; Hardening the Basic Script: Interface-Scoped Rules for Combo Routers (DHCP, DNS, VPN &amp; BGP)<\/strong>, using the <code>Hardened-Mikrotik-Security-Script<\/code>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If your router is a single-purpose management\/edge device, this script is enough on its own. If it&#8217;s also running DHCP, DNS, VPN, or BGP for a small business, which is the common case, treat this as the foundation, not the finished product, and continue to Part 2 before calling it production-ready.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Every MikroTik router I&#8217;ve deployed starts with the same baseline before anything else gets configured. I call it the Basic-Mikrotik-Security-Script, and it does two things: Neither piece is complicated on its own. What matters is understanding why each rule exists, because a firewall script you don&#8217;t understand is a script you&#8217;ll misconfigure the first time [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_post_was_ever_published":false},"categories":[6],"tags":[12,15,14,13,10,16,9],"class_list":["post-39","post","type-post","status-publish","format-standard","hentry","category-mikrotik","tag-address-list","tag-brute-force-protection","tag-coldroute-foundations","tag-dos-protection","tag-firewall","tag-network-security","tag-routeros"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.7 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>ColdRoute Foundations: The Basic MikroTik Security Script (Part 1 of 2) - ColdRoute<\/title>\n<meta name=\"description\" content=\"A practical RouterOS script that whitelists admin access to management ports and slows down DoS attempts using tarpit built from real deployments\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/coldroute.net\/blog\/basic-mikrotik-security-script-part-1\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"ColdRoute Foundations: The Basic MikroTik Security Script (Part 1 of 2) - ColdRoute\" \/>\n<meta property=\"og:description\" content=\"A practical RouterOS script that whitelists admin access to management ports and slows down DoS attempts using tarpit built from real deployments\" \/>\n<meta property=\"og:url\" content=\"https:\/\/coldroute.net\/blog\/basic-mikrotik-security-script-part-1\/\" \/>\n<meta property=\"og:site_name\" content=\"ColdRoute\" \/>\n<meta property=\"article:published_time\" content=\"2026-08-13T09:43:50+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-10-06T03:55:16+00:00\" \/>\n<meta name=\"author\" content=\"Redwan\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Redwan\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/coldroute.net\\\/blog\\\/basic-mikrotik-security-script-part-1\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/coldroute.net\\\/blog\\\/basic-mikrotik-security-script-part-1\\\/\"},\"author\":{\"name\":\"Redwan\",\"@id\":\"https:\\\/\\\/coldroute.net\\\/blog\\\/#\\\/schema\\\/person\\\/5d5558e57c72a14f90ad9778b62968c6\"},\"headline\":\"ColdRoute Foundations: The Basic MikroTik Security Script (Part 1 of 2)\",\"datePublished\":\"2026-08-13T09:43:50+00:00\",\"dateModified\":\"2026-10-06T03:55:16+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/coldroute.net\\\/blog\\\/basic-mikrotik-security-script-part-1\\\/\"},\"wordCount\":876,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/coldroute.net\\\/blog\\\/#organization\"},\"keywords\":[\"address-list\",\"brute-force protection\",\"ColdRoute Foundations\",\"DoS protection\",\"Firewall\",\"network security\",\"RouterOS\"],\"articleSection\":[\"Mikrotik\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/coldroute.net\\\/blog\\\/basic-mikrotik-security-script-part-1\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/coldroute.net\\\/blog\\\/basic-mikrotik-security-script-part-1\\\/\",\"url\":\"https:\\\/\\\/coldroute.net\\\/blog\\\/basic-mikrotik-security-script-part-1\\\/\",\"name\":\"ColdRoute Foundations: The Basic MikroTik Security Script (Part 1 of 2) - ColdRoute\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/coldroute.net\\\/blog\\\/#website\"},\"datePublished\":\"2026-08-13T09:43:50+00:00\",\"dateModified\":\"2026-10-06T03:55:16+00:00\",\"description\":\"A practical RouterOS script that whitelists admin access to management ports and slows down DoS attempts using tarpit built from real deployments\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/coldroute.net\\\/blog\\\/basic-mikrotik-security-script-part-1\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/coldroute.net\\\/blog\\\/basic-mikrotik-security-script-part-1\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/coldroute.net\\\/blog\\\/basic-mikrotik-security-script-part-1\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/coldroute.net\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"ColdRoute Foundations: The Basic MikroTik Security Script (Part 1 of 2)\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/coldroute.net\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/coldroute.net\\\/blog\\\/\",\"name\":\"ColdRoute\",\"description\":\"Infrastructure, Networks, Systems\",\"publisher\":{\"@id\":\"https:\\\/\\\/coldroute.net\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/coldroute.net\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/coldroute.net\\\/blog\\\/#organization\",\"name\":\"ColdRoute\",\"url\":\"https:\\\/\\\/coldroute.net\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/coldroute.net\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/coldroute.net\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/08\\\/coldroute-logo-horizontal-dark-scaled.png\",\"contentUrl\":\"https:\\\/\\\/coldroute.net\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/08\\\/coldroute-logo-horizontal-dark-scaled.png\",\"width\":2560,\"height\":768,\"caption\":\"ColdRoute\"},\"image\":{\"@id\":\"https:\\\/\\\/coldroute.net\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/coldroute.net\\\/blog\\\/#\\\/schema\\\/person\\\/5d5558e57c72a14f90ad9778b62968c6\",\"name\":\"Redwan\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/6070095020341e9f4fa69ffeb0206ba0e91d5f850a3aee1ac27bf52152be7bcc?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/6070095020341e9f4fa69ffeb0206ba0e91d5f850a3aee1ac27bf52152be7bcc?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/6070095020341e9f4fa69ffeb0206ba0e91d5f850a3aee1ac27bf52152be7bcc?s=96&d=mm&r=g\",\"caption\":\"Redwan\"},\"sameAs\":[\"https:\\\/\\\/coldroute.net\\\/blog\"],\"url\":\"https:\\\/\\\/coldroute.net\\\/blog\\\/author\\\/redmin\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"ColdRoute Foundations: The Basic MikroTik Security Script (Part 1 of 2) - ColdRoute","description":"A practical RouterOS script that whitelists admin access to management ports and slows down DoS attempts using tarpit built from real deployments","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/coldroute.net\/blog\/basic-mikrotik-security-script-part-1\/","og_locale":"en_US","og_type":"article","og_title":"ColdRoute Foundations: The Basic MikroTik Security Script (Part 1 of 2) - ColdRoute","og_description":"A practical RouterOS script that whitelists admin access to management ports and slows down DoS attempts using tarpit built from real deployments","og_url":"https:\/\/coldroute.net\/blog\/basic-mikrotik-security-script-part-1\/","og_site_name":"ColdRoute","article_published_time":"2026-08-13T09:43:50+00:00","article_modified_time":"2026-10-06T03:55:16+00:00","author":"Redwan","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Redwan","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/coldroute.net\/blog\/basic-mikrotik-security-script-part-1\/#article","isPartOf":{"@id":"https:\/\/coldroute.net\/blog\/basic-mikrotik-security-script-part-1\/"},"author":{"name":"Redwan","@id":"https:\/\/coldroute.net\/blog\/#\/schema\/person\/5d5558e57c72a14f90ad9778b62968c6"},"headline":"ColdRoute Foundations: The Basic MikroTik Security Script (Part 1 of 2)","datePublished":"2026-08-13T09:43:50+00:00","dateModified":"2026-10-06T03:55:16+00:00","mainEntityOfPage":{"@id":"https:\/\/coldroute.net\/blog\/basic-mikrotik-security-script-part-1\/"},"wordCount":876,"commentCount":0,"publisher":{"@id":"https:\/\/coldroute.net\/blog\/#organization"},"keywords":["address-list","brute-force protection","ColdRoute Foundations","DoS protection","Firewall","network security","RouterOS"],"articleSection":["Mikrotik"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/coldroute.net\/blog\/basic-mikrotik-security-script-part-1\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/coldroute.net\/blog\/basic-mikrotik-security-script-part-1\/","url":"https:\/\/coldroute.net\/blog\/basic-mikrotik-security-script-part-1\/","name":"ColdRoute Foundations: The Basic MikroTik Security Script (Part 1 of 2) - ColdRoute","isPartOf":{"@id":"https:\/\/coldroute.net\/blog\/#website"},"datePublished":"2026-08-13T09:43:50+00:00","dateModified":"2026-10-06T03:55:16+00:00","description":"A practical RouterOS script that whitelists admin access to management ports and slows down DoS attempts using tarpit built from real deployments","breadcrumb":{"@id":"https:\/\/coldroute.net\/blog\/basic-mikrotik-security-script-part-1\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/coldroute.net\/blog\/basic-mikrotik-security-script-part-1\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/coldroute.net\/blog\/basic-mikrotik-security-script-part-1\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/coldroute.net\/blog\/"},{"@type":"ListItem","position":2,"name":"ColdRoute Foundations: The Basic MikroTik Security Script (Part 1 of 2)"}]},{"@type":"WebSite","@id":"https:\/\/coldroute.net\/blog\/#website","url":"https:\/\/coldroute.net\/blog\/","name":"ColdRoute","description":"Infrastructure, Networks, Systems","publisher":{"@id":"https:\/\/coldroute.net\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/coldroute.net\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/coldroute.net\/blog\/#organization","name":"ColdRoute","url":"https:\/\/coldroute.net\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/coldroute.net\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/coldroute.net\/blog\/wp-content\/uploads\/2026\/08\/coldroute-logo-horizontal-dark-scaled.png","contentUrl":"https:\/\/coldroute.net\/blog\/wp-content\/uploads\/2026\/08\/coldroute-logo-horizontal-dark-scaled.png","width":2560,"height":768,"caption":"ColdRoute"},"image":{"@id":"https:\/\/coldroute.net\/blog\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/coldroute.net\/blog\/#\/schema\/person\/5d5558e57c72a14f90ad9778b62968c6","name":"Redwan","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/6070095020341e9f4fa69ffeb0206ba0e91d5f850a3aee1ac27bf52152be7bcc?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/6070095020341e9f4fa69ffeb0206ba0e91d5f850a3aee1ac27bf52152be7bcc?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/6070095020341e9f4fa69ffeb0206ba0e91d5f850a3aee1ac27bf52152be7bcc?s=96&d=mm&r=g","caption":"Redwan"},"sameAs":["https:\/\/coldroute.net\/blog"],"url":"https:\/\/coldroute.net\/blog\/author\/redmin\/"}]}},"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/coldroute.net\/blog\/wp-json\/wp\/v2\/posts\/39","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/coldroute.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/coldroute.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/coldroute.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/coldroute.net\/blog\/wp-json\/wp\/v2\/comments?post=39"}],"version-history":[{"count":11,"href":"https:\/\/coldroute.net\/blog\/wp-json\/wp\/v2\/posts\/39\/revisions"}],"predecessor-version":[{"id":62,"href":"https:\/\/coldroute.net\/blog\/wp-json\/wp\/v2\/posts\/39\/revisions\/62"}],"wp:attachment":[{"href":"https:\/\/coldroute.net\/blog\/wp-json\/wp\/v2\/media?parent=39"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/coldroute.net\/blog\/wp-json\/wp\/v2\/categories?post=39"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/coldroute.net\/blog\/wp-json\/wp\/v2\/tags?post=39"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}