Case File: The Open Router
A new MikroTik router comes out of its box with the default login, every service switched on and nothing asking who you are. On a simulated RouterOS router in this page, close the door before anything else is connected: name it, replace the default account, switch off the insecure services, limit management to the office network, set the clock and stop the router announcing itself. Names, networks and servers are generated for you alone.
Sabi Logistics · Router 1
The Open Router
A new branch router is about to be connected, and the factory settings would let anybody in
Halima CISO · Phone call
Halima. A new router has arrived for a branch office and it is in its factory state. I know what that means: the account called admin with no password, every management service switched on, and a router that tells anybody on the cable exactly what it is. If we plug it in like that, it will be found before lunch.
I do not want it plugged in until it is closed. You will configure it from the console, before it is connected to anything. I have a short list: a proper name, one named administrator and the default account gone, the insecure services off, management only from the office network, the clock set, and the announcements off.
Do it in an order that cannot lock you out. And keep the commands: the next branch will get the same treatment.
The brief
What you need to know first.
- RouterOS is organised in menus. Paths such as
/user,/ip serviceand/system identityare menus. Inside a menu you use a few verbs:add,set,remove,print,enable,disable.printshows what is there, and it is how you check your own work: a command that gives no output usually worked. - The factory state is open on purpose. The router ships with one account,
admin, with an empty password, and services that are convenient and unsafe:telnetandftpsend everything including passwords in the clear,wwwis the web page without encryption,apiis the unencrypted programming interface. - Users.
/user add name=NAME group=full password=...creates an account in a group (read,write,full). Use a long password (at least 12 characters)./user disable adminswitches the default account off; a disabled account cannot log in but can be re-enabled by another administrator. - Order matters for access. Create the new user, log in as it (on a real router: open a second session) and only then disable the old one. Never remove access before you have proved the replacement works.
- Services are the fixed items of
/ip service: you canset,enableanddisablethem but not add new ones./ip service disable telnetswitches one off./ip service set ssh address=192.168.10.0/24limits who may connect to that service to one network; keep SSH and WinBox for management and give them an address restriction. - NTP (
/system ntp client set enabled=yes servers=...) sets the clock. Logs, certificates and the scheduler depend on correct time. - Discovery.
/tool mac-server set allowed-interface-list=nonestops the router accepting connections by MAC address, and/ip neighbor discovery-settings set discover-interface-list=nonestops it announcing itself to neighbours. Where you need them, turn them on for one trusted interface list only. - The lab router is a simulation of RouterOS in this page. It understands the commands of this job, and a command it does not know says so. Type
hintin the terminal to see help for the first task that is not done yet, and press Check my answers to test the router.
The lab generates the router name, the administrator, the office network and the time server for you alone.
Preparing your router…
Halima: “Good. Now I have a question about the last step. You limited SSH to the office network. What happens when the person who has to fix this router is not in the office, because it is Sunday and the office is locked? And what is the layer of protection that the address restriction gives you, if the firewall is already there?”
🔒 The debrief unlocks when you close the case. Finish the lab above.
The debrief
Halima: “So the address restriction is a second wall, and the way in for a remote engineer is a VPN, not an open port.”
What a senior engineer would do next. Put management behind a VPN (WireGuard is built in) and restrict the services to the VPN’s addresses as well as the office, so a Sunday fix is possible without opening anything to the internet. Add the firewall as the first wall (drop everything from the WAN list on the input chain) and keep the service restrictions as the second. Use keys for SSH and turn off password logins once they work. Keep a console cable and an out-of-band path for the day you lock yourself out. Save the configuration with /export and keep the file, without secrets, in version control: it is the template for the next branch. And use Safe Mode on a real router when you change anything that could cut your own connection: if the session drops, the router undoes the changes.
The trap. Hardening in the wrong order. Disabling the default account before the new one works, or restricting management to a network that you are not on, leaves you outside your own router.
Write the hardening record
Write the record for the branch router: what you changed and why (the default account, the insecure services, the management restriction, the clock and the discovery protocols), the order you worked in and why that order cannot lock you out, how you checked your work, and what you would add so that a remote engineer can still reach the router on a Sunday without opening it to the internet.
🧪 Want to practise this on your own computer? See how to set up your lab →