Manual:System/Serial Console: Difference between revisions

From MikroTik Wiki
Jump to navigation Jump to search
Line 60: Line 60:
This type of port is used on RouterBOARD 2011 series devices, sometimes called "Cisco style" serial port.
This type of port is used on RouterBOARD 2011 series devices, sometimes called "Cisco style" serial port.
<div class=manual>
<div class=manual>
<table class="styled_table" style="width: 500px">
<table>
<tr><th>CAT5</th><th>DB9 Pin</th></tr>
<tr><th scope="col" class="t47" id="n1">Signal</th><th scope="col" class="t47" id="n2">Console Port (DTE) RJ-45</th><th scope="col" class="t47" id="n3">RJ-45 Rolled Cable RJ-45 Pin</th><th scope="col" class="t47" id="n4">Adapter DB-9 Pin</th><th scope="col" class="t47" id="n5">Adapter DB-25 Pin</th><th scope="col" class="t47" id="n6">Signal</th></tr>
<tr><td>Green-White</td><td>8</td></tr>
<tr class="table-alternate row1"> <td id="n1" class="start">CTS</td><td id="n2">1</td><td id="n3">8</td><td id="n4">7</td><td id="n5">4</td><td id="n6">RTS</td></tr><tr class="table-noalt row2"><td id="n1" class="start">DTR</td><td id="n2">2</td><td id="n3">7</td><td id="n4">4</td><td id="n5">20</td><td id="n6">DSR</td></tr><tr class="table-alternate row3"> <td id="n1" class="start">TxD</td><td id="n2">3</td><td id="n3">6</td><td id="n4">3</td><td id="n5">2</td><td id="n6">RxD</td></tr><tr class="table-noalt row4"><td id="n1" class="start">Ground</td><td id="n2">4</td><td id="n3">5</td><td id="n4">5</td><td id="n5">7</td><td id="n6">Ground</td></tr><tr class="table-alternate row5"> <td id="n1" class="start">Ground</td><td id="n2">5</td><td id="n3">4</td><td id="n4">5</td><td id="n5">7</td><td id="n6">Ground</td></tr><tr class="table-noalt row6"><td id="n1" class="start">RxD</td><td id="n2">6</td><td id="n3">3</td><td id="n4">2</td><td id="n5">3</td><td id="n6">TxD</td></tr><tr class="table-alternate row7"> <td id="n1" class="start">DSR</td><td id="n2">7</td><td id="n3">2</td><td id="n4">6</td><td id="n5">6</td><td id="n6">DTR</td></tr><tr class="table-noalt row8"><td id="n1" class="start">RTS</td><td id="n2">8</td><td id="n3">1</td><td id="n4">8</td><td id="n5">5</td><td id="n6">CTS</td></tr>
<tr><td>Green</td><td>6</td></tr>
<tr><td>Orange-White</td><td>2</td></tr>
<tr><td>Blue</td><td>5</td></tr>
<tr><td>Blue-White</td><td>5</td></tr>
<tr><td>Orange</td><td>3</td></tr>
<tr><td>Brown-White</td><td>4</td></tr>
<tr><td>Brown</td><td>7</td></tr>
</table>
</table>



Revision as of 10:57, 4 April 2014

Applies to RouterOS: v3, v4, v5+

Overview

Sub-menu: /system console, /system serial-terminal
Standards: RS-232

The Serial Console and Terminal are tools, used to communicate with devices and other systems that are interconnected via serial port. The serial terminal may be used to monitor and configure many devices - including modems, network devices (including MikroTik routers), and any device that can be connected to a serial (asynchronous) port.

The Serial Console feature is for configuring direct-access configuration facilities (monitor/keyboard and serial port) that are mostly used for initial or recovery configuration.

If you do not plan to use a serial port for accessing another device or for data connection through a modem, you can configure it as a serial console. The first serial port is configured as a serial console, but you can choose to unconfigure it to free it for other applications. A free serial port can also be used to access other routers' (or other equipment, like switches) serial consoles from a MikroTik RouterOS router. A special null-modem cable is needed to connect two hosts (like, two PCs, or two routers; not modems). Note that a terminal emulation program (e.g., HyperTerminal on Windows or minicom on linux) is required to access the serial console from another computer.

Several customers have described situations where the Serial Terminal (managing side) feature would be useful:

  • on a mountaintop, where a MikroTik wireless installation sits next to equipment (including switches and Cisco routers) that can not be managed in-band (by telnet through an IP network)
  • monitoring weather-reporting equipment through a serial port
  • connection to a high-speed microwave modem that needed to be monitored and managed by a serial connection

With the serial-terminal feature of the MikroTik, up to 132 (and, maybe, even more) devices can be monitored and controlled.

Serial Console Configuration

A special null-modem cable should be used for connecting to the serial console from another computer. The Serial Console cabling diagram for DB9 connectors is as follows:

Router Side (DB9f)Signal DirectionSide (DB9f)
1, 6 CD, DSR IN 4
2 RxD IN 3
3 TxD OUT 2
4 DTR OUT 1, 6
5 GND - 5
7 RTS OUT 8
8 CTS IN 7

Note that the above diagram will not work if the software is configured to do hardware flow control, but the hardware does not support it (e.g., some RouterBOARD models have reduced seral port functionality). If this is the case, either turn off the hardware flow control or use a null-modem cable with loopback, which will simulate the other device's handshake signals with it's own. The diagram for such cable is as follows:


Router Side (DB9f)SignalDirectionSide (DB9f)
1, 4, 6 CD, DTR, DSR LOOP 1, 4, 6
2 RxD IN 3
3 TxD OUT 2
5 GND - 5
7, 8 RTS, CTS LOOP 7, 8

Note that although it is recommended to have 5-wire cable for this connection, in many cases it is enough to have 3 wires (for unlooped signals only), leaving both loops to exist only inside the connectors. Other connection schemes exist as well.

RJ45 type serial port

This type of port is used on RouterBOARD 2011 series devices, sometimes called "Cisco style" serial port.

SignalConsole Port (DTE) RJ-45RJ-45 Rolled Cable RJ-45 PinAdapter DB-9 PinAdapter DB-25 PinSignal
CTS1874RTS
DTR27420DSR
TxD3632RxD
Ground4557Ground
Ground5457Ground
RxD6323TxD
DSR7266DTR
RTS8185CTS

Configuring Console

Sub-menu: /system console


Properties

Property Description
disabled (yes | no; Default: no) Whether serial console is enabled or not.
port (string) Which port should the serial terminal listen to
term (string) Terminal type


Read-only properties

Property Description
free (yes | no) Console is ready for use.
used (yes | no) Console is in use.
vcno (integer) number of virtual console - [Alt]+[F1] represents '1', [Alt]+[F2] - '2', etc..
wedged (yes | no) Console is currently not available


Example

To disable all virtual consoles (available through the direct connection with keyboard and monitor) extept for the first one:

[admin@MikroTik] system console> print
Flags: X - disabled, W - wedged, U - used, F - free
 #   PORT    VCNO       TERM
 0 F serial0            MyConsole
 1 U         1          linux
 2 F         2          linux
 3 F         3          linux
 4 F         4          linux
 5 F         5          linux
 6 F         6          linux
 7 F         7          linux
 8 F         8          linux
[admin@MikroTik] system console> disable 2,3,4,5,6,7,8
[admin@MikroTik] system console> print
Flags: X - disabled, W - wedged, U - used, F - free
 #   PORT    VCNO       TERM
 0 F serial0            MyConsole
 1 U         1          linux
 2 X         2          linux
 3 X         3          linux
 4 X         4          linux
 5 X         5          linux
 6 X         6          linux
 7 X         7          linux
 8 X         8          linux
[admin@MikroTik] system console>

To check if the configuration of the serial port:

[admin@MikroTik] system serial-console> /port print detail
  0 name=serial0 used-by=Serial Console baud-rate=9600 data-bits=8 parity=none
    stop-bits=1 flow-control=none

  1 name=serial1 used-by="" baud-rate=9600 data-bits=8 parity=none stop-bits=1
    flow-control=none

[admin@MikroTik] system serial-console>

Using Serial Terminal

Command: /system serial-terminal


The command is used to communicate with devices and other systems that are connected to the router via serial port.

All keyboard input is forwarded to the serial port and all data from the port is output to the connected device. Ctrl-A is the prefix key, which means that you will enter a small "menu" by pressing this combination of keys. The Ctrl-A character will not be sent to your device! If you need to send Ctrl-A character to remote device, press Ctrl-A twice. After exiting with Ctrl-A and then Q, the control signals of the port are lowered. The speed and other parameters of serial port may be configured in the /port directory of router console. No terminal translation on printed data is performed. It is possible to get the terminal in an unusable state by outputting sequences of inappropriate control characters or random data. Do not connect to devices at an incorrect speed and avoid dumping binary data.


Property Description
port (string; Default: ) Port name to use


The serial port to be used as a serial terminal needs to be free (e.g., there should not be any serial consoles, LCD or other configuration). Chack the previous chapter to see how to disable serial console on a particular port. Use /port print command to see if some other application is still using the port.

Ctrl-A have special meaning and is used to provide a possibility of exiting from nested serial-terminal sessions:

To send Ctrl-A to to serial port, press Ctrl-A Ctrl-A

Note: When rebooting a RouterBoard the bootloader (RouterBOOT) will always use the serial console (serial0 on RouterBoards) to send out some startup messages and offer access to the RouterBOOT menu. Having text coming out of the serial port to the connected device might confuse your attached device and get stuck on boot loader. To avoid this you can reconfigure RouterBOOT to enter the RouterBOOT menu only when a DEL character is received.


Example

To connect to a device connected to the serial1 port:

[admin@dzeltenais_burkaans] > /system serial-terminal serial0 

[Ctrl-A is the prefix key]

[admin@R2] /ip address> 


Console Screen

Sub-menu: /system console screen


This facility is created to change line number per screen if you have a monitor connected to router.

Property Description
line count (25|40|50; Default: 25) Number of lines on monitor


This parameter is applied only to a monitor, connected to the router.

Example

To set monitor's resolution from 80x25 to 80x40:

[admin@MikroTik] system console screen> set line-count=40
[admin@MikroTik] system console screen> print
    line-count: 40
[admin@MikroTik] system console screen>

See More

[ Top | Back to Content ]