![]() |
Table Of Contents
CDP Commands on Cisco IOS XR Software
CDP Commands on Cisco IOS XR Software
This chapter describes the Cisco IOS XR software commands for monitoring the networking device and network using Cisco Discovery Protocol (CDP).
For detailed information about CDP concepts, configuration tasks, and examples, refer to the Implementing CDP on Cisco IOS XR Software module in Cisco IOS XR System Management Configuration Guide.
cdp
To enable the Cisco Discovery Protocol (CDP) globally or on a interface, use the cdp command in the appropriate configuration mode. To disable CDP globally or on an interface, use the no form of this command.
cdp
no cdp
Syntax Description
This command has no arguments or keywords.
Defaults
CDP is disabled.
Command Modes
Global configuration
Interface configurationCommand History
Usage Guidelines
To use this command, you must be in a user group associated with a task group that includes the proper task IDs. For detailed information about user groups and task IDs, see the Configuring AAA Services on Cisco IOS XR Software module of the Cisco IOS XR System Security Configuration Guide.
By default, CDP is disabled globally. To enable CDP, CDP must be enabled globally and then enabled for each interface.
To enable CDP globally, use the cdp command in global configuration mode. To disable CDP globally, use the no form of this command in global configuration mode.
To enable CDP on a specific interface, use the cdp command in interface configuration mode. To disable CDP on a specific interface, use the no form of this command in interface configuration mode.
Task ID
Examples
The following example shows how to globally enable CDP:
RP/0/RP0/CPU0:router(config)# cdp
The following example shows how to enable CDP on Packet-over-SONET/SDH (POS) interface 0/0/0/1:
RP/0/RP0/CPU0:router(config)# interface POS 0/0/0/1
RP/0/RP0/CPU0:router(config-if)# cdp
The following example shows how to disable CDP on Packet-over-SONET/SDH (POS) interface 0/0/0/1:
RP/0/RP0/CPU0:router(config)# interface POS 0/0/0/1
RP/0/RP0/CPU0:router(config-if)# no cdp
Related Commands
cdp advertise v1
To change the version of Cisco Discovery Protocol (CDP) that is used to communicate with neighboring devices to version 1 (CDPv1), use the cdp advertise v1 command in global configuration mode. To remove the cdp advertise v1 command from the configuration file and restore the system to its default condition with respect to this command, use the no form of this command.
cdp advertise v1
no cdp advertise [v1]
Syntax Description
This command has no arguments or keywords.
Defaults
Version 2 is enabled.
Command Modes
Global configuration
Command History
Usage Guidelines
To use this command, you must be in a user group associated with a task group that includes the proper task IDs. For detailed information about user groups and task IDs, see the Configuring AAA Services on Cisco IOS XR Software module of the Cisco IOS XR System Security Configuration Guide.
CDPv2 packets are sent by default. CDP also sends and receives CDPv1 packets if the device with which CDP is interacting does not process CDPv2 packets.
CDPv2 adds device information over CDPv1. The additional information that is contained in the CDPv2 messages relates to Native VLAN, VLAN Trunking Protocol (VTP) Management Domain, Ethernet Duplex, and other features.
Task ID
Examples
The following example shows how to set a networking device to send and receive only CDPv1 advertisements:
RP/0/RP0/CPU0:router(config)# cdp advertise v1The following example shows how to restore the default condition (sending and receiving CDPv2 advertisements):
RP/0/RP0/CPU0:router(config)# no cdp advertiseRelated Commands
Command DescriptionEnables CDP on a supported interface.
Displays global CDP information, including timer and holdtime information.
cdp holdtime
To specify the time for which the receiving device should hold a Cisco Discovery Protocol (CDP) packet from your networking device before discarding it, use the cdp holdtime command in global configuration mode. To remove the cdp holdtime global configuration command from the configuration file and restore the system to its default condition with respect to this command, use the no form of this command.
cdp holdtime seconds
no cdp holdtime
Syntax Description
Defaults
seconds: 180
Command Modes
Global configuration
Command History
Usage Guidelines
To use this command, you must be in a user group associated with a task group that includes the proper task IDs. For detailed information about user groups and task IDs, see the Configuring AAA Services on Cisco IOS XR Software module of the Cisco IOS XR System Security Configuration Guide.
CDP packets are sent with a time-to-live value, or holdtime, that is nonzero after an interface is enabled.
The CDP holdtime must be set to a higher number of seconds than the time between CDP transmissions, which is set using the cdp timer command.
Task ID
Examples
The following example shows how to specify that the CDP packets sent from the networking device are held by the receiving device for 60 seconds before being discarded. You might want to set the holdtime lower than the default setting of 180 seconds if information about your networking device changes often and you want the receiving devices to purge this information more quickly.
RP/0/RP0/CPU0:router(config)# cdp holdtime 60The following example shows how to use the no form of the command to set the holdtime to the default of 180 seconds:
RP/0/RP0/CPU0:router(config)# no cdp holdtimeRelated Commands
Command DescriptionSpecifies how often the software sends CDP updates.
Displays global CDP information, including timer and holdtime information.
cdp log adjacency changes
To log changes to the Cisco Discovery Protocol (CDP) adjacency table, use the cdp log adjacency changes command in global configuration mode. To disable the logging, use the no form of this command.
cdp log adjacency changes
no cdp log adjacency changes
Syntax Description
This command has no arguments or keywords.
Defaults
CDP adjacency table logging is disabled.
Command Modes
Global configuration
Command History
Usage Guidelines
To use this command, you must be in a user group associated with a task group that includes the proper task IDs. For detailed information about user groups and task IDs, see the Configuring AAA Services on Cisco IOS XR Software module of the Cisco IOS XR System Security Configuration Guide.
When CDP adjacency table logging is enabled, a syslog is generated each time a CDP neighbor is added or removed.
Task ID
Examples
The following example shows how to enable CDP adjacency table logging:
RP/0/RP0/CPU0:router# configure
RP/0/RP0/CPU0:router(config)# cdp log adjacency changes
When CDP adjacency table logging is enabled, a syslog is generated each time a CDP neighbor is added or removed. The following is an example of the log entry:
LC/0/5/CPU0:Jun 5 10:51:18.081 : cdp[109]: %L2-CDP-6-DELETED_NEIGHBOR :CDP Neighbour TBA04110127 on interface GigabitEthernet0/5/0/0 has been deleted, remote interface 3/2LC/0/5/CPU0:Jun 5 10:51:33.120 : cdp[109]: %L2-CDP-6-NEW_NEIGHBOR : New CDP neighbor TBA04110127 detected on interface GigabitEthernet0/5/0/0, remote interface 3/2Related Commands
cdp timer
To specify how often the software sends Cisco Discovery Protocol (CDP) updates, use the cdp timer command in global configuration mode. To remove the cdp timer global configuration command from the configuration file and restore the system to its default condition with respect to this command, use the no form of this command.
cdp timer seconds
no cdp timer
Syntax Description
seconds
Frequency with which the Cisco IOS XR software sends CDP updates. Range is 5 to 254 seconds. The default is 60 seconds.
Defaults
seconds: 60 seconds
Command Modes
Global configuration
Command History
Usage Guidelines
To use this command, you must be in a user group associated with a task group that includes the proper task IDs. For detailed information about user groups and task IDs, see the Configuring AAA Services on Cisco IOS XR Software module of the Cisco IOS XR System Security Configuration Guide.
A lower timer setting causes CDP updates to be sent more frequently.
Task ID
Examples
The following example shows how to set the CDP timer to 80 seconds, which is less frequent than the default setting of 60 seconds:
RP/0/RP0/CPU0:router(config)# cdp timer 80Related Commands
clear cdp counters
To reset Cisco Discovery Protocol (CDP) traffic counters to zero (0), use the clear cdp counters command in EXEC mode.
clear cdp counters location node-id
Syntax Description
location node-id
Clears CDP traffic counters for the designated node. The node-id argument is entered in the rack/slot/module notation.
Defaults
The counters are set to zero.
Command Modes
EXEC
Command History
Usage Guidelines
To use this command, you must be in a user group associated with a task group that includes the proper task IDs. For detailed information about user groups and task IDs, see the Configuring AAA Services on Cisco IOS XR Software module of the Cisco IOS XR System Security Configuration Guide.
Task ID
Examples
The following example shows how to clear CDP counters. The show cdp traffic output shows that all traffic counters have been reset to zero (0).
RP/0/RP0/CPU0:router# clear cdp countersRP/0/RP0/CPU0:router# show cdp trafficCDP counters:Packets output: 0, Input: 0Hdr syntax: 0, Chksum error: 0, Encaps failed: 0No memory: 0, Invalid packet: 0, Truncated: 0CDP version 1 advertisements output: 0, Input: 0CDP version 2 advertisements output: 0, Input: 0Unrecognize Hdr version: 0, File open failed: 0Related Commands
Command DescriptionClears and resizes the table that contains CDP information about neighbors.
Displays traffic information between devices gathered using CDP.
clear cdp table
To clear and automatically resize the table that contains Cisco Discovery Protocol (CDP) information about neighbors, use the clear cdp table command in EXEC mode.
clear cdp table location node-id
Syntax Description
location node-id
Clears and resizes the CDP table for the designated node. The node-id argument is entered in the rack/slot/module notation.
Defaults
No default behavior or values
Command Modes
EXEC
Command History
Usage Guidelines
To use this command, you must be in a user group associated with a task group that includes the proper task IDs. For detailed information about user groups and task IDs, see the Configuring AAA Services on Cisco IOS XR Software module of the Cisco IOS XR System Security Configuration Guide.
Use the clear cdp table command to clear and resize the CDP table that contains the neighbor entries. The new table size is calculated according to the recommended hash table size, as seen in the show cdp command output.
Task ID
Examples
The following example shows how to clears and resize the CDP table. The output of the show cdp neighbors command before and after use of the clear cdp table command shows that all information has been deleted from the table:
RP/0/RP0/CPU0:router# show cdp neighborsCapability Codes: R - Router, T - Trans Bridge, B - Source Route BridgeS - Switch, H - Host, I - IGMP, r - RepeaterDevice ID Local Intrfce Holdtme Capability Platform Port IDTBA04341195(15la Mg0/RP1/CPU0/0 171 T S WS-C2924 0/1RP/0/RP0/CPU0:router# clear cdp tableRP/0/RP0/CPU0:router# show cdp neighborsCapability Codes: R - Router, T - Trans Bridge, B - Source Route BridgeS - Switch, H - Host, I - IGMP, r - RepeaterDevice ID Local Intrfce Holdtme Capability Platform Port IDThe show cdp command shows that the table has been resized:
RP/0/RP0/CPU0:router# show cdpGlobal CDP information:Sending CDP packets every 60 secondsSending a holdtime value of 180 secondsSending CDPv2 advertisements is enabledRelated Commands
Command DescriptionDisplays global CDP information, including timer and holdtime information.
Displays information about neighboring devices discovered by CDP.
show cdp
To display global Cisco Discovery Protocol (CDP) information, including CDP version, timer, and holdtime information, use the show cdp command in EXEC mode.
show cdp
Syntax Description
This command has no arguments or keywords.
Command Modes
EXEC
Command History
Usage Guidelines
To use this command, you must be in a user group associated with a task group that includes the proper task IDs. For detailed information about user groups and task IDs, see the Configuring AAA Services on Cisco IOS XR Software module of the Cisco IOS XR System Security Configuration Guide.
Use the show cdp command to display CDP version, timer, and holdtime information relative to CDP operations.
Task ID
Examples
The following example shows how to use the show cdp command to verify the CDP global settings:
RP/0/0/CPU0:router# show cdpGlobal CDP information:Sending CDP packets every 20 secondsSending a holdtime value of 30 secondsSending CDPv2 advertisements is not enabledTable 8 describes the significant fields shown in the display.
Table 8 show cdp Field Descriptions
Field DefinitionSending CDP packets every 20 seconds
Interval between transmissions of CDP advertisements. This field is controlled by the cdp timer command.
Sending a holdtime value of 30 seconds
Time for which the device directs the neighbor to hold a CDP advertisement before discarding it. This field is controlled by the cdp holdtime command.
Sending CDPv2 advertisements is not enabled
State of being enabled or disabled for the transmission of CDP version 2-type advertisements. This field is controlled by the cdp advertise v1 command.
Related Commands
show cdp entry
To display information about a specific neighboring device or all neighboring devices discovered using Cisco Discovery Protocol (CDP), use the show cdp entry command in EXEC mode.
show cdp entry {* | entry-name} [protocol | version]
Syntax Description
Defaults
This command displays information about a particular device that has been discovered by CDP.
Command Modes
EXEC
Command History
Usage Guidelines
To use this command, you must be in a user group associated with a task group that includes the proper task IDs. For detailed information about user groups and task IDs, see the Configuring AAA Services on Cisco IOS XR Software module of the Cisco IOS XR System Security Configuration Guide.
Task ID
Examples
The following is sample output from the show cdp entry command. Information about device ID, address, platform, interface, holdtime, and version is displayed.
RP/0/RP0/CPU0:router# show cdp entry TBA04341195-------------------------Device ID: TBA04341195(sys-235)SysName : sys-235Entry address(es):IP address: 172.16.23.9Platform: WS-C6006, Capabilities: Trans-Bridge SwitchInterface: MgmtEth0/RP1/CPU0/0Port ID (outgoing port): 4/18Holdtime : 157 secVersion :WS-C6006 Software, Version McpSW: 7.2(2) NmpSW: 7.2(2)Copyright (c) 1995-2002 by Cisco Systemsadvertisement version: 2VTP Management Domain: 'sys'Native VLAN: 125Duplex: fullTable 9 describes the significant fields shown in the display.
Related Commands
show cdp interface
To display information about the interfaces on which Cisco Discovery Protocol (CDP) is enabled, use the show cdp interface command in EXEC mode.
show cdp interface [type interface-id | location node-id]
Syntax Description
Defaults
This command displays information about the interfaces on which CDP has been enabled.
Command Modes
EXEC
Command History
Usage Guidelines
To use this command, you must be in a user group associated with a task group that includes the proper task IDs. For detailed information about user groups and task IDs, see the Configuring AAA Services on Cisco IOS XR Software module of the Cisco IOS XR System Security Configuration Guide.
Use the show cdp interface command to display information about any CDP interfaces. When an interface is specified in the command syntax, information is displayed about the specific interface. Not specifying the interface displays information about all interfaces.
Task ID
Examples
The following is sample output from the show cdp interface command. Information about the status, CDP timer, and holdtime settings is displayed for all interfaces on which CDP is enabled.
RP/0/RP0/CPU0:router# show cdp interface
POS0/2/0/0 is UpEncapsulation HDLCSending CDP packets every 120 secondsHoldtime is 240 secondsPOS0/2/0/1 is UpEncapsulation HDLCSending CDP packets every 120 secondsHoldtime is 240 secondsPOS0/2/0/2 is UpEncapsulation HDLCSending CDP packets every 120 secondsHoldtime is 240 secondsPOS0/2/0/3 is UpEncapsulation HDLCSending CDP packets every 120 secondsHoldtime is 240 secondsMgmtEth0/RP1/CPU0/0 is UpEncapsulation ARPASending CDP packets every 120 secondsHoldtime is 240 secondsThe following is sample output from the show cdp interface command with an interface specified. Information about the status, CDP timer, and holdtime settings is displayed for Packet-over-SONET/SDH (POS) interface 0/2/0/1 only.
RP/0/RP0/CPU0:router# show cdp interface POS 0/2/0/1POS0/2/0/1 is UpEncapsulation HDLCSending CDP packets every 60 secondsHoldtime is 180 secondsTable 10 describes the significant fields shown in the display.
Related Commands
show cdp neighbors
To display detailed information about neighboring devices discovered using Cisco Discovery Protocol (CDP), use the show cdp neighbors command in EXEC mode.
show cdp neighbors [type interface-id | location node-id] [detail]
Syntax Description
Defaults
No default behavior or values
Command Modes
EXEC
Command History
Usage Guidelines
To use this command, you must be in a user group associated with a task group that includes the proper task IDs. For detailed information about user groups and task IDs, see the Configuring AAA Services on Cisco IOS XR Software module of the Cisco IOS XR System Security Configuration Guide.
Use the show cdp neighbors command to display information about any CDP neighbors. When a location is specified in the command syntax, information about the neighbor is displayed for the specified node. Not specifying the location displays information about the neighbor for all interfaces.
Use the show cdp neighbors command with the detail keyword to display additional information, including IPv6 neighbors.
Task ID
Examples
The following is sample output from the show cdp neighbors command:
RP/0/RP0/CPU0:router# show cdp neighborsCapability Codes: R - Router, T - Trans Bridge, B - Source Route BridgeS - Switch, H - Host, I - IGMP, r - RepeaterDevice ID Local Intrfce Holdtme Capability Platform Port IDcisco_1 Mg0/0/CPU0/0 139 T S WS-C2924M Fa0/6cisco_2 PO0/3/0/0 173 R CRS-1 PO0/3/0/0TBA04110127 Gi0/7/0/0 173 T S WS-C6506 3/9cisco_3 Gi0/7/0/2 171 R CRS-1 Gi0/4/0/2Table 11 describes the significant fields shown in the display.
The following is sample output for IPv4 and IPv6 neighbors from the show cdp neighbors detail command:
RP/0/0/CPU0:router# show cdp neighbor detail-------------------------Device ID: uut-userSysName : uut-userEntry address(es):IPv4 address: 1.1.1.1IPv6 address: 1::1IPv6 address: 2::2Platform: cisco 12008/GRP, Capabilities: RouterInterface: POS0/4/0/3Port ID (outgoing port): POS0/2/0/3Holdtime : 177 secVersion :Cisco IOS XR Software, Version 0.0.0[Default]Copyright (c) 2005 by cisco Systems, Inc.advertisement version: 2Table 12 describes the significant fields shown in the display.
Related Commands
show cdp traffic
To display information about the traffic gathered between devices using Cisco Discovery Protocol (CDP), use the show cdp traffic command in EXEC mode.
show cdp traffic [location node-id]
Syntax Description
location node-id
(Optional) Displays detailed CEF information for the designated node. The node-id argument is entered in the rack/slot/module notation.
Command Modes
EXEC
Command History
Usage Guidelines
To use this command, you must be in a user group associated with a task group that includes the proper task IDs. For detailed information about user groups and task IDs, see the Configuring AAA Services on Cisco IOS XR Software module of the Cisco IOS XR System Security Configuration Guide.
Task ID
Examples
The following is sample output from the show cdp traffic command:
RP/0/RP0/CPU0:router# show cdp trafficCDP counters :Packets output: 50662, Input: 40414Hdr syntax: 0, Chksum error: 0, Encaps failed: 0No memory: 0, Invalid packet: 0, Truncated: 0CDP version 1 advertisements output: 0, Input: 0CDP version 2 advertisements output: 50662, Input: 40414Unrecognize Hdr version: 0, File open failed: 0Table 13 describes the significant fields shown in the display.
Related Commands