Configuring Cisco Discovery Protocol
Configuring Cisco Discovery Protocol
Configuring Cisco Discovery Protocol
This chapter describes how the Cisco Discovery Protocol (CDP) works with Simple Network
Management Protocol (SNMP) to identify other devices in your network.
For a complete description of the router monitoring commands mentioned in this chapter, refer to the
“CDP Commands” chapter in the “System Management” part of the Release 12.2 Cisco IOS
Configuration Fundamentals Command Reference. To locate documentation of other commands that
appear in this chapter, use the Cisco IOS Command Reference Master Index or search online.
VTP is a discovery technique deployed by switches where each switch advertises its management
domain on its trunk ports, its configuration revision number, and its known VLANs and their specific
parameters. A VTP domain is made up of one or more interconnected devices that share the same VTP
domain name. A switch can be configured to be in only one VTP domain.
Type-Length-Value fields (TLVs) are blocks of information embedded in CDP advertisements. Table 19
summarizes the TLV definitions for CDP advertisements.
TLV Definition
Device-ID TLV Identifies the device name in the form of a character string.
Address TLV Contains a list of network addresses of both receiving and
sending devices.
Port-ID TLV Identifies the port on which the CDP packet is sent.
Capabilities TLV Describes the functional capability for the device in the form of
a device type, for example, a switch.
Version TLV Contains information about the software release version on
which the device is running.
Platform TLV Describes the hardware platform name of the device, for
example, Cisco 4500.
IP Network Prefix TLV Contains a list of network prefixes to which the sending device
can forward IP packets. This information is in the form of the
interface protocol and port number, for example, Eth 1/0.
VTP Management Domain TLV Advertises the system’s configured VTP management domain
name-string. Used by network operators to verify VTP domain
configuration in adjacent network nodes.
Native VLAN TLV Indicates, per interface, the assumed VLAN for untagged packets
on the interface. CDP learns the native VLAN for an interface.
This feature is implemented only for interfaces that support the
IEEE 802.1Q protocol.
Full/Half Duplex TLV Indicates status (duplex configuration) of CDP broadcast
interface. Used by network operators to diagnose connectivity
problems between adjacent network elements.
Note The cdp enable, cdp timer, and cdp run global configuration commands affect the operation of the
IP on-demand routing feature (that is, the router odr global configuration command). For more
information on the router odr command, see the “On-Demand Routing Commands” chapter in the
Release 12.2 Cisco IOS IP Command Reference, Volume 2 of 3: Routing Protocols document.
Command Purpose
Step 1 Router(config)# cdp timer seconds Specifies frequency of transmission of CDP updates.
Step 2 Router(config)# cdp holdtime seconds Specifies the amount of time a receiving device should hold the
information sent by your device before discarding it.
Command Purpose
Router(config)# cdp run Enables CDP on the system.
Command Purpose
Router(config)# cdp advertise-v2 Enables CDPv2 advertising functionality on the system.
To reenable CDP on an interface after disabling it, use any of the following command in interface
configuration mode, as needed:
Command Purpose
Router(config-if)# cdp enable Enables CDP on an interface.
Command Purpose
Router# clear cdp counters Resets the traffic counters to zero.
Router# clear cdp table Deletes the CDP table of information about neighbors.
Router# show cdp Displays the interval between transmissions of CDP
advertisements, the number of seconds the CDP advertisement is
valid for a given port, and the version of the advertisement.
Router# show cdp entry device-name [protocol | Displays information about a specific neighbor. Display can be
version] limited to protocol or version information.
Router# show cdp interface [type number] Displays information about interfaces on which CDP is enabled.
Router# show cdp neighbors [type number] [detail] Displays the type of device that has been discovered, the name
of the device, the number and type of the local interface (port),
the number of seconds the CDP advertisement is valid for the
port, the device type, the device product number, and the port ID.
Issuing the detail keyword displays information on the native
VLAN ID, the duplex mode, and the VTP domain name
associated with neighbor devices.
Router# show cdp traffic Displays CDP counters, including the number of packets sent
and received and checksum errors.
Router# show debugging Displays information about the types of debugging that are
enabled for your router. Refer to the Cisco IOS Debug Command
Reference for more information about CDP debug commands.
In the following example, the user sets the holdtime to be 90 seconds and sets the router to show that the
updates are working correctly:
Router(config)# cdp holdtime 90
Router(config)# exit
Router# show cdp interface
Serial0 is up, line protocol is up
Encapsulation is HDLC
Sending CDP packets every 30 seconds
Holdtime is 90 seconds
Field Definition
Capability Codes The type of device that can be discovered.
Device ID The name of the neighbor device and either the MAC address or
the serial number of this device.
Local Intrfce The protocol being used by the connectivity media.
Holdtme The remaining amount of time (in seconds) the current device
will hold the CDP advertisement from a sending router before
discarding it.
Capability The type of the device listed in the CDP Neighbors table.
Possible values are as follows:
R—Router
T—Transparent bridge
B—Source-routing bridge
S—Switch
H—Host
I—IGMP device
r—Repeater
Platform The product number of the device.
Port ID The protocol and port number of the device.