1. Learning Objectives
This configuration exercise covers:
- Understanding CDP protocol characteristics
- CDP configuration and troubleshooting techniques
- Viewing directly connected neighbor information via CDP
2. Network Topology
The laboratory topology for CDP configuration is illustrated below.
3. Configuration Steps
(1) Configure RouterA
RouterA(config)#interface serial 0/1/0
RouterA(config-if)#ip address 192.168.10.1 255.255.255.0
RouterA(config-if)#no shutdown
RouterA(config-if)#exit
RouterA(config)#interface fastEthernet 0/0
RouterA(config-if)#ip address 192.168.20.1 255.255.255.0
RouterA(config-if)#no shutdown
RouterA(config-if)#exit
RouterA(config)#
(2) Configure RouterB
RouterB(config)#interface serial 0/1/0
RouterB(config-if)#ip address 192.168.10.2 255.255.255.0
RouterB(config-if)#no shutdown
RouterB(config-if)#exit
(3) Configure SwitchA
SwitchA(config)#interface vlan 1
SwitchA(config-if)#ip address 192.168.20.100 255.255.255.0
SwitchA(config-if)#no shutdown
SwitchA(config-if)#exit
4. Verification and Troubleshooting
(1) Display CDP Operational Status
RouterA#show cdp
Global CDP information:
Sending CDP packets every 60 seconds
Sending a holdtime value of 180 seconds
Sending CDPv2 advertisements is enabled
RouterA#
The output confirms that CDP is enabled by default, transmitting CDP messages every 60 seconds from all eligible interfaces. In Ethernet networks, these messages use IEEE 802.3 encapsulation with a destination MAC address of 0100.0ccc.ccee (multicast address). When a neighbor receives CDP messages, it stores this inforamtion in its local CDP table with a 180-second holdtime. The current implementation uses CDP version 2.
(2) Display Interface CDP Status
RouterA#show cdp interface fastEthernet 0/0
FastEthernet0/0 is up, line protocol is up
Sending CDP packets every 60 seconds
Holdtime is 180 seconds
RouterA#
(3) Display Connected Neighbor Information
RouterA#show cdp neighbors
Capability Codes: R - Router, T - Trans Bridge, B - Source Route Bridge
S - Switch, H - Host, I - IGMP, r - Repeater, P - Phone
Device ID Local Intrfce Holdtme Capability Platform Port ID
RouterB Ser 0/1/0 155 R C2900 Ser 0/1/0
SwitchA Fas 0/0 145 3650 Fas 1/0/1
RouterA#
This output indicates that RouterA has two CDP neighbors: RouterB and SwitchA. The field definitions are as follows:
- Device ID: Hostname of the CDP neighbor device
- Local Interface: The local interface through which RouterA connects to the CDP neighbor
- Holdtme: Remaining validity period since the last CDP message was received from the neighbor (counts down from 180 seconds)
- Capability: Device type and capabilities of the neighbor; the Capability Codes header explains each code
- Platform: Hardware model of the neighbor device
- Port ID: The interface on the neighbor device to which RouterA is connetced
(4) Display Detailed Neighbor Information
RouterB#show cdp neighbors detail
Device ID: RouterA
Entry address(es):
IP address : 192.168.10.1
Platform: cisco C2900, Capabilities: Router
Interface: Serial0/1/0, Port ID (outgoing port): Serial0/1/0
Holdtime: 169
Version :
Cisco IOS Software, C2900 Software (C2900-UNIVERSALK9-M), Version 15.1(4)M4, RELEASE SOFTWARE (fc2)
Technical Support: http://www.cisco.com/techsupport
Copyright (c) 1986-2012 by Cisco Systems, Inc.
Compiled Thurs 5-Jan-12 15:41 by pt_team
advertisement version: 2
Duplex: full
RouterB#
The show cdp neighbors detail command provides identical functionality to show cdp entry *, where the asterisk can be replaced with a specific device name. The clear cdp table command removes all CDP cache entries.
(5) Disable CDP and Adjust CDP Parameters
RouterA(config)#interface fastEthernet 0/0
RouterA(config-if)#no cdp enable
RouterA(config-if)#exit
RouterA(config)#no cdp run
RouterA(config)#cdp run
RouterA(config)#cdp timer 10
RouterA(config)#cdp holdtime 30
RouterA(config)#exit
(6) Display CDP Traffic Statistics
RouterA#show cdp traffic