In short: Safe Mode is RouterOS’s safety net: while it’s on, the router notes down every change and, if the session that took it drops, it undoes them on its own. You turn it on with Ctrl+X (or F4) in the terminal and with the Safe Mode button in WinBox. It holds at most 100 actions and doesn’t cover the commands that reboot the router.
What is Safe Mode?
It’s a parachute tied to your session. You work on a remote router, you write a wrong firewall rule, the connection closes: without Safe Mode you’re locked out, and the only way is to go on site or call someone with the console. With Safe Mode the router notices the session died badly and puts the configuration back the way it was before you started.
The manual says it clearly: when the connection is already cut, there’s no way to undo the last change. Safe Mode serves to reduce exactly that risk. It doesn’t eliminate it: it reduces it, and further on we’ll see where its coverage ends.
How do you turn it on from the terminal?
You press Ctrl+X (or F4) at the prompt. The router answers Taking Safe Mode session... Success! and the wording <SAFE> appears in the prompt.
[admin@MikroTik] > (premi Ctrl+X)
Taking Safe Mode session... Success!
[admin@MikroTik] <SAFE>
From here on every change is “on trial”. To exit you have three ways, and they do different things:
- Ctrl+X again: the router answers
Releasing Safe Mode... Success!and the changes stay. It’s the gesture with which you say “all right, I confirm”; - Ctrl+D: you close the session and undo all the changes made in Safe Mode;
/quit: the router warns youYou are in Safe Mode. Quitting will unroll changes. Quit? [y/N]. Answeryand the changes are undone; answernand you stay connected, still in Safe Mode. The manual still says that/quitdoesn’t undo: on RouterOS 7.24.5 that’s no longer the case.
Remember it like this: the only way to keep the changes is Ctrl+X. Any other exit (Ctrl+D, /quit, the terminal closed, the connection dropping) means “go back” to the router.
And in WinBox?
In WinBox there’s the Safe Mode button in the top bar, next to Undo and Redo. You press it, it stays lit, and from that moment the same mechanism as the terminal applies. You press it again to exit and confirm. In WebFig you find the same button in the top bar.
Safe Mode doesn’t belong to a window: it belongs to the router. The manual says that all the changes made while the router is in Safe Mode are undone, including the ones made by other sessions. If a colleague changes something over SSH while you hold Safe Mode in WinBox and your session drops, their work goes too.
What happens if the connection drops?
The router undoes everything. If the session closes cleanly, for example because you close the terminal, in the lab the changes disappeared at once. If instead the network drops and the router no longer sees anything arrive, the manual indicates that the undo comes “after a while”: the TCP timeout is 9 minutes.
In practice: you’ve locked yourself out, the router no longer answers, and for a few minutes nothing happens. Don’t panic and don’t reboot the router from the socket, if someone is on site. Wait. Within ten minutes or so the configuration goes back to what it was and you get back in.
⚠️ Warning: the rollback triggers only if the session ends abnormally. If you exit with Ctrl+X, as far as the router is concerned you’ve confirmed.
How do I see what would be undone?
You see it in /system history: the actions made in Safe Mode have the F flag (floating-undo), that is “automatically undoable”.
[admin@MikroTik] <SAFE> /ip firewall address-list add list=prova address=203.0.113.5
[admin@MikroTik] <SAFE> /system history print where action~"address"
Flags: U - UNDOABLE, F - FLOATING-UNDO
Columns: ACTION, BY, POLICY, TIME
ACTION BY POLICY TIME
F address list entry added admin write 2026-10-10 17:09:06
U address list entry removed admin write 2026-10-10 17:01:29
The actions with the U flag, instead, are already confirmed: they don’t disappear on their own, but you can still remove them by hand with /undo.
It’s the same register the Undo and Redo buttons of WinBox work on. /system history print detail shows, for each action, the exact command that would be run to undo or redo it, even when you did it from WinBox. How undo and redo work you’ll find in the MikroTik manual: Configuration Management.
How many changes does it hold in memory?
At most 100 actions: that’s the size of the history. If you make more, the router takes you out of Safe Mode on its own and undoes nothing. Watch out: every command inside a loop counts. In the lab a :for that adds 50 entries to an address list was undone in full when the session closed; with 105 entries they all stayed, and the prompt still showed <SAFE>. From that moment you’re without a net, and maybe you don’t notice.
The manual advises working in small steps. The trick is to press Ctrl+X twice: you exit (confirming what you’ve done so far) and get right back in, with the action list empty. You have 100 actions of margin again, and the already-tested piece doesn’t go back if the next step goes wrong.
What happens if another user is already in Safe Mode?
Safe Mode is held by one session at a time. According to the manual, if you ask for it while someone else has it, RouterOS makes you choose:
Hijacking Safe Mode from someone - unroll/release/don't take it [u/r/d]:
- u (unroll): undo all the other’s Safe Mode changes and take Safe Mode yourself;
- r (release): keep their changes (they become confirmed) and take Safe Mode yourself. The other sees the message
[Safe mode released by another user]; - d: leave everything as it is and don’t take it.
In the lab, with the same user in two sessions, the second took Safe Mode with a plain Success!, no questions asked, and the first’s changes were undone. So don’t count on the question: if two of you work on the same router, talk first.
What does it NOT cover?
Safe Mode lives inside the session and preserves the configuration changes. That’s why, the manual says, it is ignored for the commands that require a reboot, like resetting the configuration or restoring a backup. A /system reset-configuration launched in Safe Mode doesn’t undo when the session drops: the router just restarts. (If you need a teaching reset, it’s the one in the Basic hardening.)
It doesn’t protect you either when you’ve already confirmed: after Ctrl+X or going over the 100 actions, the changes are final. Only /undo remains and, if you can no longer get in, another login.
When do I use it?
Every time the change can cut the branch you’re sitting on:
- firewall from remote: the drop rule at the bottom of the
inputchain, the order of the rules, an access address list. It’s the case of the minimal hardening firewall and of port knocking: if the lock doesn’t open, the router locks you out; - address change on the interface you’re connected from, for example
/ip address add address=10.6.0.2/12 interface=ether1(the addresses are the lab’s: work out yours with the IP calculator) and then the removal of the old one; - VLAN on the management port: moving the port you come in from under a bridge with VLAN filtering is the classic way to vanish;
- scripts pasted into the terminal: ten lines copied from a note make ten changes, and one wrong one is enough;
- work on the link you go through: even a wireless scan on a remote router should be done with Safe Mode on, if in the same session you touch anything else.
The right move is always the same: Safe Mode, change, open a second fresh session and check you can get in. Only then confirm with Ctrl+X.
What are the typical mistakes?
- Confirming too soon. You apply the rule, the open session keeps working (the connections already established go through), you press Ctrl+X. Then you close and can’t get back in. Always test with a new connection before confirming;
- Exiting with
/quitthinking you’re confirming. In Safe Mode/quitundoes, and it even asks you. To keep the changes you need Ctrl+X; - Pasting a long script. Past 100 actions Safe Mode turns off on its own and without going back. Break the script up and use Ctrl+X twice between one block and the next;
- Rebooting after the lockout. You’ve locked yourself out and ask someone to cut the power: wait out the timeout minutes before deciding that Safe Mode didn’t work;
- Trusting it for the reset. Resetting the configuration and restoring a backup go through the reboot: Safe Mode doesn’t cover them.
Tested in the lab on a routerboard with RouterOS 7.24.5 (stable), from an SSH terminal: Safe Mode with Ctrl+X, confirm with the second Ctrl+X, undo with Ctrl+D, with /quit (answer y; with n you stay in Safe Mode) and with the session closed abruptly, the F flag in /system history, the 100-action limit with a :for (50 undone, 105 kept), a second session of the same user taking Safe Mode. The 9-minute timeout, WebFig, and the u/r/d choice are from the documentation.
Frequently asked questions
How do I turn on Safe Mode from the terminal?
With Ctrl+X or F4. The router answers Taking Safe Mode session... Success! and the prompt shows <SAFE>. Another Ctrl+X exits and confirms the changes.
How long does the router take to undo the changes after a disconnection?
If the session closes cleanly, right away. If the network drops and the router doesn’t know you’ve vanished, the manual indicates the TCP timeout of 9 minutes; after that, the changes made in Safe Mode are undone.
How do I exit Safe Mode keeping the changes?
Only with Ctrl+X. Ctrl+D and /quit close the session and undo everything you did in Safe Mode; /quit asks you first.
How many changes can Safe Mode undo?
Up to 100 actions, the capacity of the history. Beyond that, the router exits Safe Mode on its own and undoes nothing. Ctrl+X twice empties the list and starts over from zero.
Does Safe Mode undo a configuration reset?
No. Safe Mode is ignored for the commands that require a reboot, like resetting the configuration or restoring a backup.



