Configuring CDP
This chapter describes how to configure Cisco Discovery Protocol (CDP) on the Cisco Industrial Ethernet 2000U Series (IE 2000U) and Connected Grid Switches, hereafter referred to as switch .
NoteFor complete syntax and usage information for the commands used in this chapter, see the documents listed in the“Related Documents” section.
Information About 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 hold time 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.
The switch supports CDP Version 2.
Prerequisites
Interfaces must support Subnetwork Access Protocol (SNAP) headers.
Guidelines and Limitations
- Cisco Discovery Protocol functions only on Cisco devices.
- Cisco Discovery Protocol is not supported on Frame Relay multipoint subinterfaces.
Default Settings
|
|
CDP global state |
Enabled. |
CDP interface state |
Enabled only on NNIs; disabled on ENIs. Note CDP is not supported on UNIs. |
CDP timer (packet update frequency) |
60 seconds. |
CDP holdtime (before discarding) |
180 seconds. |
CDP Version-2 advertisements |
Enabled. |
Configuring CDP
This section includes the following topics:
Configuring the CDP Characteristics
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.
CDP packets are sent with a time to live, or hold time, value. The receiving device will discard the CDP information in the CDP packet after the hold time has elapsed.
You can set the hold time lower than the default setting of 180 seconds if you want the receiving devices to update their CDP information more rapidly. The CDP hold time must be set to a higher number of seconds than the time between CDP transmissions, which is set using the cdp timer command.
BEFORE YOU BEGIN
Steps 2 through 4 are all optional and can be performed in any order.
DETAILED STEPS
|
|
|
Step 1 |
configure terminal |
Enter global configuration mode. |
Step 2 |
cdp timer seconds |
(Optional) Set 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) Specify 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) Configure CDP to send Version-2 advertisements. This is the default state. |
Step 5 |
end |
Return to privileged EXEC mode. |
Step 6 |
show cdp |
Verify your settings. |
Step 7 |
copy running-config startup-config |
(Optional) Save your entries in the configuration file. |
Use the no form of the CDP commands to return to the default settings.
EXAMPLE
This example shows how to configure CDP characteristics:
Switch# configure terminal
Switch(config)# cdp timer 50
Switch(config)# cdp holdtime 120
Switch(config)# cdp advertise-v2
Disabling and Enabling CDP
CDP is enabled by default on NNIs. It is disabled by default on ENIs but can be enabled.
BEFORE YOU BEGIN
Cisco devices (such as Cisco IP phones) regularly exchange CDP messages with connected devices. Disabling CDP can interrupt device connectivity.
DETAILED STEPS
|
|
|
Step 1 |
configure terminal |
Enter global configuration mode. |
Step 2 |
no cdp run |
Disable CDP. |
Step 3 |
end |
Return to privileged EXEC mode. |
EXAMPLE
Switch# configure terminal
Switch(config)# no cdp run
DETAILED STEPS
|
|
|
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. |
EXAMPLE
Switch# configure terminal
Disabling and Enabling CDP on an Interface
CDP is enabled by default on NNIs to send and to receive CDP information. You can enable CDP on ENIs, but it is not supported on UNIs.
Disabling CDP on an Interface
BEFORE YOU BEGIN
Cisco devices (such as Cisco IP phones) regularly exchange CDP messages with connected devices. Disabling CDP can interrupt device connectivity.
DETAILED STEPS
|
|
|
Step 1 |
configure terminal |
Enter global configuration mode. |
Step 2 |
interface interface-id |
Specify the interface on which you are disabling CDP, and enter interface configuration mode. Note If the interface is a UNI, you must enter the port-type nni or port-type eni interface configuration command before configuring CDP. By default, CDP is enabled on NNIs and disabled on ENIs. |
Step 3 |
no cdp enable |
Disable CDP on the interface. |
Step 4 |
end |
Return to privileged EXEC mode. |
Step 5 |
copy running-config startup-config |
(Optional) Save your entries in the configuration file. |
EXAMPLE
Switch# configure terminal
Switch(config)# interface gigabitethernet0/1
Switch(config-if)# no cdp enable
Enabling CDP on an Interface
DETAILED STEPS
|
|
|
Step 1 |
configure terminal |
Enter global configuration mode. |
Step 2 |
interface interface-id |
Specify the interface on which you are enabling CDP, and enter interface configuration mode. Note If the interface is a UNI, you must enter the port-type nni or port-type eni interface configuration command before configuring CDP. By default, CDP is enabled on NNIs and disabled on ENIs. |
Step 3 |
cdp enable |
Enable CDP on the 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. |
EXAMPLE
This example shows how to enable CDP on a port when it has been disabled:
Switch# configure terminal
Switch(config)# interface gigabitethernet0/1
Switch(config-if)# cdp enable
This example shows how to change a UNI to an ENI and enable CDP on the port:
Switch# configure terminal
Switch(config)# interface fastethernet0/1
Switch(config-if)# port-type eni
Switch(config-if)# cdp enable
Verifying Configuration
|
|
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 hold time for packets being sent. |
show cdp entry entry-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 [ interface-id ] |
Display 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 ] |
Display information about neighbors, including device type, interface type and number, hold time 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 |
Display CDP counters, including the number of packets sent and received and checksum errors. |
Configuration Example
This example shows how to configure CDP characteristics:
Switch# configure terminal
Switch(config)# cdp timer 50
Switch(config)# cdp holdtime 120
Switch(config)# cdp advertise-v2
This example shows how to globally enable CDP if it has been disabled:
Switch# configure terminal
This example shows how to enable CDP on a port when it has been disabled:
Switch# configure terminal
Switch(config)# interface gigabitethernet0/1
Switch(config-if)# cdp enable
This example shows how to change a UNI to an ENI and enable CDP on the port:
Switch# configure terminal
Switch(config)# interface fastethernet0/1
Switch(config-if)# port-type eni
Switch(config-if)# cdp enable
Feature History
|
|
IE 2000U |
Cisco IOS Release 15.0(2)EH |
CGS 2520 |
Cisco IOS Release 12.2(53)EX |
Ethernet Switch Module (ESM) for CGR 2010 |
Cisco IOS Release 12.2(53)EX |