Configuring CDP

Finding Feature Information

Your software release may not support all the features documented in this chapter. For the latest feature information and caveats, see the release notes for your platform and software release.

Use Cisco Feature Navigator to find information about platform support and Cisco software image support. To access Cisco Feature Navigator, go to http://www.cisco.com/go/cfn. An account on Cisco.com is not required.

Information About CDP

CDP

CDP is a device discovery protocol that runs over Layer 2 (the data link layer) on all Cisco-manufactured devices (routers, bridges, access servers, and switches) and allows network management applications to discover Cisco devices that are neighbors of already known devices. With CDP, network management applications can learn the device type and the Simple Network Management Protocol (SNMP) agent address of neighboring devices running lower-layer, transparent protocols. This feature enables applications to send SNMP queries to neighboring devices.

CDP runs on all media that support Subnetwork Access Protocol (SNAP). Because CDP runs over the data-link layer only, two systems that support different network-layer protocols can learn about each other.

Each CDP-configured device sends periodic messages to a multicast address, advertising at least one address at which it can receive SNMP messages. The advertisements also contain time-to-live, or holdtime information, which is the length of time a receiving device holds CDP information before discarding it. Each device also listens to the messages sent by other devices to learn about neighboring devices.

On the switch, CDP enables Network Assistant to display a graphical view of the network. The switch uses CDP to find cluster candidates and maintain information about cluster members and other devices up to three cluster-enabled devices away from the command switch by default.

For a switch and connected endpoint devices running Cisco Medianet, these events occur:

  • CDP identifies connected endpoints that communicate directly with the switch.
  • Only one wired switch reports the location information to prevent duplicate reports of neighboring devices.
  • The wired switch and the endpoints both send and receive location information.

The switch supports CDP Version 2.

Default CDP Configuration

 

Table 32-1 Default CDP Configuration

Feature
Default Setting

CDP global state

Enabled

CDP interface state

Enabled

CDP timer (packet update frequency)

60 seconds

CDP holdtime (before discarding)

180 seconds

CDP Version-2 advertisements

Enabled

How to Configure CDP

Configuring the CDP Parameters

You can configure the frequency of CDP updates, the amount of time to hold the information before discarding it, and whether or not to send Version-2 advertisements.


Note Steps 2 through 4 are all optional and can be performed in any order.


 

Command
Purpose

Step 1

configure terminal

Enters global configuration mode.

Step 2

cdp timer seconds

(Optional) Sets the transmission frequency of CDP updates in seconds.

The range is 5 to 254; the default is 60 seconds.

Step 3

cdp holdtime seconds

(Optional) Specifies the amount of time a receiving device should hold the information sent by your device before discarding it.

The range is 10 to 255 seconds; the default is 180 seconds.

Step 4

cdp advertise-v2

(Optional) Configures CDP to send Version-2 advertisements.

This is the default state.

Step 5

end

Returns to privileged EXEC mode.

Disabling CDP

CDP is enabled by default.


Note Switch clusters and other Cisco devices (such as Cisco IP Phones) regularly exchange CDP messages. Disabling CDP can interrupt cluster discovery and device connectivity.


 

Command
Purpose

Step 1

configure terminal

Enters global configuration mode.

Step 2

no cdp run

Disables CDP globally.

Step 3

interface interface-id

Specifies the interface on which you are disabling CDP, and enters interface configuration mode.

Step 4

no cdp enable

Disables CDP on the interface.

Step 5

end

Returns to privileged EXEC mode.

Monitoring and Maintaining CDP

 

Command
Description

clear cdp counters

Resets the traffic counters to zero.

clear cdp table

Deletes the CDP table of information about neighbors.

show cdp

Displays global information, such as frequency of transmissions and the holdtime for packets being sent.

show cdp entry entry-name [ protocol | version ]

Displays information about a specific neighbor.

You can enter an asterisk (*) to display all CDP neighbors, or you can enter the name of the neighbor about which you want information.

You can also limit the display to information about the protocols enabled on the specified neighbor or information about the version of software running on the device.

show cdp interface [ interface-id ]

Displays information about interfaces where CDP is enabled.

You can limit the display to the interface about which you want information.

show cdp neighbors [ interface-id ] [ detail ]

Displays information about neighbors, including device type, interface type and number, holdtime settings, capabilities, platform, and port ID.

You can limit the display to neighbors of a specific interface or expand the display to provide more detailed information.

show cdp traffic

Displays CDP counters, including the number of packets sent and received and checksum errors.

Configuration Examples for CDP

Configuring CDP Parameters: Example

This example shows how to configure CDP parameters:

Switch# configure terminal
Switch(config)# cdp timer 50
Switch(config)# cdp holdtime 120
Switch(config)# cdp advertise-v2
Switch(config)# end

Enabling CDP: Examples

This example shows how to enable CDP on a port when it has been disabled:

Switch# configure terminal
Switch(config)# interface gigabitethernet1/1
Switch(config-if)# cdp enable
Switch(config-if)# end

Note Voice VLAN is not counted against port security when CDP is disabled on the switch interface.


This example shows how to enable CDP if it has been disabled:

Switch# configure terminal
Switch(config)# cdp run
Switch(config)# end

Additional References

The following sections provide references related to switch administration:

Related Documents

Related Topic
Document Title

Cisco IE 2000 commands

Cisco IE 2000 Switch Command Reference, Release 15.0(1)EY

Cisco IOS basic commands
Cisco IOS system management commands

Cisco IOS Configuration Fundamentals Command Reference

Switch cluster configuration

Chapter 6, “Configuring Switch Clusters”

Standards

Standards
Title

No new or modified standards are supported by this feature, and support for existing standards has not been modified by this feature.

MIBs

MIBs
MIBs Link

To locate and download MIBs using Cisco IOS XR software, use the Cisco MIB Locator found at the following URL and choose a platform under the Cisco Access Products menu: http://cisco.com/public/sw-center/netmgmt/cmtk/mibs.shtml

RFCs

RFCs
Title

No new or modified RFCs are supported by this feature, and support for existing RFCs has not been modified by this feature.