Cisco 7600 Series Cisco IOS Software Configuration Guide, 12.1E
Configuring Cisco Discovery Protocol
Downloads: This chapterpdf (PDF - 190.0KB) The complete bookPDF (PDF - 7.08MB) | Feedback

Configuring CDP

Table Of Contents

Configuring CDP

Understanding How CDP Works

Configuring CDP

Enabling CDP Globally

Displaying the CDP Global Configuration

Enabling CDP on a Port

Displaying the CDP Interface Configuration

Monitoring and Maintaining CDP


Configuring CDP


This chapter contains information about how to configure Cisco Discovery Protocol (CDP) on the Catalyst 6500 series switches, which supplements the information in these publications:

The Cisco IOS Configuration Fundamentals Configuration Guide, Release 12.1, "Cisco IOS System Management," "Configuring Cisco Discovery Protocol (CDP)" at this URL:

http://www.cisco.com/univercd/cc/td/doc/product/software/ios121/121cgcr/fun_c/fcprt3/fcd301c.htm

The Cisco IOS Configuration Fundamentals Command Reference, Release 12.1, "Cisco IOS System Management Commands," "CDP Commands" publication at this URL:

http://www.cisco.com/univercd/cc/td/doc/product/software/ios121/121cgcr/fun_r/frprt3/frd3001b.htm

This chapter consists of these sections:

Understanding How CDP Works

Configuring CDP

Understanding How CDP Works

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

CDP runs on all LAN and WAN media that support Subnetwork Access Protocol (SNAP).

Each CDP-configured device sends periodic messages to a multicast address. Each device advertises at least one address at which it can receive SNMP messages. The advertisements also contain the time-to-live, or holdtime information, which indicates the length of time a receiving device should hold CDP information before discarding it.

Configuring CDP

These sections describe how to configure CDP:

Enabling CDP Globally

Displaying the CDP Global Configuration

Enabling CDP on a Port

Displaying the CDP Interface Configuration

Monitoring and Maintaining CDP


Note With Release 12.1(11b)E and later releases, when you are in configuration mode you can enter EXEC mode-level commands by entering the do keyword before the EXEC mode-level command.


Enabling CDP Globally

To enable CDP globally, perform this task:

Command
Purpose

Router(config)# cdp run

Enables CDP globally.

Router(config)# no cdp run

Disables CDP globally.


This example shows how to enable CDP globally:

Router(config)# cdp run

Displaying the CDP Global Configuration

To display the CDP configuration, perform this task:

Command
Purpose

Router# show cdp

Displays global CDP information.


This example shows how to display the CDP configuration:

Router# show cdp
Global CDP information:
        Sending CDP packets every 120 seconds
        Sending a holdtime value of 180 seconds
        Sending CDPv2 advertisements is enabled
Router# 

For additional CDP show commands, see the "Monitoring and Maintaining CDP" section.

Enabling CDP on a Port

To enable CDP on a port, perform this task:

 
Command
Purpose

Step 1 

Router(config)# interface {{type1  slot/port} | {port-channel number}}

Selects the port to configure.

Step 2 

Router(config-if)# cdp enable

Enables CDP on the port.

Router(config-if)# no cdp enable

Disables CDP on the port.

1 type = ethernet, fastethernet, gigabitethernet, or tengigabitethernet

This example shows how to enable CDP on Fast Ethernet port 5/1:

Router(config)# interface fastethernet 5/1
Router(config-if)# cdp enable

Displaying the CDP Interface Configuration

To display the CDP configuration for a port, perform this task:

Command
Purpose

Router# show cdp interface [{{type1  slot/port} | {port-channel number}}]

Displays information about ports where CDP is enabled.

1 type = ethernet, fastethernet, gigabitethernet, or tengigabitethernet


This example shows how to display the CDP configuration of Fast Ethernet port 5/1:

Router# show cdp interface fastethernet 5/1
FastEthernet5/1 is up, line protocol is up
  Encapsulation ARPA
  Sending CDP packets every 120 seconds
  Holdtime is 180 seconds
Router# 

Monitoring and Maintaining CDP

To monitor and maintain CDP on your device, perform one or more of these tasks:

Command
Purpose

Router# clear cdp counters

Resets the traffic counters to zero.

Router# clear cdp table

Clears information about neighbors from the CDP table.

Router# show cdp

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

Router# show cdp entry entry_name [protocol | version]

Displays information about a specific neighbor. The display can be limited to protocol or version information.

Router# show cdp interface [type1  slot/port}]

Displays information about interfaces on which CDP is enabled.

Router# show cdp neighbors [type1 slot/port] [detail]

Displays information about neighbors. The display can be limited to neighbors on a specific interface and expanded to provide more detailed information.

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. Refer to the Debug Command Reference publication for more information about CDP debug commands.

1 type = ethernet, fastethernet, gigabitethernet, or tengigabitethernet


This example shows how to clear CDP counter configuration:

Router# clear cdp counters

This example shows how to display information about the neighboring equipment:

Router# 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
JAB023807H1      Fas 5/3            127         T S       WS-C2948  2/46
JAB023807H1      Fas 5/2            127         T S       WS-C2948  2/45
JAB023807H1      Fas 5/1            127         T S       WS-C2948  2/44
JAB023807H1      Gig 1/2            122         T S       WS-C2948  2/50
JAB023807H1      Gig 1/1            122         T S       WS-C2948  2/49
JAB03130104      Fas 5/8            167         T S       WS-C4003  2/47
JAB03130104      Fas 5/9            152         T S       WS-C4003  2/48