The Cisco Discovery Protocol (CDP) Discovery Protocol

CDP allows devices to share basic configuration information without even configuring any protocol specific information and is enabled by default on all interfaces.

CDP is a Datalink Protocol occurring at Layer 2 of the OSI model.
This is important to understand because CDP is not routable and can only traverse to directly connected devices.

CDP allows you to view information such Operating System Version, Protocol Information, and much more.
This can be very handy for troubleshooting a variety of problems.

CDP Configuration by default it is enabled on the router and all interfaces.
The commands are simple:

Global Configuration Commands:

no cdp run turn off CDP for the entire router
cdp run (default) turn it on for the entire router
cdp timer 120 would change CDP to advertise every 120 seconds

Interface Configuration Commands:

cdp enable (default) turn it on for the interface
no cdp enable turn it off for interface

Show Commands:

show cdp interface view interface settings,
show cdp neighbor view directly connected neighbors
show cdp neighbor detail view detailed information about neighbors
show cdp general information

使用CDP协议

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#
注释 CDP(Cisco Discovery Protocol)是思科专有的协议,用于发现相连的思科设备,帮助了解网络拓
朴,缺省是启用的,使用show cdp neighbor detail 命令可以查看相连设备的详细信息

禁止CDP协议

Router1#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router1(config)#cdp run
Router1(config)#interface FastEthernet0/0
Router1(config-if)#no cdp enable
Router1(config-if)#end
Router1#
注释 为了安全可以在边界设备上禁止CDP