Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagetext
themeFadeToGrey
[admin@v7_ccr_bgp] /system/history> print detail 
Flags: U - undoable, R - redoable, F - floating-undo 
 F redo=
      /ip firewall filter add action=accept chain=forward disabled=no log=no \
          log-prefix="" protocol=tcp
    undo=/ip firewall filter remove *4 action="filter rule added" by="admin" 
    policy=write time=oct/10/2019 18:51:05 

 F redo=/ip firewall filter add action=accept chain=forward 
    undo=/ip firewall filter remove *3 action="filter rule added" by="admin" 
    policy=write time=oct/10/2019 18:49:03 


U redo="" undo="" action="---" by="" policy=write time=sep/27/2019 13:07:35 
[admin@v7_ccr_bgp] /system/history> 


Safe Mode

Sometimes it happens that the router's configuration is changed It is sometimes possible to change router configuration in a way that will make the router inaccessible (except the from local console). Usually, this is done by accident, but there is no way to undo the last change when the connection to the router is already cut. Safe mode can be used to minimize such risk.

Safe mode is entered by pressing Ctrl-X. To save changes and quit safe mode, press Ctrl-X again. To The "Safe Mode" button in the Winbox GUI allows you to enter Safe Mode, while in the CLI, you can access it by either using the keyboard shortcut F4 or pressing [CTRL]+[X]. To exit without saving the made changes in CLI, hit Ctrl-D [CTRL]+[D].

[admin@MikroTik] ip route>[CTRL]+[X]
 
[Safe Mode taken]
[admin@MikroTik] ip route<SAFE>

Message Safe Mode taken is displayed and prompt changes to reflect that session is now in safe mode. In WinBox safe mode is enabled by toggling the Safe Mode toggle button on the left side of the toolbar. All configuration changes that are made (also from other login sessions), while the router is in safe mode, are automatically undone if the safe mode session terminates abnormally. You can see all such changes that will be automatically undone and tagged with an F flag in the system history:

[admin@MikroTik] /ip/route> route>

[Safe Mode taken]
[admin@MikroTik] /ip /route<SAFE> add
[admin@MikroTik] /ip /route<SAFE> /system /history/print print
Flags: U - undoable, R - redoable, F - floatingFLOATING-undo UNDO
Columns:
ACTION, BY, POLICY ACTION BY POLICY
F BY POLICY F route added admin write route 0.0.0.0/0 added admin write

Now, if the telnet connection , WinBox terminal (if the safe mode was enabled on WinBox terminal window), or WinBox connection (or winbox terminal) is cut, then after a while (TCP timeout is 9 minutes) all changes that were made while in safe mode will be undone. Exiting session by Ctrl-D  [Ctrl]+[D] also undoes all safe mode changes, while /quit does not.

If another user tries to enter safe mode, he's given the following message:

...

  • [u] - undoes all safe mode changes, and puts the current session in safe mode.
  • [r] - keeps all current safe mode changes, and puts the current session in a safe mode. The previous owner of safe mode is notified about this:
 
     [admin@MikroTik] ip firewall rule input
     
[Safe mode released by another user]

...

If too many changes are made while in safe mode, and there's no room in history to hold them all (currently history keeps up to 100 most recent actions), then the session is automatically put out of the safe mode, and no changes are automatically undone. Thus, it is best to change the configuration in small steps, while in safe mode. Pressing [Ctrl-]+[X] twice is an easy way to empty the safe mode action list.

System Backup and Restore

...