Configuring Telnet

This chapter contains the following sections:

Information About the Telnet Server

The Telnet protocol enables you to set up TCP/IP connections to a host. Telnet allows a user at one site to establish a TCP connection to a login server at another site and then pass the keystrokes from one device to the other. Telnet can accept either an IPv4 or IPv6 address or a domain name as the remote device address.

Prerequisites for Telnet

You have configured IP on a Layer 3 interface, out of band on the mgmt 0 interface, or inband on an Ethernet interface. Telnet supports both IPv4 and IPv6 addresses.

Guidelines and Limitations for Telnet

  • The Telnet server is disabled by default

  • Cisco NX-OS commands may differ from Cisco IOS commands.

Default Setting for Telnet

Parameter

Default

Telnet server

Enabled

Configuring Telnet

Enabling the Telnet Server

The Telnet server is enabled by default, but you can reenable it if necessary.

Before you begin

Log in to the CLI in EXEC mode.

Procedure

  Command or Action Purpose
Step 1

switch# configure terminal

Enters global configuration mode.

Step 2

switch(config)# feature telnet

Enables the Telnet server.

Step 3

(Optional) switch(config)# show telnet server

(Optional)

Displays the Telnet server configuration.

Step 4

(Optional) switch(config)# copy running-config startup-config

(Optional)

Copies the running configuration to the startup configuration.

Example

This example shows how to enable the Telnet server:

switch# configure terminal
switch(config)# feature telnet
switch(config)# show telnet server
telnet service enabled
switch(config)# copy running-config startup-config

Starting an IPv4 Telnet Session to a Remote Device

Before you begin

  • Log in to the CLI in EXEC mode.

  • Verify that the Telnet server is enabled and that it is also enabled on the remote device.

  • Obtain the hostname for the remote device and, if needed, the username on the remote device.

Procedure

Command or Action Purpose

switch# telnet {ipv4-address | host-name} [port-number] [vrf vrf-name]

Creates an IP Telnet session to the specified destination.

The keywords and arguments are as follows:

  • port-number —Port number, from 1 to 65535, to use for this session. The default port number is 23

  • vrf-name —Default VRF.

Starting an IPv6 Telnet Session to a Remote Device

Before you begin

  • Log in to the CLI in EXEC mode.

  • Verify that the Telnet server is enabled and that it is also enabled on the remote device.

  • Obtain the hostname for the remote device and, if needed, the username on the remote device.

Procedure

Command or Action Purpose

switch# telnet6 {ipv6-address | host-name} [port-number] [vrf vrf-name]

Creates an IP Telnet session to the specified destination.

The keywords and arguments are as follows:

  • port-number —Port number, from 1 to 65535, to use for this session. The default port number is 23

  • vrf-name —Default VRF.

Clearing Telnet Sessions

Before you begin

Log in to the CLI in EXEC mode.

Procedure

  Command or Action Purpose
Step 1

switch# show users

Displays user session information.

Step 2

switch# clear line vty-line

Clears a user Telnet session.

Step 3

(Optional) switch# show users

(Optional)

Displays user session information.

Example

This example shows how to clear a Telnet session:

switch# show users
NAME     LINE         TIME         IDLE          PID COMMENT
admin    tty1         Jul 25 19:13  old         2867
admin    pts/1        Jul 28 14:04   .         31453 (::ffff:171.70.209.8)
admin    pts/2        Jul 28 14:04   .         31475 (171.70.209.8)*
switch# clear line 1
switch# show users
NAME     LINE         TIME         IDLE          PID COMMENT
admin    tty1         Jul 25 19:13  old         2867
admin    pts/2        Jul 28 14:04   .         31475 (171.70.209.8)*
switch# 

Verifying the Telnet Configuration

Use the following commands to verify the configuration.

Command

Purpose

show running-config security [all ]

Displays the user account configuration in the running configuration. The all keyword displays the default values for the user accounts.

show telnet server

Displays the telnet server configuration.

show hosts

Displays the configuration details for current hosts.

show tcp connection

Displays connection information.

Feature History for Telnet

This table only includes updates for those releases that have resulted in additions to the feature.

Feature Name

Feature Information

IPv6 support

5.2(1)SV3(1.1)

IPv6 support was added.

Telnet

4.0(4)SV1(1)

This feature was introduced.