Command Line Interfaces RutOS: Difference between revisions
(Created page with "==Introduction== A '''command line interface''' ('''CLI''') is a means of interacting with a computer program or system where the user (or client) issues commands to the prog...") |
mNo edit summary |
||
(11 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
<p style="color:red">The information on this page is updated in accordance with the [https://wiki.teltonika-networks.com/view/FW_%26_SDK_Downloads'''00.07.08'''] firmware version .</p> | |||
==Introduction== | ==Introduction== | ||
A '''command line interface''' ('''CLI''') is a means of interacting with a computer program or system where the user (or client) issues commands to the program in the form of successive lines of text (command lines). A program | A '''command line interface''' ('''CLI''') is a means of interacting with a computer program or system where the user (or client) issues commands to the program in the form of successive lines of text (command lines). A program that handles the interface is called a '''command language interpreter,''' or '''shell'''. | ||
Teltonika-Networks devices support a variety of different command line interfaces all of which will be described in this article. Only the methods of reaching and logging in via a specified CLI will be described here | Teltonika-Networks devices support a variety of different command line interfaces, all of which will be described in this article. Only the methods of reaching and logging in via a specified CLI will be described here, not any specific command usage. | ||
In all cases, CLI login information for Teltonika-Networks devices | In all cases, the CLI login information for Teltonika-Networks devices is: | ||
* User name: '''root''' | * User name: '''root''' | ||
Line 12: | Line 14: | ||
==CLI (WebUI)== | ==CLI (WebUI)== | ||
Teltonika Networks routers and gateways have a command-line interface built-in to their '''Web User Interfaces''' ('''WebUI'''). This is the most accessible method because all you need is a web browser. | |||
To access the WebUI CLI, '''log in to the WebUI''', and navigate to '''System → Maintenance → CLI'''. Type in the login name "'''root'''" and the '''router's admin password'''. You should be greeted with a message such as this: | |||
[[File:CLI | [[File:RutOS WebUI CLI logged in fixed 2.png|border|center|class=tlt-border|781x467px]] | ||
==SSH== | ==SSH== | ||
'''Secure Shell''' (SSH) is a cryptographic network protocol for operating network services securely over an unsecured network. The best known example application is for remote login to computer systems by users. The login process is different for different operating systems. Therefore, this section is split into two parts: '''Linux''' and '''Windows'''. | '''Secure Shell''' (SSH) is a cryptographic network protocol for operating network services securely over an unsecured network. The best-known example application is for remote login to computer systems by users. The login process is different for different operating systems. Therefore, this section is split into two parts: '''Linux''' and '''Windows'''. | ||
===Linux=== | ===Linux=== | ||
---- | ---- | ||
Linux operating systems support many applications that can be used to | Linux operating systems support many applications that can be used to log in to a router or a gateway via SSH, but the most common is '''Terminal''', which we'll be using for this example. | ||
Open a new Terminal window, type '''ssh [email protected].''' If this is your first time logging in, you might be asked to clarify whether you really want to log in. In that case, just type '''yes'''. Then type in the '''router's admin password''' to finish the login process. | |||
[[File:Ubuntu_SSH_login.png|border|center|class=tlt-border|617x375px]] | |||
====RSA key==== | ====RSA key==== | ||
---- | |||
There is a possibility to use an RSA key instead of a password when logging in via SSH. This process is described '''[[SSH RSA key authentication (Linux)|here]]''' in detail. | There is a possibility to use an RSA key instead of a password when logging in via SSH. This process is described '''[[SSH RSA key authentication (Linux)|here]]''' in detail. | ||
===Windows=== | ===Windows=== | ||
---- | ---- | ||
To | To access SSH on the Windows OS, you will need an SSH client application. The most common is '''PuTTY''' - free, open source SSH and Telnet client, which we'll be using for this example. You can download PuTTY from '''[https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html here]'''. | ||
Launch PuTTY and select the '''SSH''' option. Type in the '''router's LAN IP address''' into the '''"Host Name (or IP address)"''' field, specify the SSH port into the '''"Port"''' field ('''22''' by default), and '''click "Open"''': | |||
[[File:Putty login | [[File:SSH Putty login.png|border|center|class=tlt-border|454x442px]] | ||
In the next window, type in the login name '''root''' and the '''router's admin password'''. You should be greeted with a message such as this: | |||
[[File:SSH Putty logged in.png|border|center|class=tlt-border|821x450px]] | |||
'''Note:''' Newer Windows 10 editions already have a built-in SSH client. see https://docs.microsoft.com/en-us/windows/terminal/tutorials/ssh | |||
==== RSA key==== | |||
---- | ---- | ||
There is a possibility to use an RSA key instead of a password when logging in via SSH. This process is described '''[[SSH RSA key authentication (Windows)|here]]''' in detail. | There is a possibility to use an RSA key instead of a password when logging in via SSH. This process is described '''[[SSH RSA key authentication (Windows)|here]]''' in detail. | ||
==RS232/RS485 console (only with RUT955)== | ==RS232/RS485 console (only with RUT955)== | ||
It is also possible to control | It is also possible to control routers or gateways via RS232 or RS485 consoles if they have those serial ports. For this, you will need the adequate cables: | ||
{| class="wikitable" style="border:2px solid white; background: white" | {| class="wikitable" style="border:2px solid white; background: white" | ||
|+ | |+ | ||
Line 77: | Line 63: | ||
| style="border:1px solid white; width: 400px" |'''USB to RS232 (Male) cable''' <br> [[File:Usb to rs232 male.png|187px|left]] | | style="border:1px solid white; width: 400px" |'''USB to RS232 (Male) cable''' <br> [[File:Usb to rs232 male.png|187px|left]] | ||
|- | |- | ||
|} | |}You can log in to the RS485 console with a 2-wire cable or you can use the RS485 jack that comes with the router for one end; the other end of the cable basically depends on your end device's capabilities (it can be USB, RS232, etc.) | ||
===Router configuration=== | |||
----The configuration on the device side is fairly simple. Just '''log in to the device WebUI''', go to '''Services → Serial Utilities → Console,''' enable the instance, and configure the rest according to your serial device settings. In the example below, default values were used. | |||
[[File:Rs232 console configuration v4.png|border|center|class=tlt-border|627x416px]] | |||
=== | ===Linux=== | ||
---- | ---- | ||
To login from a Linux PC, you'll need an application for serial communication like '''minicom''' or '''gtkterm'''. For this example, we'll be using minicom. You can download it by typing these lines into the Terminal: | |||
<code><span class="highlight">'''sudo apt-get update'''</span></code> - downloads a list of newest software packages. | |||
<code><span class="highlight">'''sudo apt-get install minicom'''</span></code> - downloads and installs minicom. | |||
= | Once you have installed minicom, you can run it with the command <code><span class="highlight">'''sudo minicom'''</span></code> from the Linux Terminal. This will open a new console window where you will need to set some things up. Press '''Ctrl + A''' at once on your keyboard, then press '''"Z"''' which will direct you to the settings menu: | ||
[[File:Minicom settings v2.png|border|center|class=tlt-border|757×468px]] | |||
''' | Then press '''"O"''' on your keyboard. This will direct you to the main settings menu. From there you should specify the name of the serial device and the same parameters that you entered in the router's configuration. A picture with corresponding parameters is presented below: | ||
[[File:Minicom settings | [[File:Minicom settings port v3.png|border|center|class=tlt-border|757×468px]] | ||
Once done, press '''"Enter"'''. In the next menu, you can save these settings as defaults by selecting '''Save setup as dfl''' so that you would not need to set everything up the next time you use the console. | |||
To access the console, press '''"Esc"''' on your keyboard. It will take you to a login window - there enter the login name '''root''' and the '''router's admin password'''. | |||
===Windows=== | ===Windows=== | ||
---- | ---- | ||
To | To log in from a Windows PC, you'll need an application for serial communication. The most common is '''PuTTY''' - a free, open source SSH and Telnet client, which we'll be using for this example. You can download PuTTY from '''[https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html here]'''. | ||
First you must find out which '''Serial line''' (or '''COM port''') your cable uses. To do so, go to Windows '''Device Manager''' (you can find it easily via the search field or in the Control Panel). Find '''Ports (COM & LPT)''' in the device list and expand that section. Locate your serial device (depends on the type of cable) and take note of its '''COM port number''' ('''COM3''' in our example): | |||
[[File:Putty serial login 1 v2.PNG|border|center|class=tlt-border|932×566px]] | |||
Launch PuTTY and select the '''Serial''' option under the "Connection type" field. Specify the COM port ('''COM3''' from our example) in the "Serial line" field and the Baud rate from your router's configuration in the "Speed" field ('''9600''' from our example) and click "Open": | |||
[[File:Putty serial login | [[File:Putty serial login 2 v3.PNG|border|center|class=tlt-border|477×472px]] | ||
In the next window type in the login name ''root'' and the '''router's admin password'''. You should be greeted with a message such as this: | |||
[[File:Putty serial login 3 | [[File:Putty serial login 3 v3.PNG|border|center|class=tlt-border|640×393px]] | ||
== See also== | == See also== | ||
Line 136: | Line 115: | ||
*https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html - PuTTY downloads page | *https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html - PuTTY downloads page | ||
[[Category: | [[Category:Router control and monitoring]] |
Latest revision as of 10:09, 25 July 2024
Main Page > General Information > Configuration Examples > Router control and monitoring > Command Line Interfaces RutOSThe information on this page is updated in accordance with the 00.07.08 firmware version .
Introduction
A command line interface (CLI) is a means of interacting with a computer program or system where the user (or client) issues commands to the program in the form of successive lines of text (command lines). A program that handles the interface is called a command language interpreter, or shell.
Teltonika-Networks devices support a variety of different command line interfaces, all of which will be described in this article. Only the methods of reaching and logging in via a specified CLI will be described here, not any specific command usage.
In all cases, the CLI login information for Teltonika-Networks devices is:
- User name: root
- Password: router's admin password
CLI (WebUI)
Teltonika Networks routers and gateways have a command-line interface built-in to their Web User Interfaces (WebUI). This is the most accessible method because all you need is a web browser.
To access the WebUI CLI, log in to the WebUI, and navigate to System → Maintenance → CLI. Type in the login name "root" and the router's admin password. You should be greeted with a message such as this:
SSH
Secure Shell (SSH) is a cryptographic network protocol for operating network services securely over an unsecured network. The best-known example application is for remote login to computer systems by users. The login process is different for different operating systems. Therefore, this section is split into two parts: Linux and Windows.
Linux
Linux operating systems support many applications that can be used to log in to a router or a gateway via SSH, but the most common is Terminal, which we'll be using for this example.
Open a new Terminal window, type ssh [email protected]. If this is your first time logging in, you might be asked to clarify whether you really want to log in. In that case, just type yes. Then type in the router's admin password to finish the login process.
RSA key
There is a possibility to use an RSA key instead of a password when logging in via SSH. This process is described here in detail.
Windows
To access SSH on the Windows OS, you will need an SSH client application. The most common is PuTTY - free, open source SSH and Telnet client, which we'll be using for this example. You can download PuTTY from here.
Launch PuTTY and select the SSH option. Type in the router's LAN IP address into the "Host Name (or IP address)" field, specify the SSH port into the "Port" field (22 by default), and click "Open":
In the next window, type in the login name root and the router's admin password. You should be greeted with a message such as this:
Note: Newer Windows 10 editions already have a built-in SSH client. see https://docs.microsoft.com/en-us/windows/terminal/tutorials/ssh
RSA key
There is a possibility to use an RSA key instead of a password when logging in via SSH. This process is described here in detail.
RS232/RS485 console (only with RUT955)
It is also possible to control routers or gateways via RS232 or RS485 consoles if they have those serial ports. For this, you will need the adequate cables:
Straight-through Female/Male RS232 cable |
Null-modem (crossed) Male/Male RS232 cable |
USB to RS232 (Male) cable |
You can log in to the RS485 console with a 2-wire cable or you can use the RS485 jack that comes with the router for one end; the other end of the cable basically depends on your end device's capabilities (it can be USB, RS232, etc.)
Router configuration
The configuration on the device side is fairly simple. Just log in to the device WebUI, go to Services → Serial Utilities → Console, enable the instance, and configure the rest according to your serial device settings. In the example below, default values were used.
Linux
To login from a Linux PC, you'll need an application for serial communication like minicom or gtkterm. For this example, we'll be using minicom. You can download it by typing these lines into the Terminal:
sudo apt-get update
- downloads a list of newest software packages.
sudo apt-get install minicom
- downloads and installs minicom.
Once you have installed minicom, you can run it with the command sudo minicom
from the Linux Terminal. This will open a new console window where you will need to set some things up. Press Ctrl + A at once on your keyboard, then press "Z" which will direct you to the settings menu:
Then press "O" on your keyboard. This will direct you to the main settings menu. From there you should specify the name of the serial device and the same parameters that you entered in the router's configuration. A picture with corresponding parameters is presented below:
Once done, press "Enter". In the next menu, you can save these settings as defaults by selecting Save setup as dfl so that you would not need to set everything up the next time you use the console.
To access the console, press "Esc" on your keyboard. It will take you to a login window - there enter the login name root and the router's admin password.
Windows
To log in from a Windows PC, you'll need an application for serial communication. The most common is PuTTY - a free, open source SSH and Telnet client, which we'll be using for this example. You can download PuTTY from here.
First you must find out which Serial line (or COM port) your cable uses. To do so, go to Windows Device Manager (you can find it easily via the search field or in the Control Panel). Find Ports (COM & LPT) in the device list and expand that section. Locate your serial device (depends on the type of cable) and take note of its COM port number (COM3 in our example):
Launch PuTTY and select the Serial option under the "Connection type" field. Specify the COM port (COM3 from our example) in the "Serial line" field and the Baud rate from your router's configuration in the "Speed" field (9600 from our example) and click "Open":
In the next window type in the login name root and the router's admin password. You should be greeted with a message such as this:
See also
External links
- https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html - PuTTY downloads page