Table Of Contents
Configuring CDP
Understanding How CDP Works
Default CDP Configuration
Configuring CDP on the Switch
Setting the CDP Global Enable and Disable States
Setting the CDP Enable and Disable States on a Port
Setting the CDP Message Interval
Setting the CDP Holdtime
Displaying CDP Neighbor Information
Configuring CDP
This chapter describes how to configure the Cisco Discovery Protocol (CDP) on the Catalyst 6500 series switches.
Note
For complete syntax and usage information for the commands that are used in this chapter, refer to the Catalyst 6500 Series Switch Command Reference publication.
This chapter consists of these sections:
•
Understanding How CDP Works
•
Default CDP Configuration
•
Configuring CDP on the Switch
Understanding How CDP Works
CDP was enhanced in software release 8.1(1) to facilitate the backward compatibility with the newer, higher-powered Cisco IP phones. With this enhanced CDP, a Cisco IP phone can negotiate its power requirements to the switch within the CDP packet. The switch uses this information to ensure that it does not oversubscribe the available power.
CDP is a media- and protocol-independent protocol that runs on all the Cisco-manufactured equipment including routers, bridges, access and communication servers, and switches. Using CDP, you can view information about all the Cisco devices that are directly attached to the switch. In addition, CDP detects the native VLAN and port duplex mismatches.
The network management applications can retrieve the device type and SNMP-agent address of the neighboring Cisco devices using CDP. This feature enables the applications to send the SNMP queries to the neighboring devices. CDP allows the network management applications to discover the Cisco devices that are the neighbors of the already known devices, in particular, the neighbors running the lower-layer, transparent protocols.
CDP runs on all media that support Subnetwork Access Protocol (SNAP). CDP runs over the data link layer only.
The Cisco devices never forward the CDP packets. When new CDP information is received, the Cisco devices discard old information.
Default CDP Configuration
Table 31-1 shows the default CDP configuration.
Table 31-1 CDP Default Configuration
Feature
|
Default Value
|
CDP global enable state
|
Enabled
|
CDP port enable state
|
Enabled on all ports
|
CDP message interval
|
60 seconds
|
CDP holdtime
|
180 seconds
|
Note
The CDP message interval can be configured in the range of 5-254 seconds.
Configuring CDP on the Switch
These sections describe how to configure CDP:
•
Setting the CDP Global Enable and Disable States
•
Setting the CDP Enable and Disable States on a Port
•
Setting the CDP Message Interval
•
Setting the CDP Holdtime
•
Displaying CDP Neighbor Information
Setting the CDP Global Enable and Disable States
To set the CDP global enable state, perform this task in privileged mode:
| |
Task
|
Command
|
Step 1
|
Set the CDP global enable state on the switch.
|
set cdp {enable | disable}
|
Step 2
|
Verify the CDP configuration.
|
show cdp
|
This example shows how to enable CDP globally and verify the configuration:
Console> (enable) set cdp enable
Console> (enable) show cdp
This example shows how to disable CDP globally and verify the configuration:
Console> (enable) set cdp disable
Console> (enable) show cdp
Setting the CDP Enable and Disable States on a Port
You can enable or disable CDP on a per-port basis. You must enable CDP globally before the switch will transmit the CDP messages on any ports.
To set the CDP enable state on a per-port basis, perform this task in privileged mode:
| |
Task
|
Command
|
Step 1
|
Set the CDP enable state on the individual ports.
|
set cdp {enable | disable} [mod/port]
|
Step 2
|
Verify the CDP configuration.
|
show cdp port [mod[/port]]
|
This example shows how to enable CDP on ports 3/1-2 and verify the configuration:
Console> (enable) set cdp enable 3/1-2
CDP enabled on ports 3/1-2.
Console> (enable) show cdp port 3
This example shows how to disable CDP on ports 3/1-6 and verify the configuration:
Console> (enable) set cdp disable 3/1-6
CDP disabled on ports 3/1-6.
Console> (enable) show cdp port 3
Setting the CDP Message Interval
The CDP message interval specifies how often the switch will transmit the CDP messages to the directly connected Cisco devices.
To set the default CDP message interval, perform this task in privileged mode:
| |
Task
|
Command
|
Step 1
|
Set the default CDP message interval. The allowed range is 5-900 seconds.
|
set cdp interval interval
|
Step 2
|
Verify the CDP configuration.
|
show cdp
|
This example shows how to set the default CDP message interval to 100 seconds and verify the configuration:
Console> (enable) set cdp interval 100
CDP message interval set to 100 seconds for all ports.
Console> (enable) show cdp
Setting the CDP Holdtime
The CDP holdtime specifies how much time can pass between the CDP messages from the neighboring devices before the device is no longer considered connected and the neighboring entry is aged out.
To set the default CDP holdtime, perform this task in privileged mode:
| |
Task
|
Command
|
Step 1
|
Set the default CDP holdtime. The allowed range is 10-255 seconds.
|
set cdp holdtime interval
|
Step 2
|
Verify the CDP configuration.
|
show cdp
|
This example shows how to set the default CDP holdtime to 225 seconds and verify the configuration:
Console> (enable) set cdp holdtime 225
CDP holdtime set to 225 seconds.
Console> (enable) show cdp
Displaying CDP Neighbor Information
To display information about the directly connected Cisco devices, enter the show cdp neighbors command. Enter the vlan keyword to display the native VLAN for the connected ports. Enter the duplex keyword to display the duplex mode for the connected ports. Enter the capabilities keyword to display the device capability codes for the connected device. Enter the detail keyword to display the detailed information about the neighboring device.
Note
If you enter the show cdp neighbors command for a device that supports earlier versions of CDP, "unknown" is displayed in the following fields: VTP Management Domain, Native VLAN, and Duplex.
To display information about the directly connected Cisco devices, perform this task:
Task
|
Command
|
Display information about the CDP neighbors.
|
show cdp neighbors [mod[/port]] [vlan | duplex | capabilities | detail]
|
This example shows how to display the CDP neighbor information for the connected Cisco devices:
Console> (enable) show cdp neighbors
* - indicates vlan mismatch.
# - indicates duplex mismatch.
Port Device-ID Port-ID Platform
-------- ------------------------------- ------------------------- ------------
2/3 JAB023807H1(2948) 2/2 WS-C2948
3/1 JAB023806JR(4003) 2/1 WS-C4003
3/2 JAB023806JR(4003) 2/2 WS-C4003
3/5 JAB023806JR(4003) 2/5 WS-C4003
3/6 JAB023806JR(4003) 2/6 WS-C4003
This example shows how to display the native VLAN for each port that is connected on the neighboring device (there is a native VLAN mismatch between port 3/6 on the local switch and port 2/6 on the neighboring device, as indicated by the asterisk [*]):
Console> (enable) show cdp neighbors vlan
* - indicates vlan mismatch.
# - indicates duplex mismatch.
Port Device-ID Port-ID NativeVLAN
-------- ------------------------------- ------------------------- ----------
2/3 JAB023807H1(2948) 2/2 522
3/1 JAB023806JR(4003) 2/1 100
3/2 JAB023806JR(4003) 2/2 100
3/5 JAB023806JR(4003) 2/5 1
3/6 JAB023806JR(4003) 2/6* 1
This example shows how to display detailed information about the neighboring device:
Console> (enable) show cdp neighbors 2/3 detail
Device-ID: JAB023807H1(2948)
Capabilities: TRANSPARENT_BRIDGE SWITCH
WS-C2948 Software, Version McpSW: 5.1(57) NmpSW: 5.1(1)
Copyright (c) 1995-1999 by Cisco Systems, Inc.
Port-ID (Port on Neighbors's Device): 2/2
VTP Management Domain: Lab_Network