Skip to Content
Cisco IOS Cookbook, 2nd Edition
book

Cisco IOS Cookbook, 2nd Edition

by Kevin Dooley, Ian Brown
December 2006
Intermediate to advanced
1188 pages
72h 8m
English
O'Reilly Media, Inc.
Content preview from Cisco IOS Cookbook, 2nd Edition

Using the Cisco Discovery Protocol

Problem

You want to see summary information about what is connected to your router’s interfaces.

Solution

You can selectively enable or disable Cisco Discovery Protocol (CDP) on the entire router, or on individual interfaces:

Router1#configure terminal 
Enter configuration commands, one per line.  End with CNTL/Z.
Router1(config)#cdp run
Router1(config)#interface Serial0/0
Router1(config-if)#cdp enable
Router1(config-if)#exit
Router1(config)#interface FastEthernet0/0
Router1(config-if)#no cdp enable
Router1(config-if)#exit
Router1(config)#interface FastEthernet1/0
Router1(config-if)#cdp enable
Router1(config-if)#end
Router1#

Discussion

CDP is enabled by default on the router, and on all interfaces. If you have previously disabled it, as discussed in Recipe 2.6, and you want to re-enable CDP on the router, you can issue the cdp run global configuration command:

Router1(config)#cdp run

This turns on CDP processing on all supported interfaces by default. If you don’t want to run CDP on a particular interface, you can use the no cdp enable command, as we did for the serial interface in the example:

Router1(config)#interface Serial0/0
Router1(config-if)#no cdp enable

CDP is a Cisco proprietary protocol that allows Cisco devices to identify one another and exchange useful identifying information. The show cdp neighbors command gives a summary of information about adjacent devices that also happen to be running CDP:

Router1#show cdp neighbors  Capability Codes: R ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

IP Routing on Cisco IOS, IOS XE, and IOS XR: An Essential Guide to Understanding and Implementing IP Routing Protocols

IP Routing on Cisco IOS, IOS XE, and IOS XR: An Essential Guide to Understanding and Implementing IP Routing Protocols

Brad Edgeworth, Aaron Foss, Ramiro Garza Rios
Cisco Software-Defined Access

Cisco Software-Defined Access

Srilatha Vemula, Jason Gooley, Roddie Hasan

Publisher Resources

ISBN: 0596527225Supplemental ContentErrata Page