Skip to content
MikroTik RouterOS Docs

Console (Command Line Interface)

For the impatient: navigate and configure efficiently.

# Navigate to a menu level
/ip/address
# Execute command from any location using full path
/ip/route/print
# Quick typing with abbreviations
pi 10.1 c 3 si 100
# Equivalent to: ping 10.0.0.1 count 3 size 100
# Enable safe mode before risky changes (press Ctrl+X)
# Changes auto-revert if connection drops
# Tab completion - press Tab to complete commands
/ip/fir[Tab] # completes to /ip/firewall

What this does: The console provides text-based access to all RouterOS configuration and management features. Commands are organized hierarchically in menu levels, with powerful features like auto-completion, safe mode, and command history.

When to use this:

  • Remote administration via SSH or Telnet
  • Local access via serial console
  • Scripting and automation
  • Terminal within WinBox
  • Direct keyboard/monitor connection

Access methods:

  • SSH (recommended, encrypted)
  • Serial console (physical access)
  • Telnet (legacy, unencrypted)
  • WinBox terminal window
  • Keyboard and monitor (direct)

Prerequisites:

  • Network access to router (for SSH/Telnet)
  • Serial cable and terminal software (for serial)
  • Valid user credentials

RouterOS organizes commands in a hierarchical menu system. The prompt shows your current location:

[admin@MikroTik] /ip/route>
CommandAction
/Return to root level
..Move up one level
/path/to/menuJump to specific menu
menu printExecute command in submenu
# Start at root
[admin@MikroTik] >
# Navigate to IP address menu
/ip/address
[admin@MikroTik] /ip/address>
# Move up one level
..
[admin@MikroTik] /ip>
# Return to root
/
[admin@MikroTik] >
# Execute command without changing location
/ip/route/print
[admin@MikroTik] >

Master these shortcuts for efficient CLI navigation:

KeyFunction
TabAuto-complete command/argument
Tab TabShow all matching options
F1Context-sensitive help (v7+)
?Help (alternative)
Ctrl+X or F4Toggle safe mode
Ctrl+CInterrupt current command
Ctrl+DLogout (empty line only)
KeyFunction
Home or Ctrl+ABeginning of line
End or Ctrl+EEnd of line
Ctrl+KDelete from cursor to end
Ctrl+UDelete from cursor to start
DeleteDelete character at cursor
BackspaceDelete character before cursor
Ctrl+L or F5Repaint screen
KeyFunction
Up or Ctrl+PPrevious command
Down or Ctrl+NNext command
F3 or Ctrl+RSearch command history
KeyFunction
F7Toggle HotLock mode (auto-complete)
#Send internal chat message

Commands and arguments can be shortened if unambiguous:

# Full command
ping 10.0.0.1 count 3 size 100
# Abbreviated
pi 10.1 c 3 si 100
# More examples
/in pr # /interface print
/ip r pr # /ip route print
/sy re # /system reboot

Tab completion works with:

  • First letters of commands
  • Distinctive substrings
  • Property names and values
/interface x[Tab] # completes to: /interface export
/interface mt[Tab] # completes to: /interface monitor-traffic
/ip address add a[Tab] # completes to: address=

Press F7 to enable HotLock mode. The prompt changes to >> and commands auto-complete as you type:

[admin@MikroTik] >>

Press F7 again to disable.

Safe mode automatically reverts configuration changes if your session terminates unexpectedly (e.g., connection drops, SSH timeout).

Press Ctrl+X or F4. The prompt shows <SAFE>:

[admin@MikroTik] /ip/address<SAFE>
  1. Enter safe mode before making risky changes
  2. All changes are tracked in system history (flagged with F)
  3. If session ends abnormally, changes automatically undo
  4. TCP timeout is approximately 9 minutes
ActionResult
Ctrl+XSave changes, exit safe mode
Ctrl+DDiscard changes, exit safe mode
/quitSave changes, logout
/system/history/print

Changes made in safe mode show an F flag.

If another user has safe mode active:

Hijacking Safe Mode from someone - unroll/release/don't take it [u/r/d]:
  • u (unroll): Undo their changes, take safe mode
  • r (release): They keep safe mode
  • d (don’t take): Cancel your request

Safe Mode Limitations

  • History holds maximum 100 actions
  • If exceeded, safe mode automatically disables without undo
  • Commands requiring reboot (reset, restore) are not covered
  • Work in small chunks for best results

These commands are available in most menu levels:

CommandDescription
printDisplay items; assigns temporary numbers
addCreate new item
setModify existing item
removeDelete item
findReturn items matching criteria
editOpen editor for text values
moveReorder items in list
enableEnable disabled item
disableDisable enabled item
exportOutput configuration commands

The print command supports various output formats:

# Basic print
/interface/print
# Tabular format
/interface/print brief
# Property=value format
/interface/print detail
# Count items only
/interface/print count-only
# Filter output
/interface/print where type=ether
# Show specific properties
/interface/print proplist=name,type,mtu
# Auto-refresh every 2 seconds
/interface/print interval=2
# Export to file
/interface/print file=interfaces
# No paging (continuous output)
/interface/print without-paging

Item numbers are assigned by print and are temporary:

  • Reset each session
  • Change after print commands
  • Useful for interactive batch operations
# Use numbers for quick batch operations
/interface/set 0,1,2 mtu=1460

Item names are stable identifiers:

  • Persist across sessions
  • Preferred in scripts
  • More reliable
# Use names in scripts
/interface/set ether1 mtu=1460

Do not use item numbers in scripts. They are session-specific and unreliable.

Append parameters after username with +:

admin+ct80w
ParameterDefaultDescription
wautoTerminal width
hautoTerminal height
conColors (off to disable)
toffDisable terminal auto-detection
eonEnable “dumb” terminal mode

Example: admin+c disables colors for serial connections.

For physical access via serial port:

ParameterRouterBOARDx86
Baud rate1152009600
Data bits88
Stop bits11
ParityNoneNone
Flow controlNoneNone
  1. Connect null-modem cable (or USB-serial adapter)
  2. Configure terminal software (PuTTY, screen, minicom)
  3. Set parameters: 115200, 8N1, no flow control
  4. Press Enter to see login prompt
/port/print detail

Example output:

name=serial0 used-by="Serial Console" baud-rate=115200 data-bits=8
parity=none stop-bits=1 flow-control=none
# Disable console first
/system/console/disable 0
# Change baud rate in RouterBOARD settings
/system/routerboard/settings/set baud-rate=9600
# Re-enable console
/system/console/enable 0
# Reboot to apply
/system/reboot

View and configure console behavior:

/console/settings/print
PropertyDescription
sanitize-namesReplace reserved characters in filenames with underscores

Temporarily lock your session (requires password to unlock):

:lock

Enter password to resume.

Send messages to all logged-in administrators:

# Anyone online?

All active CLI users see the message.

Commands can span multiple lines. The prompt shows unclosed elements:

[admin@MikroTik] > {
{...
PromptMeaning
{...Open brace
(...Open parenthesis
"...Open quote
\...Line continuation
# Export current level
/ip/address/export
# Export to file
/export file=full-config
# Export compact (no defaults)
/export compact
# Export specific section
/ip/firewall/export file=firewall-rules
# Enter safe mode
# Press Ctrl+X
# Make risky firewall change
/ip/firewall/filter/add chain=input action=drop
# Test connectivity... if OK:
# Press Ctrl+X to save
# If locked out, wait for TCP timeout (~9 minutes)
# Changes auto-revert

Confirm console access and settings:

/console/settings/print
/system/resource/print

Shows current user and session information.

/system/history/print

Shows recent configuration changes with flags.

# Enter safe mode (Ctrl+X)
/system/identity/set name=test-safe-mode
/system/history/print
# Should show F flag on the identity change
# Exit safe mode (Ctrl+X) to save, or Ctrl+D to discard
SymptomCauseSolution
Commands not auto-completingAmbiguous inputPress Tab twice to see options
Safe mode not activatingAnother user has itChoose unroll/release/don’t take
Changes not saved after safe modeUsed Ctrl+D to exitUse Ctrl+X or /quit to save
Serial console garbledWrong baud rateMatch terminal to router settings (115200)
Locked out after firewall changeBlocked own connectionWait for safe mode timeout (9 min)
History full, safe mode disabledToo many changesWork in smaller chunks
Tab completion not workingHotLock mode activePress F7 to toggle off

If you left safe mode active on another session:

/system/history/print

Look for F flags indicating uncommitted safe mode changes.

/console/settings/set sanitize-names=no

Common Mistakes

  • Using item numbers in scripts - Numbers change; use names instead
  • Making large changes in safe mode - History limit is 100 actions
  • Forgetting safe mode is active - Check prompt for <SAFE>
  • Using Ctrl+D to save - Ctrl+D discards; use Ctrl+X to save
  • Wrong serial parameters - RouterBOARD default is 115200, not 9600
MenuDescription
/console/settingsConsole behavior settings
/system/consoleSerial console configuration
/system/historyCommand history and safe mode tracking
/portSerial port settings
ShortcutFunction
TabAuto-complete
Tab TabShow options
F1 / ?Help
F3 / Ctrl+RSearch history
F4 / Ctrl+XToggle safe mode
F5 / Ctrl+LRepaint screen
F7Toggle HotLock
Up / Ctrl+PPrevious command
Down / Ctrl+NNext command
Home / Ctrl+ALine start
End / Ctrl+ELine end
Ctrl+KDelete to end
Ctrl+UDelete to start
Ctrl+CInterrupt
Ctrl+DLogout
#Internal chat
ParameterDescription
briefTabular output
detailProperty=value format
count-onlyItem count
proplistSpecific properties
whereFilter criteria
fromSpecific items
intervalAuto-refresh seconds
fileExport to file
without-pagingContinuous output