A new MikroTik shares the internet out of the box, but its default configuration is meant for a home, not an office, and plenty of routers on the internet still expose Winbox, the web interface and DNS. Here is the minimum worth doing in the first 15 minutes: updates, accounts, management access, the firewall and a backup.
1. Update RouterOS and the bootloader
Old Winbox vulnerabilities were used to pull routers into botnets en masse, so start with an update. Choose the stable or long-term channel:
/system package update set channel=stable /system package update check-for-updates /system package update install
After the reboot, upgrade the bootloader and reboot once more:
/system routerboard upgrade
2. Your own administrator instead of admin
Password guessing targets the admin login first. Create an administrator with your own name and a long password, log in as that user, then disable or remove admin:
/user add name=ivan group=full password="a-long-password" /user disable admin
A password of 16 characters or more is easy to get from the password generator.
3. Management only from your own network
Turn off the services you do not need: telnet, ftp, www, api, api-ssl. Leave Winbox and SSH open only to the local network or the administrator's address:
/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
A few more places where the router shows itself to the outside:
- DNS. With
allow-remote-requests=yesthe router answers DNS queries from the internet unless the firewall blocks them, and becomes an amplifier for DDoS attacks. - Access by MAC address. Keep Winbox by MAC and MAC-telnet on the local network only:
/tool mac-server set allowed-interface-list=LAN. - Neighbor discovery and SOCKS. Limit discovery to the LAN list and keep the SOCKS proxy off: attackers used it to relay other people's traffic.
4. Firewall: allow first, then drop
The default firewall is decent, but it is often broken by deleting "unneeded" rules. A proper input chain for the router looks like this:
- accept established and related connections;
- drop invalid packets;
- accept ICMP;
- accept everything from the local network (the LAN interface list);
- drop everything else.
The forward chain is built the same way, and port forwards are allowed with a "connection-nat-state=dstnat" rule. Do not forget IPv6: if your provider hands it out, /ipv6 firewall needs its own rules, or devices on your network will be reachable from the internet directly.
This whole set — services, the IPv4 and IPv6 firewall, MAC access, a new administrator — is built in one script by MikroTik basic protection, and brute-force protection adds blocking of scanners and password guessing.
5. Check the result
Run /export and paste the output into the MikroTik configuration audit: it finds open services, a missing drop rule in input, open DNS, suspicious scripts and port forwards. From the outside — a phone without Wi-Fi or another server — check that ports 8291 (Winbox), 22, 80 and 53 are closed.
To see why a particular packet passes or is dropped, use the firewall packet path page.
6. Backup and time
- Turn on time synchronization:
/system ntp client set enabled=yesand add servers. Without accurate time, logs are useless and certificates cannot be checked. - Keep two copies: a binary
/system backup save(with a password) and a text/export file=config. The first restores only to the same model; the second can be moved anywhere. - Scheduled backups by email or SFTP are set up by MikroTik backups.
What next
Once the basics are in place, you can tidy up the network: fixed DHCP addresses, VLANs, guest Wi-Fi, port forwarding and a second provider. The last two are covered in detail in the articles on port forwarding and on two providers.