Versions Compared

Key

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

Table of Contents

Overview

This article describes a set of commands used for configuration management.

...

Following command parameters are accepted:

PropertyDescription
compactOutput only modified configuration, the default behavior
fileExport configuration to a specified file. When the file is not specified export output will be printed to the terminal
hide-sensitiveHide sensitive information, like passwords, keys, etc.
verboseWith this parameter, the export command will output whole configuration parameters and items including defaults.


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

...

Here is the list of all menus containing default system entries

MenuDefault Entry
/interface wireless security-profilesdefault
/ppp profile"default", "default-encryption"
/ip hotspot profile default
/ip hotspot user profile default
/ip ipsec policy default
/ip ipsec policy group default
/ip ipsec proposaldefault
/ip ipsec mode-confread-only
/ip smb shares pub
/ip smb users guest
/ipv6 nd any
/mpls interfaceall
/routing bfd interfaceall
/routing bgp instancedefault
/routing ospf instancedefault
/routing ospf areabackbone
/routing ospf-v3 instancedefailt
/routing ospf-v3 areabackbone
/snmp communitypublic
/tool mac-server mac-winboxall
/tool mac-serverall
/system logging"info", "error", "warning", "critical"
/system logging action"memory", "disk", "echo", "remote"
/queue type"default", "ethernet-default", "wireless-default", "synchronous-default", "hotspot-default", "only-hardware-queue", "multi-queue-ethernet-default", "default-small"


Configuration Import

Root menu command import allows running configuration script from the specified file. Script file (with extension ".rsc") can contain any console command including complex scripts.

...

Import command allows to specify following parameters:

PropertyDescription
from-lineStart executing the script from the specified line number
file-nameName of the script (.rsc) file to be executed.
verboseReads each line from the file and executes individually, allowing to debug syntax or other errors more easily.

Auto Import

It is also possible to automatically execute scripts after uploading to the router with FTP or SFTP. The script file must be named with extension *.auto.rsc. Once the commands in the file are executed rsc file is replaced by , a new *.auto.log file is created which contains import success or failure information.

Configuration Reset

RouterOS allows resetting configuration with /system reset-configuration command

...

It is possible to override default reset behavior with the parameters below:

PropertyDescription
keep-usersDo not remove existing users from the configuration
no-defaultsDo not load default configuration, just clear configuration
skip-backupSkip automatic backup file generation before reset
run-after-resetRun specified .rsc file after reset. That way you can load your custom configuration.


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

...