Versions Compared

Key

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

...

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

Image RemovedImage Added

Message Safe Mode taken is displayed and prompt changes to reflect that session is now in safe mode. 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:

Code Block
languageros
[admin@MikroTik] /ip/route> 

...


[Safe Mode taken] 

...


[admin@MikroTik] /ip/route<SAFE> add 

...


[admin@MikroTik] /ip/route<SAFE> /system/history/print 

...


Flags: U, F - FLOATING-UNDO 

...


Columns:

...


 ACTION, BY, POLICY ACTION BY POLICY 

...


F route 0.0.0.0/0 added admin write 

Now, if the telnet 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] also undoes all safe mode changes, while /quit does not.

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

Code Block
languageros
[admin@MikroTik] >
Hijacking Safe Mode from someone - unroll/release/don't take it [u/r/d]:

...

  • [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:
Code Block
languageros
[admin@MikroTik] ip firewall rule input

...


[Safe mode released by another user]

...

  • [d] - leaves everything as-is.

...

Example to save and load backup file:

Code Block
languageros
[admin@MikroTik] > system backup save name=test password=123

...


Configuration backup saved

...


[admin@MikroTik] > file print

...


# NAME TYPE SIZE CREATION-TIME

...


0 test.backup backup 12567 sep/08/2004 21:07:50

...


[admin@MikroTik] >

...


[admin@MikroTik] > system backup load name=test password=123

...


Restore and reboot? [y/N]:

...


y

...


Restoring system configuration

...


System configuration restored, rebooting now

Configuration Export and Import

...

For example export configuration from /ip address the menu and save it to a file:

Code Block
theme
languagetextrosFadeToGrey
    [admin@MikroTik] > /ip address print
    Flags: X - disabled, I - invalid, D - dynamic
    #   ADDRESS            NETWORK         BROADCAST       INTERFACE
    0   10.1.0.172/24      10.1.0.0        10.1.0.255      bridge1
    1   10.5.1.1/24        10.5.1.0        10.5.1.255      ether1
    [admin@MikroTik] > /ip address export file=address
    [admin@MikroTik] > /file print
    # NAME                            TYPE         SIZE       CREATION-TIME
    0  address.rsc                     script       315        dec/23/2003 13:21:48
    [admin@MikroTik] >

...

For example, the IPSec default policy will not be exported, and if we change one property then only our change will be exported:

Code Block
languagetextros
themeFadeToGrey
    [admin@rack1_b4] /ip ipsec policy> print
    Flags: T - template, X - disabled, D - dynamic, I - inactive, * - default
    0 T * group=default src-address=::/0 dst-address=::/0 protocol=all
          proposal=default template=yes
    [admin@rack1_b4] /ip ipsec policy> export
    # apr/02/1970 17:59:14 by RouterOS 6.22
    # software id = DB0D-LK67
    #
    [admin@rack1_b4] /ip ipsec policy> set 0 protocol=gre
    [admin@rack1_b4] /ip ipsec policy> export
    # apr/02/1970 17:59:30 by RouterOS 6.22
    # software id = DB0D-LK67
    #
    /ip ipsec policy
    set 0 protocol=gre

...

For example, load saved configuration file

Code Block
languagetext
themeFadeToGrey
ros
    [admin@MikroTik] > import address.rsc
    Opening script file address.rsc

    Script file loaded and executed successfully
    [admin@MikroTik] >

Import command allows to specify the following parameters:

...

For example hard reset configuration without loading default config and skipping backup file:

Code Block
languagetextthemeFadeToGreyros
[admin@MikroTik] > /system reset-configuration no-defaults=yes skip-backup=yes
Dangerous! Reset anyway? [y/N]: y

...