From MikroTik Wiki
Revision as of 11:32, 14 November 2011 by Marisb (talk | contribs) (Created page with "{{Versions|v5+}} __TOC__ ===Summary=== There are many ways how to use ports on the routers. Most obvious one is to use serial port for initial RouterOS configuration after i...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Applies to RouterOS: v5+


There are many ways how to use ports on the routers. Most obvious one is to use serial port for initial RouterOS configuration after installation(by default serial0 is used by serial-terminal).

Serial and USB ports can also be used to:

  • connect 3G modems;
  • connect to another device through a serial cable
  • access device connected to serial cable remotely.


Sub-menu: /port

Menu lists all available serial, usb, ... ports on the router and allows to configure port parameters, like baud-rate, flow-control, etc.

Below you can see default port configuration on RB493.

[admin@RB493G] /port> print 
Flags: I - inactive 
 #   NAME                         CHANNELS USED-BY                      BAUD-RATE
 0   serial0                             1 serial-terminal              115200 

Note: List of the ports are maintained automatically by the RouterOS.


Property Description
baud-rate (integer | auto; Default: auto) Baud rate used by the port. If set to auto, then RouterOS tries to detect baud rate automatically.
data-bits (7 | 8; Default: )
dtr (on | off; Default: )
flow-control (hardware | none | xon-xoff; Default: )
name (string; Default: )
parity (even | none | odd; Default: )
rts (on | off; Default: )
stop-bits (1 | 2; Default: )

Read-only properties

Property Description
channels (integer) Number of channels supported by the port.
inactive (yes | no)
line-state ()
used-by (string) Shows what is using current port. For example, by default Serial0 is used by serial-console.


Sub-menu: /port firmware

This submenu allows to specify directory where drivers for 3g modems can be uploaded and used.

Remote Access

Sub-menu: /port remote-access

If you want to access serial device that can only talk to COM ports and is located somewhere else behind router, then you can use remote-access.

As defined in RFC 2217 RouterOS can transfer data from/to a serial device over TCP connection.

Enabling remote access on RouterOS is very easy:

/port remote-access add port=serial0 protocol=rfc2217 tcp-port=9999

Note: By default serial0 is used by serial-terminal. Without releasing the port, it cannot be used by remote-access or other services


Property Description
allowed-addresses (IP address range; Default: Range of IP addresses allowed to access port remotely.
channel (integer [0..4294967295]; Default: 0) Port channel that will be used. If port has only one channel then channel number should always be 0.
disabled (yes | no; Default: no)
local-address (IP address; Default: ) IP address used as source address.
log-file (string; Default: "")
port (string; Default: ) Name of the port from Port list.
protocol (raw | rfc2217; Default: rfc2217) RFC 2217 defines a protocol to transfer data from/to a serial device over TCP. If set to raw, then data is sent to serial as is.
tcp-port (integer [1..65535]; Default: 0) TCP port on which to listen for incoming connections.

Read-only properties

Property Description
active (yes | no) Whether remote access is active and ready to accept connection.
busy (yes | no) Whether port is currently busy.
inactive (yes | no)
logging-active (yes | no) Whether logging to file is currently running
remote-address (IP address) IP address of remote location that is currently connected.

See More

[ Top | Back to Content ]