Configuring CDP

This chapter describes how to configure the Cisco Discovery Protocol (CDP) on Cisco NX-OS devices.

This chapter includes the following sections:

Finding Feature Information

Your software release might not support all the features documented in this module. For the latest caveats and feature information, see the Bug Search Tool at https://tools.cisco.com/bugsearch/ and the release notes for your software release. To find information about the features documented in this module, and to see a list of the releases in which each feature is supported, see the "New and Changed Information"chapter or the Feature History table in this chapter.

About CDP

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.

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 both stateful and stateless restarts and switchover for CDP. For more information on high availability, see the Cisco Nexus 7000 Series NX-OS High Availability and Redundancy Guide.

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.

Guidelines and Limitations for CDP

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 for CDP

This table lists the default settings for CDP parameters.

Parameters Default
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


Note

Be aware that the Cisco NX-OS commands for this feature may differ from those commands used in Cisco IOS.


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.

Procedure

  Command or Action Purpose
Step 1

configure terminal

Example:

switch# configure terminal
switch(config)#

Enters global configuration mode.

Step 2

[no] cdp enable

Example:

switch(config)# cdp enable

Enables or disables the CDP feature on the entire device. It is enabled by default.

Step 3

(Optional) copy running-config startup-config

Example:

switch(config)# copy running-config startup-config
(Optional)

Copies the running configuration to the startup configuration.

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.

Procedure

  Command or Action Purpose
Step 1

configure terminal

Example:

switch# configure terminal
switch(config)#

Enters global configuration mode.

Step 2

interface interface slot/port

Example:

switch(config)# interface ethernet 1/2
switch(config-if)#

Enters interface configuration mode.

Step 3

[no] cdp enable

Example:

switch(config-if)# cdp enable

Enables or disables CDP on this interface. It is enabled by default.

Note 
Make sure that CDP is enabled globally on the device.
Step 4

(Optional) show cdp interface interface slot/port

Example:

switch(config-if)# show cdp interface ethernet 1/2
(Optional)

Displays CDP information for an interface.

Step 5

(Optional) copy running-config startup-config

Example:

switch(config)# copy running-config startup-config
(Optional)

Copies the running configuration to the startup configuration.

Configuring Optional CDP Parameters

You can use the optional commands in this procedure to modify CDP.

Procedure

  Command or Action Purpose
Step 1

configure terminal

Example:

switch# configure terminal
switch(config)#

Enters global configuration mode.

Step 2

(Optional) cdp advertise {v1 | v2}

Example:

switch(config)# cdp advertise v1
(Optional)

Sets the CDP version supported by the device. The default is v2.

Step 3

(Optional) cdp format device-id {mac-address | serial-number | system-name}

Example:

switch(config)# cdp format device-id mac-address
(Optional)

Sets the CDP device ID. The options are as follows:

  • mac-address —The MAC address of the chassis.

  • serial-number —The chassis serial number/Organizationally Unique Identifier (OUI).

  • system-name —The system name or fully qualified domain name.

The default is system-name .

Step 4

(Optional) cdp holdtime seconds

Example:

switch(config)# cdp holdtime 150
(Optional)

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.

Step 5

(Optional) cdp timer seconds

Example:

switch(config)# cdp timer 50
(Optional)

Sets the refresh time when CDP sends advertisements to neighbors. The range is from 5 to 254 seconds. The default is 60 seconds.

Step 6

(Optional) copy running-config startup-config

Example:

switch(config)# copy running-config startup-config
(Optional)

Copies the running configuration to the startup configuration.

Verifying the CDP Configuration

To display the CDP configuration, perform one of the following tasks:

Command Purpose
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 slot/port Displays the CDP interface status.
show cdp neighbors {device-id | interface interface slot/port} [detail] Displays the CDP neighbor status.
show cdp interface interface 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:


config t
cdp enable
cdp timer 50
cdp holdtime 100

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,
                  s - Supports-STP-Dispute
Device-ID           Local Intrfce    Hldtme Capability    Platform        Port ID
Mgmt-switch
                    mgmt0             148    R S I         WS-C4948-10GE Gig1/37
switch88(FOX1518GRE6)
                    Eth1/25           164    R S I s       N5K-C5596UP   Eth1/25
switch89(FOX1518GQJ2)
                    Eth1/26           163    R S I s       N5K-C5596UP   Eth1/25

Additional References

Related Documents

Related Topic Document Title

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

Feature History for CDP

Your software release might not support all the features in this document. For the latest caveats and feature information, see the Bug Search Tool at https://tools.cisco.com/bugsearch/ and the release notes for your software release.

Table 1. Feature History for CDP

Feature Name

Releases

Feature Information

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.