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.
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
|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: )|
|channels (integer)||Number of channels supported by the port.|
|inactive (yes | no)|
|used-by (string)||Shows what is using current port. For example, by default Serial0 is used by serial-console.|
This submenu allows to specify directory where drivers for 3g modems can be uploaded and used.
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
|allowed-addresses (IP address range; Default: 0.0.0.0/0)||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: "")||Name of the file, where communication will be logged. By default logging is disabled.|
|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.|
|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.|