Why is a “clean” router dangerous?
In the Dojo howtos we often start from /system reset-configuration no-defaults=yes: it’s the best way to understand every step, with no hidden configuration. But the router that comes out of it:
- has the
adminuser (the first name every bot tries); - has services like telnet, FTP, WebFig, and API turned on, reachable from any interface;
- has no firewall: if the WAN has a public address, WinBox and SSH are exposed to the internet.
It takes only a few minutes online for the first access attempts to arrive. A router configured only for teaching purposes cannot be installed in production: first you do the hardening described here.
The example layout, with the addresses from my lab:
- WAN:
ether1,10.6.0.10/12, gateway and DNS10.0.0.1; - LAN:
bridge,192.168.88.1/24; - management VPN: WireGuard, network
10.255.255.0/24.
⚠️ Warning: adapt the interfaces and addresses to your network. To work out networks and masks there’s the Dojo’s IP calculator. And always work in Safe Mode (in WinBox the Safe Mode button, from the terminal Ctrl+X): if a rule locks you out, when you disconnect the router undoes the changes on its own.

Step 1: how do I update RouterOS?
The first defense is an up-to-date system: many RouterOS vulnerabilities (on the Dojo you’ll find the CVE cards) are already fixed in the recent versions.
/system package update set channel=stable
/system package update check-for-updates
/system package update install
After the reboot, on the RouterBOARDs you also update the board firmware (RouterBOOT), with a second reboot. On the CHR and on x86 this menu doesn’t exist and the step is skipped:
/system routerboard upgrade
/system reboot
Step 2: how do I replace the admin user?
The name admin is the first one every brute-force attack tries. Let’s create a user with a different name, in the full group, with a long password:
/user add name=gianni-adm group=full password="a-long-unique-password"
Disconnect and log back in with the new user, then disable admin:
/user disable admin
Don’t delete it before you’ve verified the new user works: that’s the fastest way to lock yourself out. If several of you work on it, one user per person: the log keeps track of who did what.
Step 3: which services do I leave on?
Only the ones you actually use. Let’s see what’s on:
/ip service print
Usually WinBox and SSH are enough. Everything else gets turned off:
/ip service disable telnet,ftp,www,api,api-ssl,reverse-proxy
To the services that remain you add the Available From field (available-from; in the old tutorials it’s called address, which still works but is deprecated), that is the networks they can be used from: the LAN and the management VPN.
/ip service set winbox available-from=192.168.88.0/24,10.255.255.0/24
/ip service set ssh available-from=192.168.88.0/24,10.255.255.0/24
From another address the router closes the connection right away, without showing the login. Watch out, though: the port stays visible. In the lab, from an address outside the list, the TCP connection to 8291 opened and was closed immediately after. What really hides the services is the firewall in step 5: Available From is the second belt, not the first. All the services and their ports are in the MikroTik manual: Services.
Step 4: how do I close the “side” services?
RouterOS has several network services that aren’t needed on the WAN and that you’d better limit to the LAN or turn off. First we define the interface lists, which we’ll use in the firewall too:
/interface list add name=WAN
/interface list add name=LAN
/interface list member add list=WAN interface=ether1
/interface list member add list=LAN interface=bridge
Then:
/ip neighbor discovery-settings set discover-interface-list=LAN
/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
/tool bandwidth-server set enabled=no
/ip proxy set enabled=no
/ip socks set enabled=no
/ip upnp set enabled=no
- Neighbor discovery and MAC server: the router shows itself (and can be managed over MAC with WinBox) only from the LAN;
- bandwidth-server: very handy for tests, but to turn on only when you need it;
- proxy, socks, UPnP: if you don’t use them, off.
What about public interfaces (transit, IX LANs)?
The command above works because there is a LAN list to limit discovery to. On an edge router, with interfaces facing only outward (transit, peering, an exchange point LAN), there is no trusted network: the router shouldn’t announce itself to anyone there. Neighbor discovery (MNDP, CDP, LLDP) tells anyone on the same segment the router’s name, model, RouterOS version and addresses, which is exactly what someone needs to pick a target. Turn discovery off completely:
/ip neighbor discovery-settings set discover-interface-list=none
The value none means “no interfaces”: the router stops sending announcements and stops recording neighbors.
IPv6 has a second announcement to watch: Router Advertisements (RA), the messages a router uses to tell hosts “I’m the gateway, here’s the prefix”. On public interfaces they must be removed in both directions:
# don't send RAs outward: the announcement stays on the LAN only
/ipv6 nd set [ find default=yes ] interface=bridge
# don't accept RAs from others (on a transit, IPv6 is static)
/ipv6 settings set accept-router-advertisements=no
- An RA sent on a transit or an IX is useless to everyone and exposes you: on an IX LAN every other router sees it.
- An RA received from another router can change your gateway and addresses: on an IX it’s a way to hijack traffic, by mistake or on purpose.
- If instead your provider gives you IPv6 through RAs (SLAAC), don’t turn off
accept-router-advertisementson that interface, or you lose connectivity.
Note: I haven’t tested this addition in the lab yet like steps 1–7; before using it on a production router, check the commands (/ipv6 nd print, /ipv6 settings print) on your RouterOS version.
If the router acts as DNS for the LAN, allow-remote-requests=yes is fine only with the firewall in step 5, which blocks the DNS requests coming from the internet; otherwise the router becomes an amplifier for DDoS attacks.
Step 5: what’s the minimal firewall?
The principle is simple: from the WAN only what I asked for gets in. The router accepts the replies to connections already open, ping, the management VPN, and the LAN’s traffic; everything else coming from the internet is dropped.
/ip firewall filter
add chain=input action=accept connection-state=established,related,untracked comment="IN: replies"
add chain=input action=drop connection-state=invalid comment="IN: invalid packets"
add chain=input action=accept protocol=icmp comment="IN: ping"
add chain=input action=accept protocol=udp dst-port=13231 in-interface-list=WAN comment="IN: management WireGuard"
add chain=input action=accept in-interface-list=LAN comment="IN: from the LAN"
add chain=input action=accept in-interface=wg-admin comment="IN: from the management VPN"
add chain=input action=drop comment="IN: everything else"
add chain=forward action=fasttrack-connection connection-state=established,related comment="FW: fasttrack"
add chain=forward action=accept connection-state=established,related,untracked comment="FW: replies"
add chain=forward action=drop connection-state=invalid comment="FW: invalid packets"
add chain=forward action=drop in-interface-list=WAN connection-nat-state=!dstnat comment="FW: nothing from the internet unless port-forwarded"
Order matters: the rules are read top to bottom and the first one that matches wins. The final drop rule in the input chain is the one that closes the router to the internet: put it only after you’ve verified that the LAN rule lets you in (this is where Safe Mode saves you).
On the CRS3xx and CRS5xx switches and on the CCR2116 and CCR2216 the fasttrack rule also accepts hw-offload=yes, which hands the connections off to the switch chip. On the other routers that parameter doesn’t exist: RouterOS answers bad parameter hw-offload and the rule isn’t created. That’s why it’s not here.
With IPv6 the reasoning is the same, and you have to do it even if you don’t use IPv6: many ISPs assign it without asking.
/ipv6 firewall filter
add chain=input action=accept connection-state=established,related,untracked comment="IN6: replies"
add chain=input action=drop connection-state=invalid comment="IN6: invalid"
add chain=input action=accept protocol=icmpv6 comment="IN6: ICMPv6 (essential)"
add chain=input action=accept protocol=udp dst-port=546 src-address=fe80::/10 comment="IN6: DHCPv6 client"
add chain=input action=accept in-interface-list=LAN comment="IN6: from the LAN"
add chain=input action=drop comment="IN6: everything else"
add chain=forward action=accept connection-state=established,related,untracked comment="FW6: replies"
add chain=forward action=drop connection-state=invalid comment="FW6: invalid"
add chain=forward action=accept protocol=icmpv6 comment="FW6: ICMPv6"
add chain=forward action=drop in-interface-list=WAN comment="FW6: nothing from the internet"
In IPv6 you don’t block ICMP: without it, the network doesn’t work (neighbor discovery, path MTU).
Step 6: how do I manage the router remotely?
With a VPN, never by exposing WinBox or SSH on the internet. WireGuard is built into RouterOS 7, it’s fast, and it’s set up in a few commands:
/interface wireguard add name=wg-admin listen-port=13231
/ip address add address=10.255.255.1/24 interface=wg-admin
/interface wireguard print
The VPN’s network (10.255.255.0/24) has to be different from every one you already use: check it with the IP calculator.
The last command shows the router’s public key, to put into the WireGuard client on your laptop. Then you add the laptop as a peer, with its public key:
/interface wireguard peers add interface=wg-admin public-key="LAPTOP-PUBLIC-KEY" \
allowed-address=10.255.255.2/32 comment="Gianni's laptop"
The firewall in step 5 already accepts UDP port 13231 from the WAN and the traffic arriving on the wg-admin interface; the services in step 3 already accept the 10.255.255.0/24 network. From the laptop, with the VPN on, you get into WinBox at 10.255.255.1.
Step 7: what do I check at the end?
A quick verification, to repeat on every router before handing it over:
/user print
/ip service print where !disabled
/ip firewall filter print stats
/ipv6 firewall filter print stats
/system package update print
Then two tests from the outside (for example from a phone with no WiFi): WinBox and SSH toward the WAN address must not answer, while with the VPN on they have to work.
One last thing: a backup of the configuration, kept off the router.
/system backup save name=after-hardening
/export file=after-hardening
To dig deeper, MikroTik has its own checklist in the MikroTik manual: Securing your router.
How it works inside, in the Dojo Knowledge base: interface lists, firewall chains and rule order, Safe Mode, address lists.
Tested in the lab on PNETLab with a CHR running RouterOS 7.24.5 (stable), starting from a router reset with no-defaults=yes: all the commands in steps 1-7, IPv4 and IPv6 firewall, WAN ports tested from an external client before and after the firewall, management WireGuard VPN from a second router. The RouterBOOT update can’t be tested on a CHR.
Frequently asked questions
Does a MikroTik reset with no-defaults=yes have a firewall?
No. With no-defaults=yes the router comes back up with no firewall rule and with the management services on: fine for the lab, but before putting it on a network it needs hardening.
Is changing the admin user’s password enough?
It’s the minimum, but not enough: better to create a user with a different name in the full group and disable admin, so a brute-force attack has to guess the username too.
What is Available From for in the IP services?
The Available From field (available-from in /ip service) limits a service, for example WinBox or SSH, to the listed networks: from another address the router closes the connection right away. The port stays visible, though, so you still need the input firewall.
Can I leave WinBox open on the internet with a strong password?
Better not: in the past the WinBox service vulnerabilities were exploited with no password needed. Remote management is done through a VPN, for example WireGuard, keeping WinBox closed toward the internet.
Do I need the IPv6 firewall even if I don’t use IPv6?
Yes. Many ISPs assign IPv6 addresses automatically: without an IPv6 firewall the router and the LAN devices can be reachable from the internet without you knowing.



