CDP and LLDP configuration 2

Topology

Tasks:

A company has a network core consisting of four switches (SW1, SW2, SW3, and SW4) interconnected to form a robust network backbone. These core switches need to discover each other using Cisco Discovery Protocol (CDP) but also need to use Link Layer Discovery Protocol (LLDP) to discover PCs connected to their access ports.

  1. The company wants CDP to be enabled globally (currently disabled).
  2. Make sure that  core switches cannot discover the endpoint devices using CDP.
  3. LLDP will be enabled globally to allow the switches to discover endpoint devices.
  4. Make sure that switches cannot discover each other using LLDP.

Solution:

Task 1: The company wants CDP to be enabled globally (currently disabled).

CDP is disabled on the switches by default. Enable CDP using cdp run command.

On SW1:

SW1#configure terminal
SW1(config)#cdp run

On SW2:

SW2#configure terminal
SW2(config)#cdp run

On SW3:

SW3#configure terminal
SW3(config)#cdp run

On SW4:

SW4#configure terminal
SW4(config)#cdp run

 

Task 2: Make sure that endpoint devices cannot discover the core switches using CDP.

Endpoint devices are the PCs connected to the switches. By using the no cdp enable command to disable CDP on the FastEthernet0/4 interface (connected to a PC) on each switch, they will be unable to discover the PCs using CDP.

On SW1:

SW1(config)#interface f0/4
SW1(config-if)#no cdp enable
SW1(config-if)#exit

On SW2:

SW2(config)#interface f0/4
SW2(config-if)#no cdp enable
SW2(config-if)#exit

On SW3:

SW3(config)#interface f0/4
SW3(config-if)#no cdp enable
SW3(config-if)#exit

On SW4:

SW4(config)#interface f0/4
SW4(config-if)#no cdp enable
SW4(config-if)#exit

 

Task 3: LLDP will be enabled globally to allow the switches to discover endpoint devices.

LLDP is disabled by default on Cisco switches. LLDP is enabled by using lldp run command

On SW1:

SW1(config)#lldp run

On SW2:

SW2(config)#lldp run

On SW3:

SW3(config)#lldp run

On SW4:

SW4(config)#lldp run

 

Task 4: Make sure that switches cannot discover each other using LLDP.

For this we have to disable LLDP on the interfaces connecting the core switches.

On SW1:

SW1(config)#interface range f0/1-3
SW1(config-if)#no lldp transmit
SW1(config-if)#no lldp receive
SW1(config-if)#exit

On SW2:

SW2(config)#interface range f0/1-3
SW2(config-if)#no lldp transmit
SW2(config-if)#no lldp receive
SW2(config-if)#exit

On SW3:

SW3(config)#interface range f0/1-3
SW3(config-if)#no lldp transmit
SW3(config-if)#no lldp receive
SW3(config-if)#exit

On SW4:

SW4(config)#interface range f0/1-3
SW4(config-if)#no lldp transmit
SW4(config-if)#no lldp receive
SW4(config-if)#exit

The interface range f0/1-3 command allows us to configure the interfaces collectively which can save a lot of time. The no lldp transmit command disables LLDP transmission on the interfaces, and no lldp receive disables LLDP reception on the interfaces. Together, these commands effectively disable LLDP on the interfaces.

Now exit the configuration mode and save the configuration.

SW1(config)#end
SW1#write memory

SW2(config)#end
SW2#write memory

SW3(config)#end
SW3#write memory

SW4(config)#end
SW4#write memory

 

Packet Tracer File

Clicking this button will begin the download of a ZIP file. Inside the ZIP file, you'll find a Packet Tracer Activity (.pka) file, which will automatically track your progress as you configure the network.