Configuring CDP
This chapter describes how to configure the Cisco Discovery Protocol (CDP) on Cisco NX-OS devices.
This chapter includes the following sections:
Information About CDP
This section includes the following topics:
CDP Overview
The Cisco Discovery Protocol (CDP) is a media-independent and protocol-independent protocol that runs on all Cisco-manufactured equipment including routers, bridges, access and communication servers, and switches. You can use CDP to discover and view information about all the Cisco devices that are directly attached to the device.
CDP gathers protocol addresses of neighboring devices and discovers the platform of those devices. CDP runs over the data link layer only. Two systems that support different Layer 3 protocols can learn about each other.
Each device that you configure for CDP sends periodic advertisements to a multicast address. Each device advertises at least one address at which it can receive SNMP messages. The advertisements also contain hold-time information, which indicates the length of time that a receiving device should hold CDP information before removing it. You can configure the advertisement or refresh timer and the hold timer.
CDP Version-2 (CDPv2) allows you to track instances where the native VLAN ID or port duplex states do not match between connecting devices.
CDP advertises the following type-length-value fields (TLVs):
- Device ID
- Address
- Port ID
- Capabilities
- Version
- Platform
- Native VLAN
- Full/Half Duplex
- MTU
- SysName
- SysObjectID
- Management Address
- Physical Location
- VTP
All CDP packets include a VLAN ID. If you configure CDP on a Layer 2 access port, the CDP packets sent from that access port include the access port VLAN ID. If you configure CDP on a Layer 2 trunk port, the CDP packets sent from that trunk port include the lowest configured VLAN ID allowed on that trunk port. The trunk port can receive CDP packets that include any VLAN ID in the allowed VLAN list for that trunk port. For more information on VLANs, see the Cisco Nexus 7000 Series NX-OS Layer 2 Switching Configuration Guide, Release 5.x .
VTP Feature Support
CDP sends the VLAN Trunking Protocol (VTP) type-length-value field (TLV) if the following conditions are met:
- CDP Version 2 is enabled
- The VTP feature is enabled
- A VTP domain name is configured
You can view the VTP information with the show cdp neighbors detail command.
High Availability
Cisco NX-OS supports stateless restarts for CDP. After a reboot or a supervisor switchover, Cisco NX-OS applies the running configuration. For more information on high availability, see the Cisco Nexus 7000 Series NX-OS High Availability and Redundancy Guide, Release 5.x.
Virtualization Support
Cisco NX-OS supports multiple instances of CDP, one instance per virtual device context (VDC). By default, Cisco NX-OS places you in the default VDC unless you specifically configure another VDC. For more information on VDCs, see the Cisco Nexus 7000 Series NX-OS Virtual Device Context Configuration Guide, Release 5.x.
Licensing Requirements for CDP
|
|
Cisco NX-OS |
CDP requires no license. Any feature not included in a license package is bundled with the Cisco NX-OS system images and is provided at no extra charge to you. For a complete explanation of the Cisco NX-OS licensing scheme, see the Cisco NX-OS Licensing Guide. |
Prerequisites for CDP
CDP has the following prerequisites:
If you configure VDCs, install the Advanced Services license and enter the desired VDC (see the Cisco Nexus 7000 Series NX-OS Virtual Device Context Configuration Guide, Release 5.x).
Guidelines and Limitations
CDP has the following configuration guidelines and limitations:
- CDP can discover up to 256 neighbors per port if the port is connected to a hub with 256 connections.
- CDP must be enabled on the device or you cannot enable it on any interfaces.
- You can configure CDP on physical interfaces and port channels only.
- CDP is not supported for the Cisco Nexus 2000 Series Fabric Extender.
Default Settings
Table 7-1 lists the CDP default settings.
Table 7-1 CDP Default Settings
|
|
CDP |
Enabled globally and on all interfaces |
CDP version |
Version 2 |
CDP device ID |
Serial number |
CDP timer |
60 seconds |
CDP hold timer |
180 seconds |
Configuring CDP
This section includes the following topics:
Note Be aware that the Cisco NX-OS commands may differ from the Cisco IOS commands.
Enabling or Disabling CDP Globally
CDP is enabled by default. You can disable CDP and then reenable it.
You must enable CDP on the device before you enable CDP on any interfaces. If CDP is disabled globally and you enable CDP on specified interfaces, CDP will not be active on those interfaces; the system does not return an error message.
BEFORE YOU BEGIN
Make sure that you are in the correct VDC. To change the VDC, use the switchto vdc command.
SUMMARY STEPS
1. config t
2. cdp enable
3. copy running-config startup-config
DETAILED STEPS
|
|
|
Step 1 |
config t Example: switch# config t Enter configuration commands, one per line. End with CNTL/Z. switch(config)# |
Places you in global configuration mode. |
Step 2 |
cdp enable Example: switch(config)# cdp enable |
Enables the CDP feature on the entire device. This is enabled by default. |
Step 3 |
copy running-config startup-config Example: switch(config)# copy running-config startup-config |
(Optional) Saves this configuration change. |
Use the no cdp enable command to disable the CDP feature on the device.
|
|
no cdp enable Example: switch(config)# no cdp enable |
Disables the CDP feature on the device. |
This example shows how to enable the CDP feature:
switch# config t
Enter configuration commands, one per line. End with CNTL/Z.
switch(config)# cdp enable
Enabling or Disabling CDP on an Interface
CDP is enabled by default on an interface. You can disable CDP on an interface.
If CDP is disabled globally and you enable CDP on specified interfaces, CDP will not be active on those interfaces; the system does not return an error message.
BEFORE YOU BEGIN
Make sure that you are in the correct VDC. To change the VDC, use the switchto vdc command.
SUMMARY STEPS
1. config t
2. interface interface-type slot/port
3. cdp enable
4. show cdp interface interface-type slot/port
5. copy running-config startup-config
DETAILED STEPS
|
|
|
Step 1 |
config t Example: switch# config t Enter configuration commands, one per line. End with CNTL/Z. switch(config)# |
Places you in global configuration mode. |
Step 2 |
interface interface-type slot/port Example: switch(config)# interface ethernet 1/2 switch(config-if)# |
Enters interface configuration mode. |
Step 3 |
cdp enable Example : switch(config-if)# cdp enable |
Enables CDP on this interface. This is enabled by default. Note Ensure that CDP is enabled on the device (see the “Enabling or Disabling CDP Globally” section). |
Step 4 |
show cdp interface interface-type slot/port Example : switch(config-if)# show cdp interface ethernet 1/2 |
(Optional) Displays CDP information for an interface. |
Step 5 |
copy running-config startup-config Example: switch(config-if)# copy running-config startup-config |
(Optional) Saves this configuration change. |
This example shows how to disable CDP on Ethernet 1/2:
switch# config t
Enter configuration commands, one per line. End with CNTL/Z.
switch(config)# interface ethernet 1/2
switch(config-if)# no cdp enable
switch(config-if)# copy running-config startup-config
This example shows how to enable CDP on port channel 2:
switch# config t
Enter configuration commands, one per line. End with CNTL/Z.
switch(config)# interface port-channel 2
switch(config-if)# cdp enable
switch(config-if)# copy running-config startup-config
Configuring Optional CDP Parameters
You can use the following optional commands in global configuration mode to modify CDP:
|
|
cdp advertise { v1 | v2 } Example: switch(config)# cdp advertise v1 |
Sets the CDP version supported by the device. The default is v2. |
cdp format device-id { mac-address | serial-number | system-name } Example: switch(config)# cdp format device-id mac-address |
Sets the CDP device ID. The options are as follows:
- mac-address—MAC address of the chassis.
- serial-number—Chassis serial number/Organizationally Unique Identifier (OUI)
- system-name—The system name or fully qualified domain name.
The default displays system-name and serial-number information. |
cdp holdtime seconds Example: switch(config)# cdp holdtime 150 |
Sets the time that CDP holds onto neighbor information before removing it. The range is from 10 to 255 seconds. The default is 180 seconds. |
cdp timer seconds Example: switch(config)# cdp timer 50 |
Sets the refresh time when CDP sends advertisements to neighbors. The range is from 5 to 254 seconds. The default is 60 seconds. |
Verifying the CDP Configuration
To display the CDP configuration, perform one of the following tasks:
|
|
show cdp all |
Displays all interfaces that have CDP enabled. |
show cdp entry { all | name entry-name } |
Displays the CDP database entries. |
show cdp global |
Displays the CDP global parameters. |
show cdp interface interface-type slot/port |
Displays the CDP interface status. |
show cdp neighbors { device-id | interface interface-type slot/port } [ detail ] |
Displays the CDP neighbor status. |
show cdp traffic interface interface-type slot/port |
Displays the CDP traffic statistics on an interface. |
Use the clear cdp counters command to clear CDP statistics on an interface.
Use the clear cdp table command to clear the CDP cache for one or all interfaces.
Configuration Example for CDP
This example shows how to enable the CDP feature and configure the refresh and hold timers:
This example shows how to display the CDP global parameters:
switch# show cdp neighbors
Capability Codes: R - Router, T - Trans-Bridge, B - Source-Route-Bridge
S - Switch, H - Host, I - IGMP, r - Repeater,
V - VoIP-Phone, D - Remotely-Managed-Device,
Device-ID Local Intrfce Hldtme Capability Platform Port ID
mgmt0 148 R S I WS-C4948-10GE Gig1/37
Eth1/25 164 R S I s N5K-C5596UP Eth1/25
Eth1/26 163 R S I s N5K-C5596UP Eth1/25
Additional References
For additional information related to implementing CDP, see the following sections:
Related Documents
|
|
CDP CLI commands |
Cisco Nexus 7000 Series NX-OS System Management Command Reference |
VDCs and VRFs |
Cisco Nexus 7000 Series NX-OS Virtual Device Context Configuration Guide, Release 5.x |
Feature History for CDP
Table 7-2 lists the release history for this feature.
Table 7-2 Feature History for CDP
|
|
|
CDP |
5.2(1) |
No change from Release 5.1. |
CDP |
5.1(1) |
No change from Release 5.0. |
CDP |
5.0(2) |
No change from Release 4.2. |
CDP support for VTP domain name |
4.2(1) |
CDP advertises the VLAN Trunking Protocol (VTP) type-length-value field (TLV) in CDP version-2 packets. See VTP Feature Support. |