CCNA 200-301 Chapter 2 Network Access Lab 017 Configure & Verify Configure and Verify Cisco Discovery Protocol
Watch Full Demo on YouTube:
Lab Objective:
To configure the Cisco Discovery Protocol (CDP) on Cisco network devices and verify its operation.
The lab will cover enabling and disabling CDP globally and on specific interfaces, and using CDP commands to gather information about neighboring devices.
Lab Topology:
Equipment Required:
- 2 x Cisco Routers (e.g. ISR4331/K9)
- 4 x Cisco switch (e.g. WS-C2960-24TT-L)
- 4 x PCs or laptops with Ethernet ports (for data traffic)
- Console Cable
- Ethernet Cable for connections between devices
- Computer with Terminal emulation software e.g. PuTTY
IPv4 Address Table:
A. Router IPv4 Address Table:
Device Name | Interface ID | IP Address | Subnet-Mask |
Router1 | GigabitEthernet0/0/0 | 10.10.10.1/30 | 255.255.255.252 |
Router1 | GigabitEthernet0/0/1 | 192.168.10.10/24 | 255.255.255.0 |
Router1 | GigabitEthernet0/0/2 | 192.168.20.10/24 | 255.255.255.0 |
Router2 | GigabitEthernet0/0/0 | 10.10.10.2/30 | 255.255.255.252 |
Router2 | GigabitEthernet0/0/1 | 192.168.30.10/24 | 255.255.255.0 |
Router2 | GigabitEthernet0/0/2 | 192.168.40.10/24 | 255.255.255.0 |
B. Switch VLAN Table:
Device Name | Interface ID | Interface Mode | Allowed VLANs |
Switch1 | GigabitEthernet1/1/3 | Trunk | 10, 20 |
Switch1 | GigabitEthernet1/1/1 | Access | 10 |
Switch1 | GigabitEthernet1/0/1 | Access | 20 |
Switch2 | GigabitEthernet1/1/3 | Trunk | 10, 20 |
Switch2 | GigabitEthernet1/1/2 | Access | 20 |
Switch2 | GigabitEthernet1/0/1 | Access | 20 |
Switch3 | GigabitEthernet1/1/3 | Trunk | 30, 40 |
Switch3 | GigabitEthernet1/1/1 | Access | 30 |
Switch3 | GigabitEthernet1/0/1 | Access | 30 |
Switch4 | GigabitEthernet1/1/3 | Trunk | 30, 40 |
Switch4 | GigabitEthernet1/1/2 | Access | 40 |
Switch4 | GigabitEthernet1/0/1 | Access | 40 |
C. SVI Table:
Device Name | Interface ID | IP Address | Subnet-Mask |
Switch1 | VLAN 10 | 192.168.10.11 | 255.255.255.0 |
Switch2 | VLAN 20 | 192.168.20.11 | 255.255.255.0 |
Switch3 | VLAN 30 | 192.168.30.11 | 255.255.255.0 |
Switch4 | VLAN 40 | 192.168.40.11 | 255.255.255.0 |
D. End Hosts IP Address Table:
Device Name | Interface ID | IPv4 Address | Subnet-Mask | VLAN | Default Gateway |
PC1 | Fa0 | 192.168.10.100 | 255.255.255.0 | 10 | 192.168.10.10 |
PC2 | Fa0 | 192.168.20.100 | 255.255.255.0 | 20 | 192.168.20.10 |
PC3 | Fa0 | 192.168.30.100 | 255.255.255.0 | 30 | 192.168.30.10 |
PC4 | Fa0 | 192.168.40.100 | 255.255.255.0 | 40 | 192.168.40.10 |
List of Command Summary:
Command | Command Description |
enable | enters privileged EXEC mode. |
configure terminal | enters global configuration mode from privileged EXEC mode. |
hostname [hostname] | assign a device name to router. |
switchport mode trunk | is used to configure an interface on a Cisco switch to operate in trunk mode. In trunk mode, the interface is capable of carrying traffic for multiple VLANs simultaneously. This command allows the interface to send and receive traffic with VLAN tags, enabling it to interconnect switches or routers and carry traffic for multiple VLANs across a single link. |
show interfaces [interface-ID] switchport | is used to display detailed information about the switchport configuration of a specific interface on a Cisco switch. It provides information such as the administrative and operational mode of the switchport, the VLAN membership of the switchport, trunking status, allowed VLANs, native VLAN, and other relevant details related to the switchport configuration. |
show interfaces trunk | displays information about trunk interfaces and their associated VLANs. It provides details about which interfaces are configured as trunk links, the encapsulation type (such as dot1Q), the operational status of the trunk, the allowed VLANs on the trunk, and the native VLAN. This command is useful for verifying trunk configurations and troubleshooting trunking issues on Cisco switches. |
vlan [vlan-id] | used to create a new VLAN with the specified VLAN ID. This command allows network administrators to segment the network into multiple virtual LANs (VLANs) for better traffic management and security. By assigning devices to different VLANs based on their network requirements, administrators can control broadcast domains, enforce security policies, and optimize network performance. |
switchport mode access | used on Cisco switches to configure an interface as an access port. Access ports are used to connect end devices, such as computers or printers, to the switch. When configured as an access port, the switch treats all incoming frames on that interface as belonging to the VLAN assigned to the port. This command disables dynamic trunking protocol (DTP) negotiation on the interface, ensuring that it operates only as an access port and does not participate in VLAN trunking. |
switchport access vlan [VLAN-ID] | used on Cisco switches to assign a specific VLAN to an access port. This command is typically used in conjunction with the “switchport mode access” command to configure an interface as an access port and specify the VLAN to which it belongs. By assigning a VLAN to an access port, the switch ensures that all incoming traffic on that port is tagged with the specified VLAN ID. This allows the switch to segregate traffic from different VLANs and control broadcast and multicast traffic within each VLAN. |
cdp enable | used to enable the Cisco Discovery Protocol (CDP) on a specific interface of a Cisco network device |
no cdp enable | used to disable the Cisco Discovery Protocol (CDP) on a specific interface of a Cisco network device |
cdp holdtime [seconds] | used to set the amount of time (in seconds) that a Cisco Discovery Protocol (CDP) advertisement is retained by a receiving device before being discarded |
cdp run | used to enable the Cisco Discovery Protocol (CDP) globally on a Cisco device |
no cdp run | used to disable the Cisco Discovery Protocol (CDP) globally on a Cisco device |
show cdp | used to display the current status and configuration of the Cisco Discovery Protocol (CDP) on a Cisco device Information Provided: CDP status: Indicates whether CDP is enabled or disabled globally.CDP timers: Displays the CDP advertisement and hold time intervals.CDP version: Specifies the version of CDP in use. |
show ip route | include 0.0.0.0 | used in network device command line interfaces (CLI) such as Cisco routers or switches. Let’s break it down: show ip route: This part of the command instructs the device to display its IP routing table. The routing table contains information about how IP packets should be forwarded based on their destination IP addresses.| (pipe symbol): This is a pipe operator used in command line interfaces to take the output of one command and use it as input for another command. In this case, it takes the output of the “show ip route” command and sends it as input to the next command.include: This is a filter option used to display only the lines of output that contain a specific keyword or pattern.0.0.0.0: This is a special IP address known as the default route or the gateway of last resort. In the context of routing tables, a route with the destination address 0.0.0.0 typically represents the default route, which is used when no more specific route matches the destination IP address of a packet. |
show cdp entry [* | hostname] | used to display detailed information about specific Cisco Discovery Protocol (CDP) neighbors on a Cisco device |
show cdp interface [interface-id] | used to display information about the Cisco Discovery Protocol (CDP) configuration and status on a specific interface of a Cisco device |
show cdp neighbors | used to display a summary of Cisco Discovery Protocol (CDP) neighbors discovered by a Cisco device |
show cdp neighbors detail | used to display detailed information about Cisco Discovery Protocol (CDP) neighbors discovered by a Cisco device |
show vlan brief | used on Cisco switches to display a summary of VLAN information. When you enter this command in the CLI interface of a Cisco switch, it provides a concise overview of the VLAN configuration on the switch. This includes details such as the VLAN ID, name, and interface membership status. The output of this command is often used to quickly verify the VLAN configuration and interface assignments on the switch. |
ipconfig /all | used in Windows operating systems to display detailed information about all network interfaces and their configurations. |
ip route destination-prefix destination-prefix-mask {ip-address | interface-type [ip-address]} | used to configure static routes in a Cisco device’s routing table. A static route manually specifies the next hop (IP address or interface) for packets destined for a particular network. The command helps define a static route in the routing table, directing packets destined for a specific network to a particular next hop or interface. Parameters: destination-prefix: The destination network IP address or prefix to which the static route applies.destination-prefix-mask: The subnet mask of the destination network, defining the network portion of the destination IP address.ip-address: The IP address of the next hop router to which packets should be forwarded.interface-type: The type of the interface (e.g., Ethernet, Serial) through which packets should be forwarded.[ip-address]: (Optional) Specifies the next hop IP address when specifying an interface type. |
no shutdown | enables an interface. |
show running-config | save the running configuration to the startup-configuration file. |
show running-config | section interface GigabitEthernet0/* | used to display the configuration details of a specific GigabitEthernet interface (interface GigabitEthernet0/) within the running configuration of a Cisco device. This command allows you to view the configuration settings related to the specified interface only, filtering out other configuration sections. It provides a focused view of the configuration parameters associated with the specified interface, including its IP address, VLAN membership, trunking settings, and any other relevant configuration details. The asterisk (*) is a wildcard character that matches any character or sequence of characters. In this context, it is used to match any subinterface under GigabitEthernet0. |
show running-config | section interface FastEthernet0/1$ | The “show running-config | section interface FastEthernet0/1$” command is similar to the previous one, but it focuses specifically on the FastEthernet0/1 interface. The “$” symbol at the end of the interface name indicates that the command will match only the interface that ends with “FastEthernet0/1”. This command is helpful when you want to view the configuration details of a specific FastEthernet interface without displaying configurations for other interfaces. |
copy running-config startup-config | used to save the currently running configuration (stored in the RAM) to the startup configuration (stored in the NVRAM) |
end | exit configuration mode. |
exit | exits one level in the menu structure command. |
Lab Task:
- VLAN and SVI Configurations:
- On Switch1 and Switch2:
- Create VLAN 10 and 20
- Name each VLAN with the appropriate department
- Configure SVI as per the SVI table above
- Verify the configuration
- On Switch3 and Switch4:
- Create VLAN 30 and 40
- Name each VLAN with the appropriate department
- Configure SVI as per the SVI table above
- Verify the configuration
- On Switch1 and Switch2:
- Trunk Configuration:
- On all Switches do the following:
- Configure the following on GigabitEthernet1/1/3
- Set the interface description to include which device is connected to
- Configure both interfaces to use static trunking
- Verify the configuration
- Configure the following on GigabitEthernet1/1/3
- On all Switches do the following:
- Access port configuration:
- On all switches:
- Assign gigabitEthernet1/0/1 interface with the appropriate VLAN Access, include an interface description as per department and force each port to operate in access mode
- Verify the step above with the appropriate commands
- On all switches:
- Router configuration:
- On Router1 and Router2 configure the following:
- Configure all connected interfaces with the appropriate IPv4 address and Subnet-Mask. Please add an interface description for each interface. Please refer back to the IPv4 address table
- Enable all connected interfaces
- On Router1: issue the appropriate commands to configure a static route to the 0.0.0.0/0 network through Router2’s gigabitEthernet0/0/0 interface’s IP address
- On Router2: issue the appropriate commands to configure a static route to the 0.0.0.0/0 network through Router1’s gigabitEthernet0/0/0 interface’s IP address
- Verify the above steps with the appropriate show commands
- On Router1 and Router2 configure the following:
- End host configuration:
- Configure the appropriate IP address on each PC from each department
- Verify that each PC has the appropriate IP address
- View CDP Neighbors on Switch1, Switch2 and Router1
- Disable CDP globally on Switch1
- On Switch1 verify that the CDP is disabled. Also verify this on Switch2 by issuing “show cdp neighbor” command, can you see Switch1? If so, you will need to wait until the hold time has expired
- Initiate a ping from Router1 to Switch1 SVI interface, is the ping successful?
- On Switch1 enable CDP globally
- On each Cisco Switch, disable CDP on each interface that is connected to an end host or Down
- On Router1 and Router2, disable CDP on interface gigabitEthernet0/0/0
- View CDP neighbor on Switch1 and Switch2, and observe the output
- View CDP neighbor on Router1 and Router2, and observe the output
- Connectivity test:
- Ping from PC1 to PC2, is the ping successful?
- Ping from PC1 to PC3, is the ping successful?
- Ping from PC1 to PC4, is the ping successful?
- Ping from PC3 to PC2, is the ping successful?
- If the ping is successful then go ahead and save the configuration. Else, use the troubleshoot steps below:
- Check VLAN configuration on each Switch
- Verify each port assignments to the VLAN in question
- Ensure Trunk links are properly configured
- Verify IP addressing and routing if applicable
- Verify Switch Connectivity
- Review Log Messages
Lab Solution:
1- VLAN and SVI Configurations:
a. On Switch1 and Switch2:
i. Create VLAN 10 and 20
ii. Name each VLAN with the appropriate department
iii. Configure SVI as per the SVI table above
Switch1:
Switch1#configure terminal
Switch1(config)#vlan 10
Switch1(config-vlan)#name “IT Department”
Switch1(config-vlan)#vlan 20
Switch1(config-vlan)#name “HR Department”
Switch1(config)#interface vlan 10
Switch1(config-if)#ip address 192.168.10.11 255.255.255.0
Switch2:
Switch2#configure terminal
Switch2(config)#vlan 10
Switch2(config-vlan)#name “IT Department”
Switch2(config-vlan)#vlan 20
Switch2(config-vlan)#name “HR Department”
Switch2(config)#interface vlan 20
Switch2(config-if)#ip address 192.168.20.11 255.255.255.0
iv. Verify the configuration:
show vlan brief
show ip int brief | inc lan
b. On Switch3 and Switch4:
i. Create VLAN 30 and 40
ii. Name each VLAN with the appropriate department
iii. Configure SVI as per the SVI table above
Switch3:
Switch3(config)#vlan 30
Switch3(config-vlan)#name “Sales Department”
Switch3(config-vlan)#vlan 40
Switch3(config-vlan)#name “Research Department”
Switch3(config-vlan)#inter vlan 30
Switch3(config-if)#ip address 192.168.30.11 255.255.255.0
Switch4:
Switch4(config)#vlan 30
Switch4(config-vlan)#name “Sales Department”
Switch4(config-vlan)#vlan 40
Switch4(config-vlan)#name “Research Department”
Switch4(config-vlan)#inter vlan 40
Switch4(config-if)#ip address 192.168.40.11 255.255.255.0
iv. Verify the configuration
show vlan brief
show ip int brief | inc lan
Common Reasons for SVI Showing as Up/Down:
- No Active Ports in the VLAN
- VLAN Not Created or Active
- SVI Shutdown
- Spanning Tree Protocol (STP) Blocking Ports
- Mismatched VLANs on Trunk Links
- Hardware Issues
2- Trunk Configuration:
a. On all Switches do the following:
i. Configure the following on GigabitEthernet1/1/3
1. Set the interface description to include which device is connected to
2. Configure both interfaces to use static trunking
Switch1:
Switch1#configure terminal
Switch1(config)#interface gigabitEthernet 1/1/3
Switch1(config-if)#switchport mode trunk
Switch1(config-if)#description “Link to Switch2”
Switch1(config-if)#
Switch2:
Switch2#configure terminal
Switch2(config)#interface gigabitEthernet 1/1/3
Switch2(config-if)#switchport mode trunk
Switch2(config-if)#description “Link to Switch1”
Switch2(config-if)#
Switch3:
Switch3#configure terminal
Switch3(config)#interface gigabitEthernet 1/1/3
Switch3(config-if)#switchport mode trunk
Switch3(config-if)#description “Link to Switch4”
Switch3(config-if)#
Switch4:
Switch4#configure terminal
Switch4(config)#interface gigabitEthernet 1/1/3
Switch4(config-if)#switchport mode trunk
Switch4(config-if)#description “Link to Switch3”
Switch4(config-if)#
3- Verify the configuration
show interfaces trunk
show running-config | section 1/1/3
show interfaces status
Note: Similar output would be found across Switch2, Switch3 and Switch4
3- Access port configuration:
a. On all switches:
i. Assign gigabitEthernet1/0/1 interface with the appropriate VLAN Access, include an interface description as per department and force each port to operate in access mode
Switch1:
Switch1#configure terminal
Switch1(config)#interface gigabitEthernet 1/0/1
Switch1(config-if)#description “Link to End Host”
Switch1(config-if)#switchport mode access
Switch1(config-if)#switchport access vlan 10
Switch1(config-if)#interface gigabitEthernet 1/1/1
Switch1(config-if)#description “Link to Router1”
Switch1(config-if)#switchport mode access
Switch1(config-if)#switchport access vlan 10
Switch1(config-if)#end
Switch1#
Switch2:
Switch2#configure terminal
Switch2(config)#interface gigabitEthernet 1/0/1
Switch2(config-if)#description “Link to End Host”
Switch2(config-if)#switchport mode access
Switch2(config-if)#switchport access vlan 20
Switch2(config-if)#interface gigabitEthernet 1/1/2
Switch2(config-if)#description “Link to Router1”
Switch2(config-if)#switchport mode access
Switch2(config-if)#switchport access vlan 20
Switch2(config-if)#end
Switch2#
Switch3:
Switch3#configure terminal
Switch3(config)#interface gigabitEthernet 1/0/1
Switch3(config-if)#description “Link to End Host”
Switch3(config-if)#switchport mode access
Switch3(config-if)#switchport access vlan 30
Switch3(config-if)#interface gigabitEthernet 1/1/1
Switch3(config-if)#description “Link to Router2”
Switch3(config-if)#switchport mode access
Switch3(config-if)#switchport access vlan 30
Switch3(config-if)#end
Switch3#
Switch4:
Switch4#configure terminal
Switch4(config)#interface gigabitEthernet 1/0/1
Switch4(config-if)#description “Link to End Host”
Switch4(config-if)#switchport mode access
Switch4(config-if)#switchport access vlan 40
Switch4(config-if)#interface gigabitEthernet 1/1/2
Switch4(config-if)#description “Link to Router2”
Switch4(config-if)#switchport mode access
Switch4(config-if)#switchport access vlan 40
Switch4(config-if)#end
Switch4#
ii. Verify the step above with the appropriate commands
show running-config | section 1/1/1$
show running-config | section 1/1/2$
show running-config | section 1/0/1$
show vlan brief
4- Router configuration:
a. On Router1 and Router2 configure the following:
i. Configure all connected interfaces with the appropriate IPv4 address and Subnet-Mask. Please add an interface description for each interface. Please refer back to the IPv4 address table
ii. Enable all connected interfaces
iii. On Router1: issue the appropriate commands to configure a static route to the 0.0.0.0/0 network through Router2’s gigabitEthernet0/0/0 interface’s IP address
iv. On Router2: issue the appropriate commands to configure a static route to the 0.0.0.0/0 network through Router1’s gigabitEthernet0/0/0 interface’s IP address
Router1:
Router1#configure ter
Router1#configure terminal
Router1(config)#interface gigabitEthernet 0/0/1
Router1(config-if)#description “Link to Switch1”
Router1(config-if)#no sh
Router1(config-if)#ip address 192.168.10.10 255.255.255.0
Router1(config-if)#interface gigabitEthernet 0/0/2
Router1(config-if)#description “Link to Switch2”
Router1(config-if)#no sh
Router1(config-if)#ip address 192.168.20.10 255.255.255.0
Router1(config-if)#interface gigabitEthernet 0/0/0
Router1(config-if)#description “Link to Router1”
Router1(config-if)#ip address 10.10.10.1 255.255.255.252
Router1(config-if)#no shut
Router1(config-if)#ip route 0.0.0.0 0.0.0.0 10.10.10.2
Router1(config)#
Router2:
Router2#configure terminal
Router2(config)#interface gigabitEthernet 0/0/1
Router2(config-if)#description “Link to Switch3”
Router2(config-if)#no sh
Router2(config-if)#ip address 192.168.30.10 255.255.255.0
Router2(config-if)#no sh
Router2(config-if)#inter gig 0/0/2
Router2(config-if)#description “Link to Switch4”
Router2(config-if)#ip address 192.168.40.10 255.255.255.0
Router2(config-if)#no sh
Router2(config-if)#interface gigabitEthernet 0/0/0
Router2(config-if)#description “Link to Router1”
Router2(config-if)#ip address 10.10.10.2 255.255.255.252
Router2(config-if)#no shut
Router2(config-if)#ip route 0.0.0.0 0.0.0.0 10.10.10.1
Router2(config)#end
Router2#
v. Verify the above steps with the appropriate show commands
show ip interface brief
show ip route | include 0.0.0.0
show running-config | section GigabitEthernet
5- End host configuration:
a. Configure the appropriate IP address on each PC from each department
Click on the PC in question -> Select Desktop -> IP Configuration ->
IP Configuration -> Static, as shown below:
b. Verify that each PC has the appropriate IP address
You can issue ipconfig command from the command prompt utility tool under Desktop option as shown below:
6- View CDP Neighbors on Switch1, Switch2 and Router1
You can issue this command to display the neighbors details
On Switch1:
On Switch2:
On Router1:
Explanation of Output Fields:
- Capability Codes: These codes indicate the capabilities of the neighboring devices. Some common codes include:
R: Router
S: Switch
H: Host
I: IGMP
r: Repeater
P: Phone - Device ID: This is the identifier of the neighboring device, usually the hostname or system name.
- Local Intrfce (Local Interface): The local interface on the current device through which the neighbor is discovered.
- Holdtme (Holdtime): The time (in seconds) that the CDP information for this neighbor will be retained. After this time, if no new CDP advertisements are received from the neighbor, the entry will be removed.
- Capability: This field shows the capabilities of the neighboring device using the codes listed above.
- Platform: This indicates the platform or model of the neighboring device.
- Port ID: The port or interface on the neighboring device that connects to the local device.
7- Disable CDP globally on Switch1:
To disable CDP globally you need to issue the following command:
Switch1#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Switch1(config)#no cdp run
Switch1(config)#
8- On Switch1 verify that the CDP is disabled. Also verify this on Switch2 by issuing “show cdp neighbor” command, can you see Switch1? If so, you will need to wait until the hold time has expired
You can issue the “show cdp neighbors command” on Switch1 to verify that CDP is turned off globally as shown below:
On the other hand, on Switch2 we can use the same command and observe the output shown below. You can see that the holdtme (Hold Time) is decreasing over time and eventually Switch1 entry gets removed from the CDP Table.
9- Initiate a ping from Router1 to Switch1 SVI interface, is the ping successful?
Yes ping is successful. Disabling CDP only stops the device from sending and receiving CDP packets, which are used for discovering and sharing information about directly connected Cisco devices. It does not affect the device’s IP-based communication capabilities.
10- On Switch1 enable CDP globally
11- On each Cisco Switch, disable CDP on each interface that is connected to an end host or Down
Switch1:
Switch1(config)#interface range gigabitEthernet 1/0/1-24, gigabitEthernet 1/1/2, GigabitEthernet1/1/4
Switch1(config-if-range)#no cdp enable
Switch1(config-if-range)#
Switch2:
Switch2(config)#interface range GigabitEthernet1/0/1-24, GigabitEthernet1/1/1, GigabitEthernet1/1/4
Switch2(config-if-range)#no cdp enable
Switch3:
Switch3(config)#interface range gigabitEthernet 1/0/1-24, GigabitEthernet1/1/2, GigabitEthernet1/1/4
Switch3(config-if-range)#no cdp enable
Switch4:
Switch4(config)#interface range GigabitEthernet1/0/1-24, gigabitEthernet 1/1/1, gigabitEthernet 1/1/4
Switch4(config-if-range)#no cdp enable
Switch4(config-if-range)#end
12- On Router1 and Router2, disable CDP on interface gigabitEthernet0/0/0
Router1:
Router1#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router1(config)#interface gigabitEthernet 0/0/0
Router1(config-if)#no cdp enable
Router1(config-if)#end
Router1#
Router2:
Router2#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router2(config)#interface gigabitEthernet 0/0/0
Router2(config-if)#no cdp enable
Router2(config-if)#end
Router2#
13- View CDP neighbor on Switch1 and Switch2, and observe the output
14- View CDP neighbor on Router1 and Router2, and observe the output
You can also use the “show cdp neighbors detail” for more granular information as shown below:
The “show cdp neighbors detail” command provides detailed information about neighboring Cisco devices discovered through the Cisco Discovery Protocol (CDP). Let’s break down the output of this command:
- Device ID: This field displays the hostname of the neighboring Cisco device.
- Local Interface: It shows the local interface on the current Cisco device through which the neighboring device was discovered.
- Holdtime: Holdtime represents the time, in seconds, for which the CDP information received from the neighboring device is valid before it’s considered stale. Once the holdtime expires, the CDP information is removed from the device’s CDP table.
- Capability: This field indicates the capabilities of the neighboring Cisco device. Common capabilities include “R” for Router, “S” for Switch, “H” for Host, “I” for IGMP-capable, “T” for Transparent bridge, and “B” for Source Route Bridge.
- Platform: It specifies the platform or model of the neighboring Cisco device. This could include details such as the device series or model number.
- Port ID: Port ID refers to the interface on the neighboring Cisco device through which it was discovered. It could display the interface name or number.
- Version: This field shows the software version running on the neighboring Cisco device. It includes details such as the IOS version or firmware version.
- Capabilities advertised by neighbor: This section provides additional information about the capabilities advertised by the neighboring Cisco device. It may include details such as the supported protocols or features.
- Management Addresses: This section displays the management IP addresses of the neighboring Cisco device. It provides information about how to access and manage the device remotely.
- VTP Management Domain: If the neighboring device supports VLAN Trunking Protocol (VTP), this field displays the VTP management domain name configured on the device.
- Native VLAN: For trunk interfaces, the native VLAN is specified in this field. It indicates the VLAN that is untagged on the trunk link.
- Duplex: This field indicates the duplex setting of the neighboring device’s interface (e.g., Full or Half).
- MTU: MTU (Maximum Transmission Unit) represents the maximum packet size supported on the neighboring device’s interface.
- Voice VLAN: If the neighboring device is configured with a Voice VLAN, this field displays the VLAN ID assigned for voice traffic.
15- Connectivity test:
g. Ping from PC1 to PC2, is the ping successful?
h. Ping from PC1 to PC3, is the ping successful?
i. Ping from PC1 to PC4, is the ping successful?
Ping from PC3 to PC2, is the ping successful?
16- If the ping is successful then go ahead and save the configuration
We can save the configuration by using “write memory” command or “copy running-config startup-config”
Note:
What is CDP?
Cisco Discovery Protocol (CDP) is a proprietary Layer 2 protocol developed by Cisco Systems. It is designed to help network administrators gather information about directly connected Cisco devices within a local network. CDP operates at the data link layer of the OSI model and is primarily used in Cisco networking equipment.
How does CDP work?
- Advertisement of Device Information: Cisco devices equipped with CDP capabilities periodically broadcast CDP messages to neighboring devices. These messages contain information about the sending device, such as its hostname, IP address, connected interfaces, and platform details.
- Discovery of Neighboring Devices: Upon receiving CDP messages, neighboring Cisco devices parse the information to identify the sender and gather details about its configuration. This allows network administrators to discover and inventory all directly connected Cisco devices on the network.
- Topology Discovery: CDP facilitates the discovery of the network topology by providing information about the connections between Cisco devices. Network administrators can use this information to map out the network and identify the physical and logical interconnections between devices.
- Monitoring and Troubleshooting: CDP provides valuable insights into the health and status of neighboring Cisco devices. By examining CDP messages, network administrators can monitor device uptime, interface status, and software versions. Additionally, CDP helps in troubleshooting network issues by providing visibility into device connectivity and configuration.
- Integration with Network Management Tools: CDP information can be leveraged by network management tools and applications to automate network management tasks, track device inventory, and monitor network performance. Integration with management platforms such as Cisco Prime Infrastructure allows for centralized management and monitoring of Cisco networks.
- Security Considerations: While CDP provides valuable information for network administration, it is essential to consider security implications. CDP messages contain sensitive device information that could potentially be exploited by attackers. Network administrators should implement security best practices, such as disabling CDP on untrusted interfaces or encrypting CDP messages in transit, to mitigate security risks.
Benefits of CDP:
- Simplified Network Management: CDP simplifies network management by providing automated device discovery and topology mapping, reducing the manual effort required for network administration tasks.
- Enhanced Visibility: CDP enhances visibility into the network by providing detailed information about neighboring Cisco devices, facilitating proactive monitoring and troubleshooting.
- Improved Efficiency: By automating device discovery and inventory management, CDP improves operational efficiency and reduces the time and effort required for network administration.
- Interoperability: CDP is supported across a wide range of Cisco devices, ensuring interoperability and consistency in network management across the Cisco ecosystem.
Disadvantages of CDP:
- Vendor Lock-in: CDP is a proprietary protocol specific to Cisco devices. Using CDP may result in vendor lock-in, limiting interoperability with non-Cisco networking equipment and proprietary features.
- Security Risks: CDP advertisements contain sensitive information about Cisco devices, such as their hostname and IP address. Attackers could potentially exploit this information for reconnaissance or targeted attacks. Network administrators should implement security best practices, such as limiting CDP exposure to trusted interfaces or encrypting CDP messages, to mitigate security risks.
- Network Overhead: CDP advertisements consume network bandwidth, especially in large-scale networks with numerous Cisco devices. The periodic transmission of CDP messages adds to network overhead, potentially impacting network performance and scalability.
- Limited Functionality with Non-Cisco Devices: While CDP is beneficial within Cisco environments, it may have limited functionality or compatibility with non-Cisco networking equipment. Organizations with heterogeneous network environments may encounter challenges when integrating CDP with non-Cisco devices or management platforms.
In conclusion, Cisco Discovery Protocol (CDP) is a valuable tool for discovering and managing Cisco devices within a network. By leveraging CDP, organizations can streamline network management tasks, enhance visibility, and improve overall network efficiency.
However, network administrators should be aware of potential disadvantages, such as vendor lock-in, security risks, network overhead, and limited interoperability with non-Cisco devices, when deploying CDP in their environments.
Conclusion:
In this lab, we explored the Cisco Discovery Protocol (CDP) and its significance in Cisco networking environments. Through hands-on exercises, we learned how to configure CDP on Cisco routers and switches, enabling them to advertise information about themselves and discover neighboring Cisco devices within a local network.
We began by configuring CDP globally on Cisco devices using the ‘cdp run’ command, allowing CDP to operate on all supported interfaces. We then verified CDP configuration and status using commands such as ‘show cdp’, ‘show cdp neighbors’, and ‘show cdp neighbors detail’, which provided detailed information about neighboring Cisco devices and their connections.
By examining CDP advertisements, we gained insights into device types, hostnames, IP addresses, platform types, and interface connections of neighboring Cisco devices. This information proved invaluable for network discovery, topology mapping, monitoring, and troubleshooting purposes.
Through this lab, we developed essential skills in configuring and verifying CDP protocol, laying a strong foundation for network administrators pursuing their CCNA certification. Understanding CDP and its operation is crucial for managing Cisco networks effectively, ensuring optimal performance, security, and reliability.
Packet Tracer Lab (Pre/Post configuration):
Download the file below and open the word document to access the Packet Tracer labs.