Telnet

 

Telnet is a means to connect remotely to a router, so that you can configure and troubleshoot it from afar.  Each router's IOS runs a Telnet server automatically, which listens on Port 23.  There is no need to "startup" a Telnet service on the remote router since it is always running - however you must first set the “line vty 0 4” password on the remote machine to be able to telnet into it :

 

Configure a TELNET Password

 

config t

line vty 0 4

login                 (allows router to present a prompt)

password todd

 

 

Once the Telnet password is configured on a router’s interface, you can telnet in from any router that has an IP route to that interface using the command as follows :

 

Telnet into a Router

 

telnet  IP-address       or         IP-address  (router assumes you are trying to Telnet)

 

You will then be queried for the password.  Once you enter the password, the prompt will that router’s Priviledged mode prompt, such as:   2621a#

 

To display the Telnet sessions, type:      sh users   or   sh sessions

 

To suspend a Telnet session (go back to your local router but keep the connection open), type in:          CTRL-Shift-6  x            (hold the three keys for a split second, release, then hit x). 

Repeat the same strokes to go back to the Telnet session.

 

To cycle through multiple Telnet sessions 

You can do this with 2 or more sessions, then type “sh sessions”.  The list will shows your last visited router with an asterisk.  To resume that connection, hit Enter twice.  To goto any other session on the list, type the the number of that session and hit Enter twice.

 

To close a Telnet session (you must be at the local router – so first suspend the session) :

disconnect n  (n = number of session, from the “sh sessions” command)

            or         clear line n      or         exit

 

To telnet into a router with multiple interfaces – use the one closest to your router.  Remember – routers have no IP addresses – only their interfaces do !!!

 

Example:          telnet 172.16.40.2

            or:        172.16.40.2     (you do not need to type “telnet” – just the ip addr works)

 

2501a# telnet 172.16.40.2

2501c>                                    (you are now in the router 2501c  -  User mode)

2501c>exit

2501#>                                    (you are now back to your router)

 

Switching between Multiple Telnet Sessions

 

You can return to router 2501a while still maintaining your connection with 2501c, and can connect to another router as well.  You can then toggle back and forth quickly between the routers.

 

2501a# 172.16.40.2

2501c> hit  “CTRL-Shift-6 or CTRL-Shift-^  (same key), release, then hit X

2501a# 172.16.20.2

2501b>                        hit  “CTRL-Shift-6, release, then hit X

2501a#  show sessions      (will list the two sessions to the routers)

 

Now just hit the number shown for each session to toggle to that session.