Documenting a Network Topology Using CDP
You
can determine the router types, interface types, and IP addresses of various
interfaces using only CDP commands and the show running-config command.
Using Telnet
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.
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:
Corp#telnet
10.2.2.2
Trying 10.2.2.2 ... Open
Password required, but none set
[Connection to 10.2.2.2 closed by foreign host]
Corp#
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 Here’s how that looks using just the IP
address:
Corp#10.2.2.2
Trying 10.2.2.2 ... Open
Password required, but none set
[Connection to 10.2.2.2 closed by foreign host]
Corp#
Now
set VTY passwords on the router I want
to telnet into (chapter4).
Now
let’s try this again:
Corp#10.2.2.2
Trying 10.2.2.2 ... Open
User Access Verification
Password:
R1>
Remember
that the VTY password is the user-mode password, not the enable-mode password. Watch
what happens when I try to go into privileged mode after telnetting into router
R1:
R1>en
% No password set
R1>
It
is basically saying, “No way!” This is a really good security feature because
you don’t want anyone telnetting into your device and being able to just type
the enable command to get into privileged mode. You’ve got to set your
enable-mode password or enable secret password to use Telnet to configure
remote devices!
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 my Corp router console:
Corp#10.2.2.2
Trying 10.2.2.2 ... Open
User Access Verification
Password:
R1>Ctrl+Shift+6
Corp#
In
this example, I telnetted to the R1 router and then typed the password to enter
user mode.I next pressed Ctrl+Shift+6, then X (but you can’t see that because
it doesn’t show on the screen output). Notice that my command prompt is now
back at the Corp router.
Checking Telnet Connections
To
see the connections made from your router to a remote device, use the show
sessions command:
Corp#sh
sessions
Conn Host Address Byte Idle
Conn Name
1 10.2.2.2 10.2.2.2
0 0 10.2.2.2
* 2 10.1.1.2 10.1.1.2 0 0
10.1.1.2
Corp#
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.
Checking Telnet Users
You
can list all active consoles and VTY ports in use on your router with the show
users command:
Corp#sh
users
Line User
Host(s) Idle Location
* 0 con 0 10.1.1.2
00:00:01
10.2.2.2 00:01:06
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.
Closing Telnet Sessions
You
can end Telnet sessions by typing exit or disconnect.
To end a session from a remote device, use the exit
command:
ap>exit
[Connection to 10.1.1.2 closed by foreign host]
Corp#
To end a session from a local device, use the disconnect
command:
Corp#sh
session
Conn Host Address Byte Idle
Conn Name
2 10.2.2.2 10.2.2.2
0 0 10.2.2.2
Corp#disconnect 2
Closing connection to 10.2.2.2 [confirm][enter]
Corp#
In
this example, I used the session number 2 because that was the connection to
the R1 router that I wanted to end. As I showed, you can use the show sessions
command to see the connection number.
Notice
the show users command :
R1#sh users
Line User
Host(s) Idle Location
* 0 con 0
idle 00:00:00
vty 194
idle 00:00:21 10.2.2.1
This
output shows that VTY has IP address 10.2.2.1 connected. That’s the Corp
router. Also notice that the Corp router connected to line 194—remember, you
cannot choose which line you connect to! This is why we set the same password
on all lines. To clear the connection, use the clear line # command:
R1#clear
line 194
[confirm][enter]
[OK]
R1#sh users
Line User
Host(s) Idle Location
* 0 con 0
idle 00:00:00
This
output confirms that the line has been cleared.
No comments:
Post a Comment