The documentation set for this product strives to use bias-free language. For the purposes of this documentation set, bias-free is defined as language that does not imply discrimination based on age, disability, gender, racial identity, ethnic identity, sexual orientation, socioeconomic status, and intersectionality. Exceptions may be present in the documentation due to language that is hardcoded in the user interfaces of the product software, language used based on RFP documentation, or language that is used by a referenced third-party product. Learn more about how Cisco is using Inclusive Language.
This chapter describes how to configure the Cisco Discovery Protocol (CDP), and includes the following sections:
•Configuration Guidelines and Limitations
•Verifying the CDP Configuration
This section includes the following topics:
Cisco Discovery Protocol (CDP) runs over the data link layer and is used to advertise information to all attached Cisco devices, and to discover and view information about attached Cisco devices. CDP runs on all Cisco-manufactured equipment.
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 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 discarding 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
All CDP packets include a VLAN ID. The CDP packet is untagged, so it goes over the native/access VLAN, which is then also added to the packet.
For more information on VLANs, see the Cisco Nexus 1000V Layer 2 Switching Configuration Guide, Release 4.0(4)SV1(1).
Stateless restarts are supported for CDP. After a reboot or a supervisor switchover, the running configuration is applied.
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 globally before you can configure CDP on an interface. CDP is enabled globally by default, but can be disabled using the "Disabling the CDP Feature Globally" procedure.
•You can configure CDP on physical interfaces and port channels only.
This section includes the following topics:
•Enabling the CDP Feature Globally
•Disabling the CDP Feature Globally
•Disabling CDP on an Interface
•Configuring Optional CDP Parameters
Use this procedure to enable CDP globally.Although DP is enabled globally by default, should it be disabled, you can use this procedure to enable it again.
Before beginning this procedure, you must know or do the following:
•CDP must be enabled globally before you can configure it on an interface.
•You are logged in to the CLI in EXEC mode.
1. config t
2. cdp enable
Use this procedure to globally disable CDP.
Before beginning this procedure, you must know or do the following:
•When you globally disable the CDP feature, all CDP configurations are also disabled.
•CDP is currently globally enabled.
•CDP is enabled on each interface by default.
1. config t
2. no cdp enable
Use this procedure to enable CDP on a specific interface.
Before beginning this procedure, you must know or do the following:
•The CDP feature is enabled globally. CDP is enabled by default, but can also be re-enabled using the "Enabling the CDP Feature Globally" procedure.
•CDP is enabled by default on all interfaces.
•CDP is currently disabled on the specific interface you want to configure.
•For more information about CDP, see the "Information About CDP" section.
1. config t
2. interface interface-type number
3. no cdp enable
4. cdp enable
5. show cdp interface interface-type number
6. copy running-config startup-config
This example shows how to enable CDP on port channel 2:
Example:
n1000v# config t
n1000v(config)# interface port-channel 2
n1000v(config-if)# cdp enable
n1000v(config-if)# copy running-config startup-config
Use this procedure to disable CDP on an interface.
Before beginning this procedure, you must know or do the following:
•CDP is currently enabled on the device.
Note If CDP is disabled on the device, then it is also disabled for all interfaces.
•CDP is currently enabled on the specific interface you want to configure.
•For more information about CDP, see the "Information About CDP" section.
1. config t
2. interface interface-type number
3. no cdp enable
4. (Optional) show cdp interface interface-type number
5. (Optional) copy running-config startup-config
This example shows how to disable CDP on mgmt0:
n1000v# config t
n1000v(config)# interface mgmt0
n1000v(config-if)# no cdp enable
n1000v(config-if)# show cdp interface mgmt0
mgmt0 is up
CDP disabled on interface
Sending CDP packets every 60 seconds
Holdtime is 180 seconds
n1000v(config-if)# copy running-config startup-config
Use this procedure to assign the CDP version to advertise on the device.
Before beginning this procedure, you must know or do the following:
•You know the version of CDP currently supported on the device.
•Only one version of CDP (version 1 or version 2) is advertised at a time for all uplinks and port channels on the switch.
•For more information about CDP, see the "Information About CDP" section.
1. config t
2. cdp advertise {v1 | v2}
3. (Optional) show cdp global
4. (Optional) copy running-config startup-config
Use this procedure to configure the following CDP parameters:
•the device ID format to use
Note Only the system-name device ID format is supported.
•the maximum hold time for neighbor information
•the refresh time for sending advertisements
Before beginning this procedure, you must know or do the following:
•If you are setting the holdtime, you know how long you want CDP to retain neighbor information.
•You can view output from upstream cat6k switch using the show cdp neighbor command.
•If you are setting the CDP timer, you know how often you want CDP to advertise.
•For more information about CDP, see the "Information About CDP" section.
1. config t
2. (Optional) cdp format device-id system-name
3. show cdp neighbors from the upstream device
4. show cdp neighbors from your device
5. (Optional) cdp timer seconds
6. (Optional) cdp holdtime seconds
7. (Optional) show cdp global
8. (Optional) copy running-config startup-config
To clear CDP statistics, use one of the following commands.
To display CDP configuration information, use one of the following commands:
|
|
---|---|
show cdp all |
Displays all interfaces that have CDP enabled. See Example 2-1 |
show cdp entry {all | name entry-name} |
Displays the CDP database entries. See Example 2-2 |
show cdp global |
Displays the CDP global parameters. See Example 2-4 |
show cdp interface interface-type slot/port |
Displays the CDP interface status. See Example 2-5 |
show cdp neighbors {detail | interface interface-type slot/port} |
Displays the CDP neighbor status. See Example 2-6 |
show cdp traffic interface interface-type slot/port |
Displays the CDP traffic statistics on an interface. See Example 2-7 |
Example 2-1 show cdp all
n1000v# show cdp all
Ethernet2/2 is up
CDP enabled on interface
Sending CDP packets every 60 seconds
Holdtime is 180 seconds
Ethernet2/3 is up
CDP enabled on interface
Sending CDP packets every 60 seconds
Holdtime is 180 seconds
Ethernet2/4 is up
CDP enabled on interface
Sending CDP packets every 60 seconds
Holdtime is 180 seconds
Ethernet2/5 is up
CDP enabled on interface
Sending CDP packets every 60 seconds
Holdtime is 180 seconds
Ethernet2/6 is up
CDP enabled on interface
Sending CDP packets every 60 seconds
Holdtime is 180 seconds
mgmt0 is up
CDP enabled on interface
Sending CDP packets every 60 seconds
Holdtime is 180 seconds
Example 2-2 show cdp entry name
n1000v# show cdp entry name swordfish-6k-2
----------------------------------------
Device ID:swordfish-6k-2
System Name:
Interface address(es):
IPv4 Address: 172.28.30.2
Platform: cisco WS-C6503-E, Capabilities: Router Switch IGMP Filtering
Interface: Ethernet2/2, Port ID (outgoing port): GigabitEthernet1/14
Holdtime: 152 sec
Version:
Cisco IOS Software, s72033_rp Software (s72033_rp-IPBASE-M), Version 12.2(33)SXH2a, RELEASE SOFTWARE (fc2)
Technical Support: http://www.cisco.com/techsupport
Copyright (c) 1986-2008 by Cisco Systems, Inc.
Compiled Fri 25-Apr-08 09:11 by prod_rel_team
Example 2-3 show cdp entry all
n1000v# show cdp entry all
----------------------------------------
Device ID:swordfish-6k-2
System Name:
Interface address(es):
IPv4 Address: 172.28.30.2
Platform: cisco WS-C6503-E, Capabilities: Router Switch IGMP Filtering
Interface: Ethernet2/2, Port ID (outgoing port): GigabitEthernet1/14
Holdtime: 140 sec
Version:
Cisco IOS Software, s72033_rp Software (s72033_rp-IPBASE-M), Version 12.2(33)SXH2a, RELEASE SOFTWARE (fc2)
Technical Support: http://www.cisco.com/techsupport
Copyright (c) 1986-2008 by Cisco Systems, Inc.
Compiled Fri 25-Apr-08 09:11 by prod_rel_team
Advertisement Version: 1
----------------------------------------
Device ID:swordfish-6k-2
System Name:
Interface address(es):
IPv4 Address: 172.28.30.2
Platform: cisco WS-C6503-E, Capabilities: Router Switch IGMP Filtering
Interface: Ethernet2/3, Port ID (outgoing port): GigabitEthernet1/15
Holdtime: 129 sec
Version:
Cisco IOS Software, s72033_rp Software (s72033_rp-IPBASE-M), Version 12.2(33)SXH2a, RELEASE SOFTWARE (fc2)
Technical Support: http://www.cisco.com/techsupport
Copyright (c) 1986-2008 by Cisco Systems, Inc.
Compiled Fri 25-Apr-08 09:11 by prod_rel_team
Advertisement Version: 1
----------------------------------------
Device ID:swordfish-6k-2
System Name:
Interface address(es):
IPv4 Address: 7.7.8.1
Platform: cisco WS-C6503-E, Capabilities: Router Switch IGMP Filtering
Interface: Ethernet2/4, Port ID (outgoing port): GigabitEthernet1/16
Holdtime: 154 sec
Version:
Cisco IOS Software, s72033_rp Software (s72033_rp-IPBASE-M), Version 12.2(33)SXH2a, RELEASE SOFTWARE (fc2)
Technical Support: http://www.cisco.com/techsupport
Copyright (c) 1986-2008 by Cisco Systems, Inc.
Compiled Fri 25-Apr-08 09:11 by prod_rel_team
Advertisement Version: 1
----------------------------------------
Device ID:swordfish-6k-2
System Name:
Interface address(es):
IPv4 Address: 7.7.8.1
Platform: cisco WS-C6503-E, Capabilities: Router Switch IGMP Filtering
Interface: Ethernet2/5, Port ID (outgoing port): GigabitEthernet1/17
Holdtime: 156 sec
Version:
Cisco IOS Software, s72033_rp Software (s72033_rp-IPBASE-M), Version 12.2(33)SXH2a, RELEASE SOFTWARE (fc2)
Technical Support: http://www.cisco.com/techsupport
Copyright (c) 1986-2008 by Cisco Systems, Inc.
Compiled Fri 25-Apr-08 09:11 by prod_rel_team
Advertisement Version: 1
----------------------------------------
Device ID:swordfish-6k-2
System Name:
Interface address(es):
IPv4 Address: 172.28.15.229
Platform: cisco WS-C6503-E, Capabilities: Router Switch IGMP Filtering
Interface: Ethernet2/6, Port ID (outgoing port): GigabitEthernet1/18
Holdtime: 171 sec
Version:
Cisco IOS Software, s72033_rp Software (s72033_rp-IPBASE-M), Version 12.2(33)SXH2a, RELEASE SOFTWARE (fc2)
Technical Support: http://www.cisco.com/techsupport
Copyright (c) 1986-2008 by Cisco Systems, Inc.
Compiled Fri 25-Apr-08 09:11 by prod_rel_team
Advertisement Version: 1
Example 2-4 show cdp global
n1000v(config)# show cdp global
Global CDP information:
CDP enabled globally
Sending CDP packets every 60 seconds
Sending a holdtime value of 180 seconds
Sending CDPv2 advertisements is disabled
Sending DeviceID TLV in Default Format
Example 2-5 show cdp interface
n1000v(config)# show cdp interface ethernet 2/3
Ethernet2/3 is up
CDP enabled on interface
Sending CDP packets every 60 seconds
Holdtime is 180 seconds
Example 2-6 show cdp neighbors interface
n1000v(config)# show cdp neighbors interface ethernet 2/3
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
swordfish-6k-2 Eth2/3 173 R S I WS-C6503-E Gig1/15
Example 2-7 show cdp traffic interface
n1000v(config)# show cdp traffic interface ethernet 2/3
----------------------------------------
Traffic statistics for Ethernet2/3
Input Statistics:
Total Packets: 98
Valid CDP Packets: 49
CDP v1 Packets: 49
CDP v2 Packets: 0
Invalid CDP Packets: 49
Unsupported Version: 49
Checksum Errors: 0
Malformed Packets: 0
Output Statistics:
Total Packets: 47
CDP v1 Packets: 47
CDP v2 Packets: 0
Send Errors: 0
This example enables the CDP feature and configures the refresh and hold timers:
config t
cdp enable
cdp timer 50
cdp holdtime 100
Table 2-1 lists the default settings for CDP parameters.
|
|
---|---|
CDP |
Enabled globally and on all interfaces |
CDP version |
Version 2 |
CDP device ID |
System name |
CDP timer |
60 seconds |
CDP hold timer |
180 seconds |
This section includes the following additional information related to CDP:
|
|
---|---|
VLAN |
Cisco Nexus 1000V Layer 2 Switching Configuration Guide, Release 4.0(4)SV1(1) |
|
|
---|---|
No new or modified standards are supported by this feature, and support for existing standards has not been modified by this feature. |
— |
This section provides the CDP feature release history.
|
|
|
---|---|---|
CDP |
4.0 |
This feature was introduced. |