First off… CDP stands for “Cisco Discovery Protocol”. It’s a protocol that… You guessed it.. Discovers other connected Cisco devices on your network.
There are several CDP commands and their output can look similar or completely different to other CDP commands.
On a Cisco exam you might be asked something like:
- “Which of the following commands could tell you information about IOS” or
- “Which of the following CDP command could identify a neighbor’s model of hardware”
- “What Port does switch “s1” connect to switch “s3”.
To explain CDP I will be using Packet Tracer… Here is my Map:
A couple of things to also give you…
- s1 – Port fa0/24 is connected to “fa0/24 on s2”.
- s1 – Port fa0/23 is connected to “fa0/1 on s3”.
- s2 – Port fa0/23 is connected to “fa0/2” on s3”
Look at s1’s perspective:
First we’ll look at both the “show cdp” and “show cdp neighbors” commands:
If we didn’t already know the names of the switches we now do. It’s listed under “Device ID” column. Also please note under Port ID you can see what port the switch connects to on the neighbor switch.
Next command will show all switches connected to a single switch. The command is “show cdp neighbors detail”.
A command that gives similar output as the last one is: “show cdp entry s2”. This command though only shows the detailed info for switch you select.
Cisco recommends that you disabled CDP on any port that doesn’t connect to another Cisco device.
To completely disable/re-enable CDP on a switch run:
- no cdp run (gloabal config) (disable for whole switch)
- cdp run (global Config) (enable for whole switch)
To disable and enable the cdp on switch per interface you need to run these commands:
- no cdp enable (interface subcommand)
- cdp enable (interface subcommand)
Hope this helps explain CDP and what some of the information CDP can give you depending on what CDP command you use.