What is CDP?
Cisco discovery protocol is a layer 2 protocol (OSI) that operates between Cisco devices such as routers and switches. CDP displays information about the directly connected devices such as device ID, Platform, connected interface, IOS versions, and layer 3 IP address.
Key Features of CDP
Device Discovery: CDP helps network administrators in discovering Cisco devices that are directly connected. It’s particularly useful in complex networks where keeping track of devices can be challenging.
Information Sharing: CDP exchanges information like device type, connected interface, IP address, platform, capabilities, and software version. This information assists in understanding the network structure and the role of each device.
No Configuration Required: CDP is typically enabled by default on Cisco devices, automatically discovering neighbors without the need for additional configuration.
Troubleshooting Aid: By providing details about neighboring devices, CDP aids in diagnosing network issues like connectivity problems or misconfigurations.
How CDP Works
Transmission: CDP packets are periodically transmitted from each CDP-enabled interface.
Receipt and Storage: Devices that receive CDP packets store the information and may display it to network administrators through command-line interface (CLI) commands.
Update Frequency: CDP updates are sent out at regular intervals (default is 60 seconds on Cisco devices) to ensure that the information stays current.
Security Considerations: Since CDP advertises network information, it can be a security risk. Malicious users can use CDP information to gain insights into the network topology. It’s often recommended to disable CDP on interfaces facing untrusted networks.
Alternatives: In multi-vendor environments, LLDP (Link Layer Discovery Protocol) is used as a standard alternative to CDP. LLDP provides similar functionality but is not limited to Cisco devices.
We use the network topology below as an example
Topology Configuration
HQ#config t
HQ(config)#interface fa0/0
HQ(config-if)#ip address 172.16.1.1 255.255.255.0
HQ(config-if)#no shutdown
HQ(config-if)#interface fa0/1
HQ(config-if)#ip address 200.199.90.1 255.255.255.0
HQ(config-if)#no shutdown
HQ(config)#interface se0/0/0
HQ(config-if)#ip address 172.16.2.2 255.255.255.252
HQ(config-if)#no shutdown
HQ(config)#interface se0/0/1
HQ(config-if)#ip address 192.168.1.2 255.255.255.252
HQ(config-if)#no shutdown
HQ(config)#router eigrp 100
HQ(config-router)#network 172.16.1.0
HQ(config-router)#network 172.16.2.0
HQ(config-router)#network 200.199.90.0.
HQ(config-router)#network 192.168.1.0
HQ(config-router)#no auto-summary
BRANCH1
BRANCH1#config t
BRANCH1(config)#interface fa0/0
BRANCH1(config-if)#ip address 172.16.3.1 255.255.255.0
BRANCH1(config-if)#no shutdown
BRANCH1(config)#interface se0/0/0
BRANCH1(config-if)#ip address 172.16.2.1 255.255.255.252
BRANCH1(config-if)#no shutdown
BRANCH1(config)#interface se0/0/1
BRANCH1(config-if)#ip address 192.168.3.1 255.255.255.252
BRANCH1(config-if)#no shutdown
BRANCH1(config)#router eigrp 100
BRANCH1(config-router)#network 172.16.3.0
BRANCH1(config-router)#network 172.16.2.0
BRANCH1(config-router)#network 192.168.3.0
BRANCH1(config-router)#no auto-summary
BRANCH2
BRANCH2#config t
BRANCH2(config)#interface fa0/0
BRANCH2(config-if)#ip address 192.168.2.1 255.255.255.0
BRANCH2(config-if)#no shutdown
BRANCH2(config)#interface se0/0/0
BRANCH2(config-if)#ip address 192.168.1.1 255.255.255.252
BRANCH2(config-if)#no shutdown
BRANCH2(config)#interface se0/0/1
BRANCH2(config-if)#ip address 192.168.3.2 255.255.255.252
BRANCH2(config-if)#no shutdown
BRANCH2(config)#router eigrp 100
BRANCH2(config-router)#network 192.168.1.0
BRANCH2(config-router)#network 192.168.2.0
BRANCH2(config-router)#network 192.168.3.0
BRANCH2(config-router)#no auto-summary
How to use show command to examine CDP configuration. The table below lists and explains the various CDP commands output.
You can use the Cisco Packet tracer for practice. Don’t forget to configure clock rates on serial interfaces and a routing protocol (EIGRP)
In summary, CDP is a useful protocol for network administrators managing Cisco environments, offering a simple and effective way to discover and understand network device configurations and connections. However, its proprietary nature and potential security implications are important considerations in its deployment and usage.