CDP Commands
CDP Commands
This chapter describes commands used to monitor the router and network using Cisco Discovery
Protocol (CDP).
For system management configuration tasks and examples, refer to the “Configuring Cisco Discovery
Protocol” chapter in the Release 12.2 Cisco IOS Configuration Fundamentals Configuration Guide.
cdp advertise-v2
To enable Cisco Discovery Protocol Version 2 (CDPv2) advertising functionality on a device, use the
cdp advertise-v2 global configuration command. To disable advertising CDPv2 functionality, use the
no form of the command.
cdp advertise-v2
no cdp advertise-v2
Defaults Enabled
Usage Guidelines CDP Version 2 has three additional type-length values (TLVs): they are VTP Management Domain
Name, Native VLAN, and full/half-Duplex.
Examples In the following example, CDP Version 2 advertisements are diabled on the router:
Router#show cdp
Global CDP information:
Sending CDP packets every 60 seconds
Sending a holdtime value of 180 seconds
Sending CDPv2 advertisements is enabled
Router#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#no cdp advertise-v2
Router(config)#end
Router#show cdp
Global CDP information:
Sending CDP packets every 60 seconds
Sending a holdtime value of 180 seconds
Sending CDPv2 advertisements is not enabled
Router#
cdp enable
To enable Cisco Discovery Protocol (CDP) on an interface, use the cdp enable interface configuration
command. To disable CDP on an interface, use the no form of this command.
cdp enable
no cdp enable
Usage Guidelines CDP is enabled by default at the global level and on each supported interface in order to send or receive
CDP information. However, some interfaces, such as ATM interfaces, do not support CDP.
Note The cdp enable, cdp timer, and cdp run commands affect the operation of the IP on demand routing
feature (that is, the router odr global configuration command). For more information on the router
odr command, see the “On-Demand Routing Commands” chapter in the Cisco IOS IP and IP
Routing Command Reference.
Examples In the following example, CDP is disabled on the Ethernet 0 interface only:
Router#show cdp
Global CDP information:
Sending CDP packets every 60 seconds
Sending a holdtime value of 180 seconds
Sending CDPv2 advertisements is enabled
Router#config terminal
Router(config)#interface ethernet 0
Router(config-if)#no cdp enable
cdp holdtime
To specify the amount of time the receiving device should hold a Cisco Discovery Protocol (CDP) packet
from your router before discarding it, use the cdp holdtime global configuration command. To revert to
the default setting, use the no form of this command.
no cdp holdtime
Syntax Description seconds Specifies the hold time to be sent in the CDP update packets.
Usage Guidelines 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 info 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.
Examples In the following example, the CDP packets being sent from the router are configured with a hold time of
60 seconds.
Router(config)#cdp holdtime 60
Defaults The router reports duplex mismatches from all Ethernet interfaces.
Usage Guidelines When you enter the cdp log mismatch duplex command in global configuration mode, duplex
mismatches are displayed on all Ethernet interfaces on the router. When you enter this command in
interface configuration mode, only duplex mismatches for the specified Ethernet interface are displayed.
If the cdp log mismatch duplex command is disabled in global configuration mode, it cannot be
configured per interface using interface configuration mode.
Duplex mismatch can occur only on Ethernet interfaces.
Examples The following example of the cdp log mismatch duplex command in global configuration mode enables
the display of duplex messages from all Ethernet interfaces on the router:
Router(config)# cdp log mismatch duplex
The following example of the cdp log mismatch duplex command in interface configuration mode
enables only the display of duplex messages that may be generated from Ethernet interface 2/1:
Router(config-if)# interface ethernet2/1
The following is sample output from the show running-config command. The bold text shows that the
cdp log mismatch duplex command is disabled globally.
Router# show running-config
Building configuration...
cdp run
To enable Cisco Discovery Protocol (CDP), use the cdp run global configuration command. To disable
CDP, use the no form of this command.
cdp run
no cdp run
Defaults Enabled
Usage Guidelines CDP is enabled on your router by default, which means the Cisco IOS software will receive CDP
information. CDP also is enabled on supported interfaces by default. To disable CDP on an interface, use
the no cdp enable interface configuration command.
Note Becuase ODR (on demand routing) uses CDP, the cdp enable, cdp timer, and cdp run commands
affect the operation of the router odr global configuration command. For more information on the
router odr command, see the Release 12.2 Cisco IOS IP Command Reference, Volume 2 of 3:
Routing Protocols document.
Examples In the following example, CDP is disabled globally, then the user attempts to enable CDP on the Ethernet
0 interface:
Router(config)#no cdp run
Router(config)#end
Router#show cdp
% CDP is not enabled
Router#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#int eth0
Router(config-if)#cdp enable
% Cannot enable CDP on this interface, since CDP is not running
Router(config-if)#
cdp timer
To specify how often the Cisco IOS software sends Cisco Discovery Protocol (CDP) updates, use the
cdp timer global configuration command. To revert to the default setting, use the no form of this
command.
no cdp timer
Syntax Description seconds Specifies how often the Cisco IOS software sends CDP updates.
Defaults 60 seconds
Usage Guidelines The trade-off with sending more frequent transmissions is providing up-to-date information versus using
bandwidth more often.
Note The cdp enable, cdp timer, and cdp run commands affect the operation of the IP on demand routing
feature (that is, the router odr global configuration command). For more information on the router
odr command, see the “On-Demand Routing Commands” chapter in the Cisco IOS IP and IP
Routing Command Reference.
Examples In the following example, CDP updates are sent every 80 seconds, less frequently than the default setting
of 60 seconds. You might want to make this change if you are concerned about preserving bandwidth.
cdp timer 80
Command Description
router odr Enables ODR on the hub router.
show cdp Displays global CDP information, including timer and hold-time
information.
Examples The following example clears the CDP counters. The show cdp traffic output shows that all of the traffic
counters have been reset to zero.
Router# clear cdp counters
Router# show cdp traffic
CDP counters:
Packets output: 0, Input: 0
Hdr syntax: 0, Chksum error: 0, Encaps failed: 0
No memory: 0, Invalid packet: 0, Fragmented: 0
Examples The following example clears the CDP table. The output of the show cdp neighbors command shows
that all information has been deleted from the table.
Router# clear cdp table
show cdp
To display global Cisco Discovery Protocol (CDP) information, including timer and hold-time
information, use the show cdp privileged EXEC command.
show cdp
Examples The following example shows that the current router is sending CDP advertisements every 1 minute (the
default setting for the cdp timer global configuration command). Also shown is that the current router
directs its neighbors to hold its CDP advertisements for 3 minutes (the default for the cdp holdtime
global configuration command), and that the router is enabled to send CDP Version 2 advertisements:
router# show cdp
Field Definition
Sending CDP packets every XX The interval (in seconds) between transmissions of CDP
seconds advertisements. This field is controlled by the cdp timer
command.
Sending a holdtime value of XX The amount of time (in seconds) the device directs the neighbor
seconds to hold a CDP advertisement before discarding it. This field is
controlled by the cdp holdtime command.
Sending CDPv2 advertisements is The state of whether CDP Version-2 type advertisements are
XX enabled to be sent. Possible states are enabled or disabled. This
field is controlled by the cdp advertise v2 global configuration
command.
Examples The following is sample output from the show cdp entry command with no limits. Information about
the neighbor device.cisco.com is displayed, including device ID, address and protocol, platform,
interface, hold time, and version.
Router# show cdp entry device.cisco.com
-------------------------
Device ID: device.cisco.com
Entry address(es):
IP address: 192.168.68.18
CLNS address: 490001.1111.1111.1111.00
DECnet address: 10.1
Platform: cisco 4500, Capabilities: Router
Interface: Ethernet0/1, Port ID (outgoing port): Ethernet0
Holdtime : 125 sec
Version :
Cisco IOS Software
Cisco IOS (tm) 4500 Software (C4500-J-M), Version 12.1(2)
Copyright (c) 1986-2000 by cisco Systems, Inc.
Compiled Mon 07-Apr-00 19:51 by joeuser
The following is sample output from the show cdp entry protocol command. Only information about
the protocols enabled on device.cisco.com is displayed.
Router# show cdp entry device.cisco.com protocol
The following is sample output from the show cdp entry version command. Only information about the
version of software running on device.cisco.com is displayed.
Router# show cdp entry device.cisco.com version
Syntax Description type (Optional) Type of interface about which you want information.
number (Optional) Number of the interface about which you want
information.
Examples The following is sample output from the show cdp interface command. Status information and
information about CDP timer and hold-time settings is displayed for all interfaces on which CDP is
enabled.
Router# show cdp interface
The following is sample output from the show cdp interface command with an interface specified.
Status information and information about CDP timer and hold-time settings is displayed for Ethernet
interface 0 only.
Router# show cdp interface ethernet 0
Command Description
show cdp neighbors Displays detailed information about neighboring devices discovered using
CDP.
show cdp traffic Displays traffic information from the CDP table.
Syntax Description type (Optional) Type of the interface connected to the neighbors about which you
want information.
number (Optional) Number of the interface connected to the neighbors about which
you want information.
detail (Optional) Displays detailed information about a neighbor (or neighbors)
including network address, enabled protocols, hold time, and software
version.
Examples The following is sample output for the show cdp neighbors command:
Field Definition
Device ID The configured ID (name), MAC address, or serial
number of the neighbor device.
Local Intrfce (Local Interface) The protocol being used by the
connectivity media.
Holdtme (Holdtime) The remaining amount of time, in seconds,
the current device will hold the CDP advertisement
from a transmitting router before discarding it.
Capability The capability code discovered on the device. This is
the type of the device listed in the CDP Neighbors
table. Possible values are:
R—Router
T—Transparent bridge
B—Source-routing bridge
S—Switch
H—Host
I—IGMP device
r—Repeater
Platform The product number of the device.
Port ID The protocol and port number of the device.
The following is sample output for the show cdp neighbors detail command.
router#show cdp neighbors detail
-------------------------
Device ID: lab-7206
Entry address(es):
IP address: 172.19.169.83
Platform: cisco 7206VXR, Capabilities: Router
Interface: Ethernet0, Port ID (outgoing port): FastEthernet0/0/0
Holdtime : 123 sec
Version :
Cisco Internetwork Operating System Software
IOS (tm) 5800 Software (C5800-P4-M), Version 12.1(2)
Copyright (c) 1986-2002 by Cisco Systems, Inc.
advertisement version: 2
Duplex: half
-------------------------
Device ID: lab-as5300-1
Entry address(es):
IP address: 172.19.169.87
Platform: cisco AS5300, Capabilities: Router
--More--
.
.
.
Table 116 describes the fields displayed in the show cdp neighbors output.
Field Definition
Device ID The name of the neighbor device and either the MAC
address or the serial number of this device.
Entry address(es) A list of network addresses of neighbor devices.
[network protocol] address The network address of the neighbor device. The
address can be in IP, IPX, AppleTalk, DECnet, or
CLNS protocol conventions.
Platform The product name and number of the neighbor device.
Capabilities The device type of the neighbor. This device can be a
router, a bridge, a transparent bridge, a source-routing
bridge, a switch, a host, an IGMP device, or a
repeater.
Interface The protocol and port number of the port on the
current device.
Holdtime The remaining amount of time, in seconds, the current
device will hold the CDP advertisement from a
transmitting router before discarding it.
Version: The software version running on the neighbor device.
advertisement version: The version of CDP being used for CDP
advertisements.
Duplex: The duplex state of connection between the current
device and the neighbor device.
Native VLAN The ID number of the VLAN on the neighbor device.
VTP Management Domain A string that is the name of the collective group of
VLANs associated with the neighbor device.
Examples The following example specifies information associated with the show cdp traffic command:
router# show cdp traffic
Field Definition
Total packets output The number of CDP advertisements sent by the local device.
Note that this value is the sum of the CDP Version 1
advertisements output and CDP Version 2 advertisements output
fields.
Input The number of CDP advertisements received by the local
device. Note that this value is the sum of the CDP Version 1
advertisements input and CDP Version 2 advertisements input
fields.
Hdr syntax The number of CDP advertisements with bad headers, received
by the local device.
Chksum error The number of times the checksum (verifying) operation failed
on incoming CDP advertisements.
Encaps failed The number of times CDP failed to send advertisements on an
interface because of a failure caused by the bridge port of the
local device.
Field Definition
No memory The number of times the local device did not have enough
memory to store the CDP advertisements in the advertisement
cache table when the device was attempting to assemble
advertisement packets for transmission and parse them when
receiving them.
Invalid The number of invalid CDP advertisements received and sent by
the local device.
Fragmented The number of times fragments or portions of a single CDP
advertisement were received by the local device instead of the
complete advertisement.
CDP version 1 advertisements The number of CDP Version 1 advertisements sent by the local
output device.
Input The number of CDP Version 1 advertisements received by the
local device.
CDP version 2 advertisements The number of CDP Version 2 advertisements sent by the local
output device.
Input The number of CDP Version 2 advertisements received by the
local device.