Cisco Discovery Protocol (CDP)

advertisement
CCNA2 Chapter 4
Learning about other Devices
Cisco Discovery Protocol (CDP)
Neighbor Discovery with CDP
Scenario: Assume your boss asks you to create a topology map of the
network, including model numbers, IOS versions of Cisco equipment, etc.
Now, suppose you are not in the building where the equipment is. You
could use the Cisco Discovery Protocol (CDP) to gather information of
directly connected Cisco neighbors.
CDP is:
• Cisco proprietary (as the name indicates)
•Operates at the Data Link layer
•Functions regardless of what Physical layer media yu are using (fiber,
UTP, etc)
•Network layer routed protocol independent (IP, IPX, AppleTallk, etc)
•Enabled on all Cisco devices by default
•Sent as a multicast every 60 seconds out of all functioning interfaces,
which enables neighbor Cisco devices collect information about each
other.
Cisco Discovery Protocol (CDP)
CDP is used to:
• gather hardware and protocol information about neighboring devices
• types of devices (switch, type of router)
• router interfaces they are connected to
• interfaces used to make the connection ( E0, S0, etc.)
• model number of the devices
Best way to learn CDP is to do the labs!
Cisco Discovery Protocol (CDP)
When a Cisco device boots up, CDP starts up automatically and allows the
device to detect neighboring devices that are also running CDP.
CDP runs over the data link layer and allows the two systems to learn
about each other.
Each device configured for CDP sends periodic messages, known as
advertisements, to multiple Cisco routers
Cisco Discovery Protocol (CDP)
Primary use of CDP is to discover all Cisco devices that are directly
connected to a local device.
This is done by transmitting type length values (TLVs) which are blocks of
information embedded in CDP advertisements.
To display the CDP information, use the command:
show cdp
Shows information that can be configured in Cisco
devices:
CDP timer - how often CDP packets are transmitted to
all active interfaces
CDP hold time – the amount of time that the device will
hold packets received from neighbor devices
Cisco Discovery Protocol (CDP)
Merida# show cdp
Global CDP information:
Sending CDP packets every 60 seconds
Sending a holdtime value of 180 seconds
Sending CDPv2 advertisements is enabled
Merida# show cdp neig
Capability Codes: R - Router, T - Trans Bridge, B - Source Route
Bridge
S - Switch, H - Host, I - IGMP, r - Repeater, P - Phone
Device ID Local Intrfce Holdtme Capability Platform Port
ID
Internet Fas 0/0
168
R
C2600
Fas 0/0
Vargas
Ser 0/0
168
R
C2600
Ser 0/0
Cisco Discovery Protocol (CDP)
Device TLVs displayed by the show cdp neighbors include:
• Device ID (hostname of device directly connected)
• Local Interface (port or interface in which you received CDP packets)
• Holdtime (keeps track of how long it has been since you received
information from that neighbor and how many seconds to wait until you
consider that neighbor dead)
• Capability (router, switch, or repeater)
• Platform (the model number such as Cisco router 2600, etc.)
• Port ID (interface in which the neighbor device sent out the CDP
information)
* Supported by Cisco IOS release 12.0(3)T or later
Cisco Discovery Protocol (CDP)
Sarasota# show
cdp neighbors
Capability Codes: R - Router, T - Trans Bridge, B - Source Route Bridge
S - Switch, H - Host, I - IGMP, r - Repeater, P - Phone
Device ID Local Intrfce Holdtme Capability Platform Port ID
Bradenton Ser 0/0
147
R
PT1000
Ser 9/0
Miami
Ser 1/0
148
R
PT1000
Ser 9/0
Sarasota#
Cisco Discovery Protocol (CDP)
To enable CDP globally:
cdp run
CDP is globally enabled by default.
NOTE: on some switches (1900) cdp is not enabled
To enable CDP on a particular interface, do:
cdp enable
On Cisco IOS Release 10.2 or higher, CDP is enabled by default
CDP Exercise
Create the topology in the graph
Change the hostnames to
Bradenton, Sarasota and Miami.
Assign IP addresses with their respective masks:
Bradenton Serial 9/0: 211.211.211.1 255.255.255.0 – clock rate 56000
Sarasota: Serial 0/0 211.211.211.2 255.255.255.0
Sarasota: Serial 1/0 200.200.200.1 255.255.255.0 – clock rate 56000
Miami:
Serial 9/0 200.200.200.2 255.255.255.0
NOTE: You may have different numbers for your serial
interfaces
From the Sarasota router, issue a show CDP neighbors
command. Your output should look like the one from slide 8
Cisco Discovery Protocol (CDP)
NOTE:
1.
Disable CDP at the global level with no cdp run
2.
If CDP is disabled globally, individual interfaces cannot be enabled
for CDP
3.
IOS Release 10.3 or higher, CDP is enabled by default.
4.
To disable CDP on a specific interface after it has been enabled:
no cdp enable
CDP Exercise 2 (Dissable CDP in local interface)
Test this with the Sarasota router.
(You must be in that interface first.)
Sarasota(config)#int s1/0
Sarasota(config-if)#no cdp enable
Issue the following command, and you’ll see info coming form
interface…..?
Sarasota#show cdp neig
Now, put it back the way it was
Sarasota(config)#int s1/0
Sarasota(config-if)# cdp enable
Sarasota#show cdp neig
Sarasota#show cdp neig
CDP Exercise 3 (Dissable CDP globally)
Test this with the Sarasota router.
Sarasota(config)#no cdp run
Issue the following command, and you’ll see info coming form
interface…..?
Sarasota#show cdp neig
Now, put it back the way it was
Sarasota(config)# cdp run
and check it again
Sarasota#show cdp neig
Clear cdp counters
Useful for resetting interface statistics on a Cisco router
Show cdp
Show cdp entry
Show cdp interface
Status of the
carrier detect
signal
Keepalive
messages
Show cdp neighbors
Know this output!
Router#show cdp neighbors detail will
also give the IP address of the neighboring Cisco
device
Telnet
Telnet is a virtual terminal protocol that is part of the TCP/IP protocol suite.
Provides a remote login capability.
Telnet function is at the application layer. If a telnet command is successful
from one device to another, then all 7 layers of the OSI model is ‘working’.
Cisco says - It is the most complete testing mechanism available.
Telnet uses the five (5) vty sessions.
There has to be a ‘login’ and password associated with the vty
session in order for telnet to work.
If a Telnet session is left open for 10 minutes without activity, it will
automatically close itself.
Reopening a suspended Telnet session
• Multiple Telnet sessions can be used and
suspended by using the Ctrl-Shift-6, then x
sequence.
• The session can be resumed by pressing Enter.
• Pressing the Enter key causes Cisco IOS to
resume the most recently suspended session.
• The resume command can be used to start up a
previous session, but must know the
connection ID.
• Use the show sessions command to get the
connection ID, then resume the correct session.
Reopening a suspended Telnet session
It works
with Packet
Tracer!
Telnet
If there is a ‘host table’ on the router ( ip host <name> <ip add> ), then you
can do telnet <host name>.
As an example:
telnet routerB
DO THE LABS FOR resuming and suspending SESSION.
NOTE:
1.
Pressing Enter takes you to the most recent session
2.
To resume a session it needs a connection ID.
Ping
Ping command is used to determine if a particular ip address is reachable.
Traceroute command is used to trace the route to an ip address.
Ping sends ICMP echo request messages and receive an echo reply.
Ping Command Code
Explanation
!
ICMP echo reply received
.
Nothing received
U
ICMP unreachable (destination) received
N
ICMP unreachable (network) received
P
ICMP unreachable (port) received
Interface Protocol
Serial is up, line protocol is up
operational
Serial is up, line protocol is down
Connection problems (L2)
Serial is down, line protocol is down
Interface problems (L1)
Serial is administratively down,
line protocol is down
Manually disabled
Interface Protocol
For serial port:
Serial is up, line protocol is down maybe caused by:
• network mismatched
• clock rate not set on DCE
• mismatch of encapsulation (HDLC vs. PPP)
Key terms
Hostname hostname
Ip host hostname IP
Ip domain-lookup
no ip domain-lookup
Exec-timeout minutes seconds
show cdp neighbors
show cdp neighbors detail
cdp run
cdp enable
telnet IP_address
Download