Skip to main content

Using Telnet on Cisco Router

Telnet, part of the TCP/IP protocol suite, is a virtual terminal protocol that allows you to make connections to remote devices, gather information, and run programs.
After your routers and switches are configured, you can use the Telnet program to reconfigure and/or check up on your routers and switches without using a console cable. You run the Telnet program by typing telnet from any command prompt (DOS or Cisco). You need to have VTY passwords set on the routers for this to work.
Remember, you can’t use CDP to gather information about routers and switches that aren’t directly connected to your device. But you can use the Telnet application to connect to your neighbor devices, and then run CDP on those remote devices to get information on them. You can issue the telnet command from any router prompt like this:
RouterA#telnet 172.16.10.2
Trying 172.16.10.2 … Open
Password required, but none set
[Connection to 172.16.10.2 closed by foreign host]
RouterA#
As you can see, I didn’t set my passwords—how embarrassing! Remember that the VTY ports on a router are configured as login, meaning that we have to either set the VTY passwords or use the no login command.
On a Cisco router, you don’t need to use the telnet command; you can just type in an IP address from a command prompt and the router will assume that you want to telnet to the device. Here’s how that looks:
RouterA#172.16.10.2
Trying 172.16.10.2 … Open
Password required, but none set
[Connection to 172.16.10.2 closed by foreign host]
RouterA#
At this point, it would be a great idea to set those VTY passwords on the router I want to telnet into. Here’s what I did on the remote router:
RouterB#config t
Enter configuration commands, one per line. End with CNTL/Z.
RouterB(config)#line vty 0 4
RouterB(config-line)# password your-password
RouterB(config-line)# login
RouterB(config-line)#^Z
RouterB#
%SYS-5-CONFIG_I: Configured from console by console
Now let’s try this again. You’ll connecting to the router from the RouterA console:
RouterA#172.16.10.2
Trying 172.16.10.2 … Open
User Access Verification
Password:
RouterB>

Telnetting into Multiple Devices Simultaneously
If you telnet to a router or switch, you can end the connection by typing exit at any time. But what if you want to keep your connection to a remote device but still come back to your original router console? To do that, you can press the Ctrl+Shift+6 key combination, release it, and then press X.
Here’s an example of connecting to multiple devices from RouterA router console:
RouterA#telnet 172.16.10.2
Trying 172.16.10.2 … Open
User Access Verification
Password:
RouterB>[Cntl+Shift+6, then X]
RouterA#
Checking Telnet Connections
To see the connections made from your router to a remote device, use the show sessions command.
RouterA#sh sessions
Conn Host Address Byte Idle Conn Name
1 172.16.10.2 172.16.10.2 0 0 172.16.10.2
* 2 192.168.0.148 192.168.0.148 0 0 192.168.0.148
RouterA#
See that asterisk (*) next to connection 2? It means that session 2 was your last session. You can return to your last session by pressing Enter twice. You can also return to any session by typing the number of the connection and pressing Enter twice.
Checking Telnet Users
You can list all active consoles and VTY ports in use on your router with the show users command:
RouterA#sh users
Line User Host(s) Idle Location
* 0 con 0 172.16.10.2 00:07:52
192.168.0.148 00:07:18
In the command’s output, con represents the local console. In this example, the console is connected to two remote IP addresses, or, in other words, two devices.

Comments

Popular posts from this blog

[韓日関係] 首相含む大幅な内閣改造の可能性…早ければ来月10日ごろ=韓国

div not scrolling properly with slimScroll plugin

I am using the slimScroll plugin for jQuery by Piotr Rochala Which is a great plugin for nice scrollbars on most browsers but I am stuck because I am using it for a chat box and whenever the user appends new text to the boxit does scroll using the .scrollTop() method however the plugin's scrollbar doesnt scroll with it and when the user wants to look though the chat history it will start scrolling from near the top. I have made a quick demo of my situation http://jsfiddle.net/DY9CT/2/ Does anyone know how to solve this problem?

Why does this javascript based printing cause Safari to refresh the page?

The page I am working on has a javascript function executed to print parts of the page. For some reason, printing in Safari, causes the window to somehow update. I say somehow, because it does not really refresh as in reload the page, but rather it starts the "rendering" of the page from start, i.e. scroll to top, flash animations start from 0, and so forth. The effect is reproduced by this fiddle: http://jsfiddle.net/fYmnB/ Clicking the print button and finishing or cancelling a print in Safari causes the screen to "go white" for a sec, which in my real website manifests itself as something "like" a reload. While running print button with, let's say, Firefox, just opens and closes the print dialogue without affecting the fiddle page in any way. Is there something with my way of calling the browsers print method that causes this, or how can it be explained - and preferably, avoided? P.S.: On my real site the same occurs with Chrome. In the ex