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:
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:
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:
To see the connections made from your router to a remote device, use the show sessions command.
Checking Telnet Users
You can list all active consoles and VTY ports in use on your router with the show users command:
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.Trying 172.16.10.2 … Open
Password required, but none set
[Connection to 172.16.10.2 closed by foreign host]
RouterA#
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:Trying 172.16.10.2 … Open
Password required, but none set
[Connection to 172.16.10.2 closed by foreign host]
RouterA#
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: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
RouterA#172.16.10.2
Trying 172.16.10.2 … Open
User Access Verification
Password:
RouterB>
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 ConnectionsTrying 172.16.10.2 … Open
User Access Verification
Password:
RouterB>[Cntl+Shift+6, then X]
RouterA#
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.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#
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.Line User Host(s) Idle Location
* 0 con 0 172.16.10.2 00:07:52
192.168.0.148 00:07:18
No comments:
Post a Comment