CCNA: Chapter 3-10 Using Telnet on IOS

Earlier in the chapter you learned that you can telnet into a Cisco device running IOS to manage it. It is also possible to telnet from a Cisco IOS device to another device. This can be useful when troubleshooting across multiple devices. In this section you will learn to initiate and manage telnet connections from IOS CLI.

To telnet to another device from IOS, use the telnet command as shown below:

myRouter#telnet 192.168.1.7

Trying 192.168.1.7 … Open

Username: admin
Password:

Switch>

Remember that if the remote device is an IOS device, it should have a line password and an enabled password/secret configured. Without these, you will not be able to telnet in or get into the privilege exec mode.

When you exit the telnet session using logout or exit command on the remote device, you will be back to the prompt of the device from where the session was initiated, as shown below:

Switch#logout

[Connection to 192.168.1.7 closed by foreign host]
myRouter#

You can telnet to multiple devices simultaneously. For that, you will first need to toggle back to the local device prompt form the remote prompt using Crtl+Shift+6 followed by the X key. For example, in the output below, I first telnet to the switch like before and enter its privilege exec mode. Then I press the Ctrl+Shift+6 sequence following by X. The whole sequence will not be seen in the output but you will notice that I am back to the prompt of myRouter:

The asterisk (*) sign next to a session shows the most recent session. You can return to that session by pressing Enter twice. You can return to any session by typing the number of the session and pressing Enter. In the output below, I toggle between the two sessions. Notice how pressing enter twice or just entering the session number as a command takes me back to the telnet sessions. Also notice that I can toggle between the sessions and the first device using Ctrl+Shift+6 X sequence.

While managing a device, you can see who is connected to the device using the show users command as shown below:

myRouter#show users

Line User Host(s) Idle Location

*194 vty 0 admin idle 00:00:00 10.1.10.228

195 vty 1 admin idle 00:00:00 10.1.10.18

The above output shows that two users are connected to the device using Telnet. The asterisks (*) sign denotes the connection where theshow users command was executed. The first connection is using line 194 and vty line 0 and the second is using line 195 and vty line 1. It is possible to disconnect someone’s session from the device using the clear line <line number> command. In the output below, I have disconnected the second connection from the first session: