Security hardening

MikroTik Router Security Hardening Checklist

A practical checklist to secure a MikroTik router: admin users, services, MAC and neighbor access, input firewall, DNS, SSH settings, updates and time sync.

Commands in this article follow RouterOS v7 documentation but have not yet been marked as lab-tested on this site. Always test changes in a lab or maintenance window and keep a backup.

Problem

Many MikroTik routers are hacked because they are left with default settings: open services, the default admin user, old firmware and no input firewall. This checklist closes the common holes.

Symptoms (signs of a compromised router)

  • Unknown users, scripts, schedulers or proxy settings.
  • High CPU and traffic you cannot explain.
  • Log entries with many failed logins from foreign IPs.

Likely causes

Open management services on the WAN, weak or default passwords, outdated RouterOS, and a missing input firewall.

Prerequisites

  • Access from the LAN and a fresh export: /export file=before-hardening.
  • Use WinBox Safe Mode while you work.

Solution (WinBox / CLI)

1. Use your own admin account and disable admin:

RouterOS CLI
/user add name=netadmin group=full password=Use-A-Long-Unique-Password
/user disable admin

Log in again as netadmin before disabling admin.

2. Turn off services you do not use and limit the rest to the LAN:

RouterOS CLI
/ip service disable telnet,ftp,www,api,api-ssl
/ip service set winbox address=192.168.88.0/24
/ip service set ssh address=192.168.88.0/24

3. Limit MAC access and discovery to the LAN:

RouterOS CLI
/tool mac-server set allowed-interface-list=LAN
/tool mac-server mac-winbox set allowed-interface-list=LAN
/tool mac-server ping set enabled=no
/ip neighbor discovery-settings set discover-interface-list=LAN

4. Turn off unused features:

RouterOS CLI
/ip proxy set enabled=no
/ip socks set enabled=no
/tool bandwidth-server set enabled=no
/ip upnp set enabled=no

5. Input firewall. Make sure the input chain ends with a drop for everything not from the LAN (see Basic internet setup) and that DNS is not open to the WAN.

6. Stronger SSH and up-to-date software:

RouterOS CLI
/ip ssh set strong-crypto=yes
/system package update set channel=stable
/system package update check-for-updates

7. Correct time (needed for logs and certificates). On RouterOS v7:

RouterOS CLI
/system clock set time-zone-name=Asia/Dhaka
/system ntp client set enabled=yes servers=time.google.com

Verification

  • From outside (mobile data), WinBox and SSH to your public IP must fail.
  • /user print, /system script print, /system scheduler print and /ip proxy print show only what you created.
  • /log print where topics~"account" shows logins.

Common errors

  • Disabling admin before testing the new user.
  • Limiting WinBox to an address list that does not include your own PC.
  • Leaving UPnP on: devices can open ports on your router by themselves.

Rollback

Re-enable a service or user with enable, for example /ip service enable www or /user enable admin. Compare with before-hardening.rsc if something stops working.

Go deeper in class

This topic is covered hands-on in MTCSE — MikroTik Certified Security Engineer.

View MTCSE
WhatsApp