# Cisco Discovery Protocol

CDP is a Cisco proprietary protocol.

It is enabled on Cisco devices (routers, switches, firewalls, IP phones, etc) by default.

CDP messages are periodically sent to multicas MAC address 0100.0CCC.CCCC.

When a device receives a CDP message, it processes and discards the message. It **does not** forward it to other devices.

By default, CDP messages are sent once every **60 seconds**.

By default, the CDP holdtime is **180 seconds**. If a message isn't received from a neighbor for 180 seconds, the neighbor is removed from the CDP neighbor table.

CDPv2 messages are sent by default.

<figure><img src="https://1474932522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAgItg4KAZpnXjAFPWRf8%2Fuploads%2FDvSfy2l8xktUAKVBRhlF%2FScreenshot%20from%202023-07-29%2011-53-40.png?alt=media&#x26;token=48cc112b-bd99-4dc0-8efc-8ca3d21c9394" alt=""><figcaption></figcaption></figure>

<figure><img src="https://1474932522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAgItg4KAZpnXjAFPWRf8%2Fuploads%2FXXzn78U1aywQCKqCnKqr%2FScreenshot%20from%202023-07-29%2011-54-00.png?alt=media&#x26;token=9d811a5b-f706-42e6-bddf-f10c71333b57" alt=""><figcaption></figcaption></figure>

<figure><img src="https://1474932522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAgItg4KAZpnXjAFPWRf8%2Fuploads%2FtQ5n56kCnbcR4hdo5N2C%2FScreenshot%20from%202023-07-29%2011-54-27.png?alt=media&#x26;token=5be7886e-29ab-43f9-8538-eadf7808257c" alt=""><figcaption></figcaption></figure>

<figure><img src="https://1474932522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAgItg4KAZpnXjAFPWRf8%2Fuploads%2FesJSIPWca3CmkAxwYe4U%2FScreenshot%20from%202023-07-29%2011-55-29.png?alt=media&#x26;token=b9b29d31-efa1-4e2a-8239-1246f6810e81" alt=""><figcaption></figcaption></figure>

<figure><img src="https://1474932522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAgItg4KAZpnXjAFPWRf8%2Fuploads%2FSPA72FDYnlBTrXrRsFVi%2FScreenshot%20from%202023-07-29%2012-18-44.png?alt=media&#x26;token=7cdee552-026b-493c-b6a0-de8ecfc6e752" alt=""><figcaption></figcaption></figure>

## CDP `show` command summary

1. Shows basic information about CDP (timers, version).

```
R1# show cdp
```

2. Displays how many CDP messages have been sent and received.

```
R1# show cdp traffic
```

3. Displays which interfaces CDP is enabled on.

```
R1# show cdp interface
```

4. Lists CDP neighbors and some basic information about each neighbor.

```
R1# show cdp neighbors
```

5. Lists each CDP neighbor with more detailed information.

```
R1# show cdp neighbors detail
```

6. Displays the same infor as above, but for the specified neighbor only.

```
R1# show cdp entry <name>
```

## CDP configuration commands

* CDP is globally enabled by default.
* CDP is also enabled on each interface by default.
* To enable/disable CDP globally: `R1(config)# [no] cdp run`
* To enable/disable CDP on specific interfaces: `R1(config-if)# [no] cdp enable`
* Configure the CDP timer: `R1(config)# cdp timer <seconds>`
* Configure the CDP holdtime: `R1(config)# cdp holdtime <seconds>`
* Enable/disable CDPv2: `R1(config)# [no] cdp advertise-v2`

## Wireshark capture

<figure><img src="https://1474932522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAgItg4KAZpnXjAFPWRf8%2Fuploads%2FA47VSiAvpNVBX0mNrrIC%2FScreenshot%20from%202023-07-29%2016-07-54.png?alt=media&#x26;token=329f9822-291a-4d1b-bb75-f55207354b0b" alt=""><figcaption></figcaption></figure>
