CDP Command List
The Cisco Discovery Protocol (CDP) is a protocol that Cisco devices use to learn and share information about each other. Cisco devices, such as routers and switches, can discover neighboring Cisco devices through CDP.
- By default, CDP is enabled on all interfaces.
- CDP only shares information with directly connected (neighboring) devices.
- CDP works when there is a valid Data Link layer connection.
- CDP works regardless of the Network layer and other protocols used. It can discover information on LANs, Frame Relay, and other network architectures.
Use the following commands to customize and view CDP information.
|
Use . . . |
To . . . |
Router(config)#cdp holdtime <10-255> |
Specify the amount of time that information in a packet is still valid (default = 180 seconds) |
Router(config)#cdp timer <5-900> |
Specify how often CDP packets are exchanged (default = 60 seconds) |
Router(config)#cdp run |
Enable CDP on the router |
Router(config)#no cdp run |
Disable CDP on a router, to prevent the router from exchanging CDP packets |
Router(config-if)#cdp enable |
Turns CDP for an interface on |
Router(config-if)#no cdp enable |
Turns CDP for an interface off |
Router#show cdp |
View CDP information |
Router#show cdp interface |
Show information about neighbors accessed through an interface |
Router#show cdp neighbors |
Show information about all neighboring Cisco devices including:
|
Router#show cdp neighbors detail |
Shows all information for the show cdp neighbors command and adds:
|
Router#show cdp entry * |
Show the same information as show cdp neighbors detail |
Router#show cdp entry <name of the neighbor> |
Show the same information as show cdp neighbors detail, but only for the named neighbor |
Router#show cdp traffic |
Show the number of CDP advertisements sent and received |
Examples
The following commands turn on CDP for the router and configures it to send CDP packets every 90 seconds.
Router(config)#cdp run
Router(config)#cdp timer 90
The following commands turn off CDP on the router's first Ethernet interface.
Router(config)#int eth 0
Router(config-if)#no cdp enableCredit: Testout 640-802 CCNA Notes