Understanding Cisco Discovery Protocol (CDP)
Objective
The objective of this lab exercise is for you to learn and understand how to enable CDP and adjust CDP timers.
Purpose
Understanding CDP is a fundamental skill. CDP is a proprietary Cisco protocol used for device discovery and internetwork troubleshooting. As a Cisco engineer, as well as in the Cisco CCNA exam, you will be expected to know how to enable and use CDP in internetwork discovery and troubleshooting.
Lab Topology
Use the following topology to complete this lab exercise:
Task 1: Configure Hostnames
Objective: Configure hostnames on R1 and SW1 as illustrated in the topology.
Configuration:
R1#conf t Enter configuration commands, one per line. End with CTRL/Z. R1(config)#hostname R1 SW1#conf t Enter configuration commands, one per line. End with CTRL/Z. SW1(config)#hostname SW1
Task 2: Configure IP Address on R1
Objective: Configure an IP address of 172.29.100.1/24 on R1 F0/0.
Configuration:
R1#conf t Enter configuration commands, one per line. End with CTRL/Z. R1(config)#int fa0/0 R1(config-if)#ip address 172.29.100.1 255.255.255.0 R1(config-if)#no shut
Task 3: Configure VLAN200 on SW1
Objective: Configure VLAN200 on SW1 and name it CDP_VLAN. Configure interface VLAN200 on SW1 and assign it the IP address 172.29.100.2/24. Assign port FastEthernet0/2 on SW1 to this VLAN.
Configuration:
SW1#conf t Enter configuration commands, one per line. End with CTRL/Z. SW1(config)#vlan 200 SW1(config-vlan)#name CDP_VLAN SW1(config-vlan)#exit SW1(config)#interface vlan 1 SW1(config-if)#shut SW1(config-if)#exit SW1(config)#int vlan 200 SW1(config-if)#no shut SW1(config-if)#ip address 172.29.100.2 255.255.255.0 SW1(config-if)#exit SW1(config)#int f0/2 SW1(config-if)#switchport mode access SW1(config-if)#switchport access vlan 200 SW1(config-if)#end SW1#ping 172.29.100.1 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 172.29.100.1, timeout is 2 seconds: .!!!! Success rate is 80 percent (4/5), round-trip min/avg/max = 0/0/0 ms
Task 4: Enable and Configure CDP
Objective: Enable CDP on R1 and SW1 globally (it’s already on by default but you can practice the command). Configure R1 and SW1 to send CDP packets every 10 seconds. The timer command won’t work on Packet Tracer, so use live equipment or GNS3.
Configuration:
R1#conf t Enter configuration commands, one per line. End with CTRL/Z. R1(config)#cdp run R1(config)#cdp timer 10 R1(config)#exit R1#show cdp interface fastethernet0/0 FastEthernet0/0 is up, line protocol is up Sending CDP packets every 60 seconds Holdtime is 180 seconds SW1#conf t Enter configuration commands, one per line. End with CTRL/Z. SW1(config)#cdp run SW1(config)#cdp timer 10 SW1(config)#end SW1#show cdp interface fastethernet0/2 FastEthernet0/2 is up, line protocol is up Sending CDP packets every 60 seconds Holdtime is 180 seconds
Task 5: Use CDP for Device Information
Objective: Use CDP to see detailed information about SW1 from R1. Familiarize yourself with the information provided.
Configuration:
R1#show cdp neighbors detail Device ID: SW1 Entry address(es): IP address : 172.29.100.2 Platform: cisco 2960, Capabilities: Switch Interface: FastEthernet0/0, Port ID (outgoing port): FastEthernet0/2 Holdtime: 140 Version : Cisco IOS Software, C2960 Software (C2960-LANBASEK9-M), Version 15.0(2)SE4, RELEASE SOFTWARE (fc1) Technical Support: http://www.cisco.com/techsupport Copyright (c) 1986-2013 by Cisco Systems, Inc. Compiled Wed 26-Jun-13 02:49 by mnguyen advertisement version: 2 Duplex: full
NOTE: The show cdp neighbors detail command provides detailed information about devices. This is a very useful troubleshooting command as you can find out the IP addresses (and more) of connected devices and access them remotely. Try this command on SW1 and see the information you find out about on R1. Familiarize yourself with the contents of this command for both routers and switches.
Task 6: Disable CDP
Objective: Now disable CDP on the router interface and disable CDP globally on the switch.
Configuration:
R1#conf t Enter configuration commands, one per line. End with CTRL/Z. R1(config)#int fa0/0 R1(config-if)#no cdp enable R1(config-if)#end R1#copy running-config startup-config SW1(config)#no cdp run SW1(config)#end SW1#copy running-config startup-config
NOTE: The CDP entries will still remain until they time out. You can clear the entries with the clear cdp table command, and then issue show commands to check that there are no entries. Knowing how to disable CDP is an important security task for the CCNA exam.
Cisco Packet Tracer file:
Load and open the .pkt Lab file in Cisco Packet Tracer from here: Cisco_Discovery_Protocol_CDP.pkt