19/10/2026

MikroTik Security: Harden RouterOS v7 in 15 Steps

A lot of people don't take MikroTik security seriously. They plug the router in, the internet works, done. But one Winbox port open to the internet, or an `admin` user with a weak password, is enough to wake up one morning and find your router belongs to someone else.

A lot of people don't take MikroTik security seriously. They plug the router in, the internet works, done. But one Winbox port open to the internet, or an admin user with a weak password, is enough to wake up one morning and find your router belongs to someone else.

The ITcorv team works with enterprise and multi-branch networks, and this checklist is what we do on every new MikroTik. Every command here is for RouterOS v7.

What is MikroTik security?

MikroTik security means the router does only what it needs to do, and only the right people can manage it. Extra services are off, the management interface can't be reached from the internet, the firewall defaults to "everything closed", and if something goes wrong you have logs and a backup. Nothing exotic. You just have to do it carefully and in order.

Why MikroTik security matters more right now

In September 2026 (Shahrivar 1405), MikroTik disclosed six vulnerabilities. One let anyone who could reach the SSH port run commands on the router without logging in, and MikroTik says it was exploited in the wild. Another one hit WebFig and let an attacker read files on the router without logging in.

One important detail: on October 6 MikroTik said the fix for one of these issues in 7.24.2 and 7.23.4 was incomplete. So if you updated in September, you need to update again.

The minimum versions that fix everything:

  • stable channel: 7.24.3 or later
  • long-term channel: 7.23.6 or later
  • still on RouterOS 6: 6.49.21 or later

Details are in MikroTik's official advisory.

Sample RouterOS v7 hardening config in 15 steps

Three things before you start:

  • Connect from a physical port or from the management network, not over the internet. If you get the firewall wrong, you lock yourself out.
  • Turn on Safe Mode. In the terminal press Ctrl+X; in Winbox the button is at the top of the window. If your session drops, the router rolls the changes back by itself.
  • Take a backup first (step 14).

In the examples the management network is 10.10.99.0/24 and the log server is 10.10.99.50. Replace them with your own addresses.

1) Update RouterOS

routeros@itcorv:~
/system package update set channel=long-term
/system package update check-for-updates
/system package update install

For enterprise networks we prefer the long-term channel. Stable is fine too. Don't run testing on a production router.

2) Update the RouterBOOT firmware

Updating RouterOS doesn't update the firmware for you. After the update, run:

routeros@itcorv:~
/system routerboard print
/system routerboard upgrade
/system reboot

If current-firmware and upgrade-firmware differ, the new firmware is ready and gets installed on reboot.

3) Retire the admin user

Create a new user first, log in with it, then disable admin:

routeros@itcorv:~
/user add name=noc-ops group=full password="a-long-strong-password"
/user disable admin

4) Strong passwords and separate groups

routeros@itcorv:~
/user settings set minimum-password-length=12 minimum-categories=3
/user group add name=noc-read policy=local,ssh,winbox,read,test
/user add name=helpdesk group=noc-read password="another-strong-password"

The first line stops anyone from setting a short, simple password. The rest creates a read-only group. The rule is simple: everyone gets their own user, with only the access they need. No shared accounts.

5) Disable unused services (telnet, ftp, www, api)

routeros@itcorv:~
/ip service
set telnet disabled=yes
set ftp disabled=yes
set www disabled=yes
set www-ssl disabled=yes
set api disabled=yes
set api-ssl disabled=yes

Telnet and FTP send passwords unencrypted. WebFig was part of the September vulnerabilities. If your monitoring tool uses the API, keep only api-ssl on and restrict it like in the next step.

6) Lock down Winbox and SSH from the WAN with an address list

First, tell the services to answer only the management network:

routeros@itcorv:~
/ip service
set winbox address=10.10.99.0/24
set ssh address=10.10.99.0/24

In newer versions Winbox shows this field as available-from, but the same command still works.

Then create an address list to use in the firewall:

routeros@itcorv:~
/ip firewall address-list
add list=MGMT address=10.10.99.0/24 comment="mgmt vlan"

Keep in mind: according to MikroTik's own docs, restricting the address in /ip service doesn't hide the port. The router accepts the connection and then closes it. That's why step 10 (the firewall) is needed.

7) Turn off the MAC server and Neighbor Discovery

With MAC-Winbox, anyone on the same layer 2 network can reach your router, even without an IP. Neighbor Discovery announces the router's model and version to everyone.

routeros@itcorv:~
/tool mac-server set allowed-interface-list=none
/tool mac-server mac-winbox set allowed-interface-list=none
/tool mac-server ping set enabled=no
/ip neighbor discovery-settings set discover-interface-list=none

If your team really needs MAC-Winbox, use a management-only interface list instead of none. Never the WAN.

8) The other extra services

routeros@itcorv:~
/tool bandwidth-server set enabled=no
/ip proxy set enabled=no
/ip socks set enabled=no
/ip upnp set enabled=no
/ip cloud set ddns-enabled=no update-time=no

The bandwidth server was also on the September vulnerability list. If you don't need it, keep it off.

DNS: if your router is the DNS server for the LAN, keep allow-remote-requests on and allow it only from the LAN in step 10. If it isn't, turn it off so your router doesn't become a public DNS resolver:

routeros@itcorv:~
/ip dns set allow-remote-requests=no

9) Tighten SSH

routeros@itcorv:~
/ip ssh set strong-crypto=yes forwarding-enabled=no

strong-crypto disables weak algorithms like sha1 and md5. forwarding-enabled=no stops anyone from using the router as a tunnel.

10) MikroTik firewall: a default-deny input chain

The input chain is traffic going to the router itself. The logic: accept replies to existing connections, drop invalid, accept management only from the MGMT list, drop the rest.

routeros@itcorv:~
/ip firewall filter
add chain=input action=accept connection-state=established,related,untracked comment="accept established,related"
add chain=input action=drop connection-state=invalid comment="drop invalid"
add chain=input action=accept protocol=icmp comment="accept icmp"
add chain=input action=drop protocol=tcp dst-port=22 src-address-list=ssh_blacklist comment="ssh: drop blacklist"
add chain=input action=add-src-to-address-list address-list=ssh_blacklist address-list-timeout=1d protocol=tcp dst-port=22 connection-state=new src-address-list=ssh_stage3 comment="ssh: stage3 to blacklist"
add chain=input action=add-src-to-address-list address-list=ssh_stage3 address-list-timeout=1h protocol=tcp dst-port=22 connection-state=new src-address-list=ssh_stage2 comment="ssh: stage2"
add chain=input action=add-src-to-address-list address-list=ssh_stage2 address-list-timeout=15m protocol=tcp dst-port=22 connection-state=new src-address-list=ssh_stage1 comment="ssh: stage1"
add chain=input action=add-src-to-address-list address-list=ssh_stage1 address-list-timeout=5m protocol=tcp dst-port=22 connection-state=new src-address-list=!ssh_trusted comment="ssh: first try"
add chain=input action=accept src-address-list=MGMT comment="accept mgmt"
add chain=input action=accept in-interface-list=LAN protocol=udp dst-port=53,67 comment="dns+dhcp from LAN (if needed)"
add chain=input action=accept in-interface-list=LAN protocol=tcp dst-port=53 comment="dns tcp from LAN (if needed)"
add chain=input action=drop comment="drop everything else"

A few notes:

  • If the router already has input rules (the default config does), add puts the new rules at the end of the list. Run /ip firewall filter print first and see what's there. Either reorder the old rules or use place-before to put the new ones in the right spot.
  • If WireGuard or another VPN runs on the router itself, add an accept for its port before the last rule.
  • Order matters. The final drop rule must always stay last.

11) SSH brute-force protection

The five ssh: lines in the previous step do this. Any IP that keeps opening new SSH connections moves to the next list, stage by stage. On the fourth try it's blocked for a full day. This is the same pattern MikroTik's own docs use.

Two things to know:

  • Each SSH connection allows three password guesses, and the lists aren't cleared after a successful login. So you can block yourself. If Ansible or a monitoring tool connects over SSH, put its IP in ssh_trusted:
routeros@itcorv:~
/ip firewall address-list add list=ssh_trusted address=10.10.99.20 comment="ansible"
  • If you changed the SSH port, change 22 in every line.

If you do block yourself, connect another way and remove the entry:

routeros@itcorv:~
/ip firewall address-list remove [find list=ssh_blacklist address=10.10.99.15]

12) Disable unused ports

routeros@itcorv:~
/interface print
/interface set ether8 disabled=yes

Any port with no cable, or that isn't part of the network design, should be off. If someone plugs into it, they get nothing.

13) Send logs to a syslog server

Logs that live only on the router are useless after a reboot or a compromise. Send them to a separate server:

routeros@itcorv:~
/system logging action add name=siem target=remote remote=10.10.99.50 remote-port=514 remote-log-format=syslog
/system logging add topics=critical action=siem
/system logging add topics=error action=siem
/system logging add topics=warning action=siem
/system logging add topics=account action=siem

Put each topic on its own line. If you list several topics with commas in one rule, only messages that carry all of those topics are sent.

The router's clock has to be right too, or the logs are useless:

routeros@itcorv:~
/system ntp client set enabled=yes
/system ntp client servers add address=pool.ntp.org

If you're worried about international internet outages, run an internal NTP server and point the router at it.

14) Backup and export

routeros@itcorv:~
/system backup save name=core-rtr password="a-separate-backup-password"
/export show-sensitive file=core-rtr

The .backup file is for a full restore on the same router model. The .rsc file is plain text, so you can read it and keep it in Git. Because we used show-sensitive, it contains passwords, so store it somewhere safe.

Copy the files off the router from a Linux machine:

bash@itcorv:~
scp noc-ops@10.10.99.1:core-rtr.backup .
scp noc-ops@10.10.99.1:core-rtr.rsc .

15) Review users, scripts and schedulers

routeros@itcorv:~
/user print
/user active print
/system script print
/system scheduler print
/ip firewall nat print
/log print where topics~"critical"

Check anything you don't recognize. Attackers usually leave behind a user, a script or a scheduler so they can come back. If a critical log entry says the router is Flagged, follow MikroTik's guide for that.

Test MikroTik security after the config

First, on the router itself:

routeros@itcorv:~
/ip service print
/user print
/ip firewall filter print stats
/ip firewall address-list print where list~"ssh_"
  • In /ip service print, only winbox and ssh should be enabled, and only with the management network address.
  • In /user print, admin should show X (disabled).
  • In print stats, the counter on the final drop rule should slowly go up. That means it's working.

Then from outside. From a VPS outside your network, scan the router's public IP (only your own router):

bash@itcorv:~
nmap -Pn -p 21,22,23,80,443,8291,8728,8729 <WAN-IP>

Every port should show filtered. If you see open, or even closed, something in the firewall is wrong. Go back to step 10.

Finally, the log server. Run this on the syslog server and try one login with a wrong user:

bash@itcorv:~
sudo tcpdump -ni any udp port 514

You should see the failed login message.

Practical MikroTik security tips

  • Don't open ports, use a VPN. For remote management, run WireGuard on the router and accept Winbox only from inside the tunnel. MikroTik recommends the same.
  • Changing the Winbox port isn't security. It only cuts down lazy scanners. The real work is closing it from the WAN.
  • Don't forget IPv6. If IPv6 is on, add the same input rules under /ipv6 firewall filter. Otherwise the router is open on that side.
  • One change at a time. Change one thing, test, then move on. If you change ten things at once and lose access, you won't know which one did it.
  • Follow MikroTik's security advisories. When a fix comes out, update within the first few days, not months later.
  • Automate your exports. A scheduler that exports every night, plus a script that pulls the file and keeps it in Git, gives you both a backup and a change history. If you're new to Ansible, our DevOps roadmap shows where to start.

MikroTik security FAQ

Is MikroTik secure?

The router itself is fine; the problem is usually the config. MikroTik's default config blocks management from the WAN, but a lot of people open it by hand. If you stay updated and work through this checklist, you're in much better shape.

Is changing the Winbox port enough?

No. You'll just see fewer scans in the logs. Anyone seriously targeting you will find the new port. Winbox should be fully closed from the WAN.

How do I connect to a MikroTik remotely and safely?

With a VPN, ideally WireGuard. Set up a tunnel, put the tunnel address in the MGMT list, and accept Winbox and SSH only from there. No management port stays open to the internet.

Stable or long-term channel?

For enterprise networks we prefer long-term, because it changes less. Whichever you pick, update after every security advisory.

If you want us to go through this checklist on your network's routers, see our network security services. If you need the whole network designed and maintained, there are our networking services. The ITcorv team also offers a free 30-minute review.

Related posts