Telnet

This chapter covers some aspects related to service telnet commands, which is a feature that allows the user to connect other devices via Telnet protocol.

Telnet is a network protocol that allows remote control of computers via text-based input and output. A client-server connection is established via the TCP protocol and TCP port 23 by default. The Telnet client, known as the remote desktop or Rlogin (Remote Login), can be installed either on a special device or on a regular computer.

Server mode

To connect to a device (it will work as the server), it is necessary to execute first of all the configuration command service telnet which can be run with different options (if it is executed with no options, the default configuration will be applied).

To work as server mode, it is necessary to run the configuration command set service telnet, which enables the telnet protocol in our device with default configuration. However, it is possible and recommended to enable this protocol using other values rather than the default ones.

Warning

It will be a good exercise to modify both the port on which the connection will be established and address on which the device will let the clients listen, in order to ensure the connection. The command for doing this is written below.

set service telnet port <u32> listen-address <ipv4|ipv6>

Configuration commands

At this point, it is important to mention that any telnet connection will be affected depending on the configuration it is set for the server user used during the connection. In this link, you will find more information about the different users and roles in any device and their different configurations.

Furthermore, it is possible to control who has access and what are able to do with different network resources using the AAA framework, and telnet protocol is not the exception. You will find more information about this in AAA section and some useful examples of system aaa combined with system login here.

Client mode

On the other hand, a user is able to connect to another device using operational commands, where the user must define the ip address of the server. In addition, it is possible to include some optional arguments to facilitate or customize the connection. An example of this is described as follows:

telnet <ipv4|ipv6|txt> port <u32> set-user <txt> local-address <ipv4|ipv6>

This command it is defining a telnet connection for a specific address, a specific port, the user for that server device and the client ip address it will be used.

Operational commands

Finally, you can find here more examples on how to use these commands.