Configuring CDP

This chapter describes how to configure Cisco Discovery Protocol (CDP) on your switch.

Note For complete syntax and usage information for the commands used in this chapter, refer to the Catalyst 3550 Multilayer Switch Command Reference for this release and the Cisco IOS Configuration Fundamentals Command Reference for Release 12.1.

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 Catalyst 3550 switch, CDP enables the Cluster Management Suite 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.

Beginning in privileged EXEC mode, follow these steps to enable CDP when it has been disabled:

Command

Purpose

Step 1

configure terminal

Enter global configuration mode.

Step 2

cdp run

Enable CDP after disabling it.

Step 3

end

Return to privileged EXEC mode.

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

Switch# configure terminal

Switch(config)# cdp run

Switch(config)# end

Disabling and Enabling CDP on an Interface

CDP is enabled by default on all supported interfaces to send and receive CDP information.

Beginning in privileged EXEC mode, follow these steps to disable CDP on an interface:

Command

Purpose

Step 1

configure terminal

Enter global configuration mode.

Step 2

interfaceinterface-id

Enter interface configuration mode, and enter the interface on which you are disabling CDP.

Step 3

no cdp enable

Disable CDP on an interface.

Step 4

end

Return to privileged EXEC mode.

Step 5

copy running-config startup-config

(Optional) Save your entries in the configuration file.

Beginning in privileged EXEC mode, follow these steps to enable CDP on an interface when it has been disabled:

Command

Purpose

Step 1

configure terminal

Enter global configuration mode.

Step 2

interfaceinterface-id

Enter interface configuration mode, and enter the interface on which you are enabling CDP.

Step 3

cdp enable

Enable CDP on an interface after disabling it.

Step 4

end

Return to privileged EXEC mode.

Step 5

copy running-config startup-config

(Optional) Save your entries in the configuration file.

This example shows how to enable CDP on an interface when it has been disabled.

Switch# configure terminal

Switch(config)# interface gigabitethernet0/5

Switch(config-if)# cdp enable

Switch(config-if)# end

Monitoring and Maintaining CDP

To monitor and maintain CDP on your device, perform one or more of these tasks, beginning in privileged EXEC mode.

Command

Description

clear cdp counters

Reset the traffic counters to zero.

clear cdp table

Delete the CDP table of information about neighbors.

show cdp

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

show cdp entryentry-name [protocol| version]

Display 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 [type number]

Display information about interfaces where CDP is enabled.

You can limit the display to the type of interface or the number of the interface about which you want information (for example, entering gigabitethernet 0/1 displays information only about Gigabit Ethernet port 1).