Configuring Cisco Discovery Protocol

Download as pdf or txt
Download as pdf or txt
You are on page 1of 6

Configuring Cisco Discovery Protocol

This chapter describes how the Cisco Discovery Protocol (CDP) works with Simple Network
Management Protocol (SNMP) to identify other devices in your network.
For a complete description of the router monitoring commands mentioned in this chapter, refer to the
“CDP Commands” chapter in the “System Management” part of the Release 12.2 Cisco IOS
Configuration Fundamentals Command Reference. To locate documentation of other commands that
appear in this chapter, use the Cisco IOS Command Reference Master Index or search online.

Configuring the Cisco Discovery Protocol


CDP is primarily used to obtain protocol addresses of neighboring devices and discover the platform of
those devices. CDP can also be used to display information about the interfaces your router uses. CDP
is media- and protocol-independent, and runs on all Cisco-manufactured equipment including routers,
bridges, access servers, and switches.
Use of SNMP with the CDP MIB allows network management applications to learn the device type and
the SNMP agent address of neighboring devices, and to send SNMP queries to those devices. CDP uses
the CISCO-CDP-MIB.
CDP runs on all media that support Subnetwork Access Protocol (SNAP), including LAN, Frame Relay,
and ATM physical media. CDP runs over the data link layer only. Therefore, two systems that support
different network-layer protocols can learn about each other.
Each device configured for CDP sends periodic messages, known as advertisements, to a multicast
address. Each device advertises at least one address at which it can receive SNMP messages. The
advertisements also contain time-to-live, or holdtime, information, which indicates the length of time a
receiving device should hold CDP information before discarding it. Each device also listens to the
periodic CDP messages sent by others in order to learn about neighboring devices and determine when
their interfaces to the media go up or down.
CDP Version-2 (CDPv2) is the most recent release of the protocol and provides more intelligent device
tracking features. These features include a reporting mechanism that allows for more rapid error
tracking, thereby reducing costly downtime. Reported error messages can be sent to the console or to a
logging server, and cover instances of unmatching native VLAN IDs (IEEE 802.1Q) on connecting ports,
and unmatching port duplex states between connecting devices. Refer tothe Cisco IOS Software System
Error Messages document for detailed examples of CDP error messages.
CDPv2 show commands can provide detailed output on VLAN Trunking Protocol (VTP) management
domain and duplex modes of neighbor devices, CDP-related counters, and VLAN IDs of connecting
ports.

Cisco IOS Configuration Fundamentals Configuration Guide


FC-327
Configuring Cisco Discovery Protocol
CDP Configuration Task List

VTP is a discovery technique deployed by switches where each switch advertises its management
domain on its trunk ports, its configuration revision number, and its known VLANs and their specific
parameters. A VTP domain is made up of one or more interconnected devices that share the same VTP
domain name. A switch can be configured to be in only one VTP domain.
Type-Length-Value fields (TLVs) are blocks of information embedded in CDP advertisements. Table 19
summarizes the TLV definitions for CDP advertisements.

Table 19 Type-Length-Value Definitions for CDPv2

TLV Definition
Device-ID TLV Identifies the device name in the form of a character string.
Address TLV Contains a list of network addresses of both receiving and
sending devices.
Port-ID TLV Identifies the port on which the CDP packet is sent.
Capabilities TLV Describes the functional capability for the device in the form of
a device type, for example, a switch.
Version TLV Contains information about the software release version on
which the device is running.
Platform TLV Describes the hardware platform name of the device, for
example, Cisco 4500.
IP Network Prefix TLV Contains a list of network prefixes to which the sending device
can forward IP packets. This information is in the form of the
interface protocol and port number, for example, Eth 1/0.
VTP Management Domain TLV Advertises the system’s configured VTP management domain
name-string. Used by network operators to verify VTP domain
configuration in adjacent network nodes.
Native VLAN TLV Indicates, per interface, the assumed VLAN for untagged packets
on the interface. CDP learns the native VLAN for an interface.
This feature is implemented only for interfaces that support the
IEEE 802.1Q protocol.
Full/Half Duplex TLV Indicates status (duplex configuration) of CDP broadcast
interface. Used by network operators to diagnose connectivity
problems between adjacent network elements.

CDP Configuration Task List


To configure CDP, perform any of the optional tasks in the following sections:
• Setting the CDP Transmission Timer and Hold Time
• Reenabling CDP on a Local Router
• Reenabling CDP Version-2 Advertisements
• Reenabling CDP on an Interface
• Monitoring and Maintaining CDP
The the end of this chapter for “CDP Configuration Examples.”

Cisco IOS Configuration Fundamentals Configuration Guide


FC-328
Configuring Cisco Discovery Protocol
CDP Configuration Task List

Note The cdp enable, cdp timer, and cdp run global configuration 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
Release 12.2 Cisco IOS IP Command Reference, Volume 2 of 3: Routing Protocols document.

Setting the CDP Transmission Timer and Hold Time


To set the frequency of CDP transmissions and the hold time for CDP packets, use the following
commands in global configuration mode:

Command Purpose
Step 1 Router(config)# cdp timer seconds Specifies frequency of transmission of CDP updates.
Step 2 Router(config)# cdp holdtime seconds Specifies the amount of time a receiving device should hold the
information sent by your device before discarding it.

Reenabling CDP on a Local Router


CDP is enabled on Cisco devices by default. If you prefer not to use the CDP device discovery capability,
you can disable it with the no cdp run command.
To reenable CDP after disabling it, use the following command in global configuration mode:

Command Purpose
Router(config)# cdp run Enables CDP on the system.

Reenabling CDP Version-2 Advertisements


The broadcasting of CDPv2 advertisements is enabled on Cisco routers by default. You can disable
CDPv2 advertisements with the no cdp advertise-v2 command.
To reenable CDPv2 advertisements, use the following command in global configuration mode:

Command Purpose
Router(config)# cdp advertise-v2 Enables CDPv2 advertising functionality on the system.

Reenabling CDP on an Interface


CDP is enabled by default on all supported interfaces (except for Frame Relay multipoint subinterfaces)
to send and receive CDP information. However, some interfaces, such as ATM interfaces, do not support
CDP.
You can disable CDP on an interface that supports CDP by using the no cdp enable command.

Cisco IOS Configuration Fundamentals Configuration Guide


FC-329
Configuring Cisco Discovery Protocol
CDP Configuration Examples

To reenable CDP on an interface after disabling it, use any of the following command in interface
configuration mode, as needed:

Command Purpose
Router(config-if)# cdp enable Enables CDP on an interface.

Monitoring and Maintaining CDP


To monitor and maintain CDP on your device, use one or more of the following commands in privileged
EXEC mode:

Command Purpose
Router# clear cdp counters Resets the traffic counters to zero.
Router# clear cdp table Deletes the CDP table of information about neighbors.
Router# show cdp Displays the interval between transmissions of CDP
advertisements, the number of seconds the CDP advertisement is
valid for a given port, and the version of the advertisement.
Router# show cdp entry device-name [protocol | Displays information about a specific neighbor. Display can be
version] limited to protocol or version information.
Router# show cdp interface [type number] Displays information about interfaces on which CDP is enabled.
Router# show cdp neighbors [type number] [detail] Displays the type of device that has been discovered, the name
of the device, the number and type of the local interface (port),
the number of seconds the CDP advertisement is valid for the
port, the device type, the device product number, and the port ID.
Issuing the detail keyword displays information on the native
VLAN ID, the duplex mode, and the VTP domain name
associated with neighbor devices.
Router# show cdp traffic Displays CDP counters, including the number of packets sent
and received and checksum errors.
Router# show debugging Displays information about the types of debugging that are
enabled for your router. Refer to the Cisco IOS Debug Command
Reference for more information about CDP debug commands.

CDP Configuration Examples


The following sections provide CDP configuration examples:
• Setting the CDP Transmission Timer and Hold Time Example
• Monitoring and Maintaining CDP Example

Setting the CDP Transmission Timer and Hold Time Example


In the following example, the user sets the cdp timer to send updates every 30 seconds to neighboring
routers and sets the router to show that the updates are working correctly:

Cisco IOS Configuration Fundamentals Configuration Guide


FC-330
Configuring Cisco Discovery Protocol
CDP Configuration Examples

Router(config)# cdp timer 30


Router(config)# exit
Router# show cdp interface
Serial0 is up, line protocol is up
Encapsulation is HDLC
Sending CDP packets every 30 seconds
Holdtime is 180 seconds

In the following example, the user sets the holdtime to be 90 seconds and sets the router to show that the
updates are working correctly:
Router(config)# cdp holdtime 90
Router(config)# exit
Router# show cdp interface
Serial0 is up, line protocol is up
Encapsulation is HDLC
Sending CDP packets every 30 seconds
Holdtime is 90 seconds

Monitoring and Maintaining CDP Example


In the following example, the user monitors and maintains CDP on their device when using the show
cdp neighbors EXEC command. The following example displays information related to the show cdp
neighbors command is specified:
router# show cdp neighbors

Capability Codes:R - Router, T - Trans Bridge, B - Source Route Bridge S - Switch, H -


Host, I - IGMP, r - Repeater
Device ID Local IntrfceHoldtmeCapabilityPlatform Port ID
joeEth 0 133 4500 Eth 0
samEth 0 152 R AS5200 Eth 0
terriEth 0 144 3640 Eth 0/0
maineEth 0 141 RP1 Eth 0/0
sanchoEth 0 164 7206 Eth 1/0

Cisco IOS Configuration Fundamentals Configuration Guide


FC-331
Configuring Cisco Discovery Protocol
CDP Configuration Examples

Table 20 describes the significant fields shown in the example.

Table 20 show cdp neighbors Field Descriptions

Field Definition
Capability Codes The type of device that can be discovered.
Device ID The name of the neighbor device and either the MAC address or
the serial number of this device.
Local Intrfce The protocol being used by the connectivity media.
Holdtme The remaining amount of time (in seconds) the current device
will hold the CDP advertisement from a sending router before
discarding it.
Capability The type of the device listed in the CDP Neighbors table.
Possible values are as follows:
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.

Cisco IOS Configuration Fundamentals Configuration Guide


FC-332

You might also like