modified on 26 September 2011 at 07:50 ••• 141,937 views

Manual:Console login process

From MikroTik Wiki

Jump to: navigation, search
Version.png

Applies to RouterOS: 2.9, v3, v4

Contents

Description

There are different ways to log into console:

  • serial port
  • console (screen and keyboard)
  • telnet
  • ssh
  • mac-telnet
  • winbox terminal

Input and validation of user name and password is done by login process. Login process can also show different informative screens (license, demo version upgrade reminder, software key information, default configuration).

At the end of successful login sequence login process prints banner and hands over control to the console process.

Console process displays system note, last critical log entries, auto-detects terminal size and capabilities and then displays command prompt]. After that you can start writing commands.

Use up arrow to recall previous commands from command history, TAB key to automatically complete words in the command you are typing, ENTER key to execute command, and Control-C to interrupt currently running command and return to prompt.

Easiest way to log out of console is to press Control-D at the command prompt while command line is empty (You can cancel current command and get an empty line with Control-C, so Control-C followed by Control-D will log you out in most cases).

Console login options

Starting from v3.14 it is possible to specify console options during login process. These options enables or disables various console features like color, terminal detection and many other.

Additional login parameters can be appended to login name after '+' sign.

login_name ::= user_name [ '+' parameters ] 
parameters ::= parameter [ parameters ] 
parameter ::= [ number ] 'a'..'z' 
number ::= '0'..'9' [ number ]

If parameter is not present, then default value is used. If number is not present then implicit value of parameter is used.

example: admin+c80w - will disable console colors and set terminal width to 80.

Param Default Implicit Description
"w" auto auto Set terminal width
"h" auto auto Set terminal height
"c" on off disable/enable console colors
"t" on off Do auto detection of terminal capabilities
"e" on off Enables "dumb" terminal mode

Different information shown by login process

Login process will display MikroTik banner after validating user name and password.

  MMM      MMM       KKK                          TTTTTTTTTTT      KKK
  MMMM    MMMM       KKK                          TTTTTTTTTTT      KKK
  MMM MMMM MMM  III  KKK  KKK  RRRRRR     OOOOOO      TTT     III  KKK  KKK
  MMM  MM  MMM  III  KKKKK     RRR  RRR  OOO  OOO     TTT     III  KKKKK
  MMM      MMM  III  KKK KKK   RRRRRR    OOO  OOO     TTT     III  KKK KKK
  MMM      MMM  III  KKK  KKK  RRR  RRR   OOOOOO      TTT     III  KKK  KKK

  MikroTik RouterOS 3.0rc (c) 1999-2007       http://www.mikrotik.com/

Actual banner can be different from the one shown here if it is replaced by distributor. See also: branding.

License

After logging in for the first time after installation you are asked to read software licenses.

Do you want to see the software license? [Y/n]:

Answer y to read licenses, n if you do not wish to read licenses (question will not be shown again). Pressing SPACE will skip this step and the same question will be asked after next login.

Demo version upgrade reminder

After logging into router that has demo key, following remonder is shown:

UPGRADE NOW FOR FULL SUPPORT
----------------------------
FULL SUPPORT benefits:
- receive technical support
- one year feature support
- one year online upgrades
    (avoid re-installation and re-configuring your router)
To upgrade, register your license "software ID"
 on our account server www.mikrotik.com

Current installation "software ID": ABCD-456

Please press "Enter" to continue!

Software key information

If router does not have software key, it is running in the time limited trial mode. After logging in following information is shown:

ROUTER HAS NO SOFTWARE KEY
----------------------------
You have 16h58m to configure the router to be remotely accessible,
and to enter the key by pasting it in a Telnet window or in Winbox.
See www.mikrotik.com/key for more details.

Current installation "software ID": ABCD-456
Please press "Enter" to continue!

After entering valid software key, following information is shown after login:

ROUTER HAS NEW SOFTWARE KEY
----------------------------
Your router has a valid key, but it will become active 
only after reboot. Router will automatically reboot in a day.

=== Automatic configuration ===

Usually after [[netinstall|installation]] or configuration [[reset]] RouterOS will apply [[default
settings]], such as an IP address.
First login into will show summary of these settings and offer to undo them.
This is an example:
<pre>
The following default configuration has been installed on your router:
-------------------------------------------------------------------------------
IP address 192.168.88.1/24 is on ether1
ether1 is enabled

-------------------------------------------------------------------------------
You can type "v" to see the exact commands that are used to add and remove
this default configuration, or you can view them later with
'/system default-configuration print' command.
To remove this default configuration type "r" or hit any other key to continue.
If you are connected using the above IP and you remove it, you will be disconnected.

Applying and removing of the default configuration is done using console script (you can press 'v' to review it).

Different information shown by console process after logging in

System Note

It is possible to always display some fixed text message after logging into console.

Critical log messages

Console will display last critical error messages that this user has not seen yet. See log for more details on configuration. During console session these messages are printed on screen.

dec/10/2007 10:40:06 system,error,critical login failure for user root from 10.0.0.1 via telnet
dec/10/2007 10:40:07 system,error,critical login failure for user root from 10.0.0.1 via telnet
dec/10/2007 10:40:09 system,error,critical login failure for user test from 10.0.0.1 via telnet


Prompt

  • [admin@MikroTik] /interface> - Default command prompt, shows user name, system identity, and current command path.
  • [admin@MikroTik] /interface<SAFE> - Prompt indicates that console session is in Safe Mode.
  • [admin@MikroTik] >> - Prompt indicates that HotLock is turned on.
  • {(\... - While entering multiple line command continuation prompt shows open parentheses.
  • line 2 of 3> - While editing multiple line command prompt shows current line number and line count.
  • address: - Command requests additional input. Prompt shows name of requested value.

Console can show different prompts depending on enabled modes and data that is being edited. Default command prompt looks like this:

[admin@MikroTik] /interface>

Default command prompt shows name of user, '@' sign and system name in brackets, followed by space, followed by current command path (if it is not '/'), followed by '>' and space. When console is in safe mode, it shows word SAFE in the command prompt.

[admin@MikroTik] /interface<SAFE> 

Hotlock mode is indicated by an additional yellow '>' character at the end of the prompt.

[admin@MikroTik] >> 

It is possible to write commands that consist of multiple lines. When entered line is not a complete command and more input is expected, console shows continuation prompt that lists all open parentheses, braces, brackets and quotes, and also trailing backslash if previous line ended with backslash-whitespace.

[admin@MikroTik] > {
{... :put (\
{(\... 1+2)}
3

When you are editing such multiple line entry, prompt shows number of current line and total line count instead of usual username and system name.

line 2 of 3> :put (\

Sometimes commands ask for additional input from user. For example, command '/password' asks for old and new passwords. In such cases prompt shows name of requested value, followed by colon and space.

[admin@MikroTik] > /password 
old password: ******
new password: **********
retype new password: **********


FAQ

Q: How do I turn off colors in console?
A: Add '+c' after login name.

Q: After logging in console prints rubbish on the screen, what to do?
Q: My expect script does not work with newer 3.0 releases, it receives some strange characters. What are those?
A: These sequences are used to automatically detect terminal size and capabilities. Add '+t' after login name to turn them off.

Q: Thank you, now terminal width is not right. How do I set terminal width?
A: Add '+t80w' after login name, where 80 is your terminal width.


[ Top | Back to Content ]