Config Lab: CDP/LLDP 1

 In 200-301 V2 Ch13: Device Management, 200-301 V2 Part 4: IP Services, 200-301 V2 Parts, Config Lab, Config Lab CCNA Vol 2 Part 3, Hands-on

#CDP has long been the default and favored protocol for a variety of device discovery functions, but LLDP offers an alternative as well. (LLDP is new to the exam topics per the May 2016 new CCENT and CCNA R&S exams.) Both are supported in Cisco routers and switches, with similar configuration. This lab asks you to work through the commands to enable and disable both CDP and LLDP for the sake of exercising your CLI config skills with these protocols.

All about Config Labs

The blog has a series of lab exercises called “Config Labs.” Each lab presents a topology with the relevant initial configuration for each device. The lab also lists new requirements, after which you should create the additional configuration to meet those requirements. You can do the lab on paper, in a text editor, or use software tools like Cisco Packet Tracer or Cisco Modeling Labs.

Once you have created your answer, you can click various tabs at the bottom of this post to see the lab answers, comments about the lab, and other helpful information.

The Lab Exercise

Requirements

Configure CDP and LLDP in the topology shown in the figure. In particular, use CDP only in the top part of the topology, and LLDP only in the bottom part. The specific rules for this lab are:

  • Use only CDP on the R1 and R2 G0/2 interfaces
  • Use only LLDP on the R1 and R2 G0/1 interfaces
  • Use only CDP on switch SW1
  • Use only LLDP on switch SW2, R3, and R4
  • Assume all device interfaces shown in the lab are up and working

Figure 1: Device Discovery Topology

 

Initial Configuration

Examples 1 through 6 show the beginning configuration state of the four routers and the two switches.

hostname R1
!
interface GigabitEthernet0/1
 no shutdown
!
interface GigabitEthernet0/2
 no shutdown

Example 1: R1 Config

 

hostname R2
!
interface GigabitEthernet0/1
 no shutdown
!
interface GigabitEthernet0/2
 no shutdown

Example 2: R2 Config

 

hostname R3
!
interface GigabitEthernet0/1
 no shutdown

Example 3: R3 Config

 

hostname R4
!
interface GigabitEthernet0/1
 no shutdown

Example 4: R4 Config

 

hostname SW1
!
interface GigabitEthernet0/1
 no shutdown
!
interface GigabitEthernet0/2
 no shutdown

Example 5: SW1 Config

 

hostname SW2
!
interface GigabitEthernet0/1
 no shutdown
!
interface GigabitEthernet0/2
 no shutdown
!
interface GigabitEthernet0/3
 no shutdown
!
interface GigabitEthernet1/0
 no shutdown

Example 6: SW2 Config

Answer Options - Click Tabs to Reveal

You can learn a lot and strengthen real learning of the topics by creating the configuration – even without a router or switch CLI. In fact, these labs were originally built to be used solely as a paper exercise!

To answer, just think about the lab. Refer to your primary learning material for CCNA, your notes, and create the configuration on paper or in a text editor. Then check your answer versus the answer post, which is linked at the bottom of the lab, just above the comments section.

You can also implement the lab using the Cisco Packet Tracer network simulator. With this option, you use Cisco’s free Packet Tracer simulator. You open a file that begins with the initial configuration already loaded. Then you implement your configuration and test to determine if it met the requirements of the lab.

(Use this link for more information about Cisco Packet Tracer.)

Use this workflow to do the labs in Cisco Packet Tracer:

  1. Download the .pkt file linked below.
  2. Open the .pkt file, creating a working lab with the same topology and interfaces as the lab exercise.
  3. Add your planned configuration to the lab.
  4. Test the configuration using some of the suggestions below.

Download this lab’s Packet Tracer File

You can also implement the lab using Cisco Modeling Labs – Personal (CML-P). CML-P (or simply CML) replaced Cisco Virtual Internet Routing Lab (VIRL) software in 2020, in effect serving as VIRL Version 2.

If you prefer to use CML, use a similar workflow as you would use if using Cisco Packet Tracer, as follows:

  1. Download the CML file (filetype .yaml) linked below.
  2. Import the lab’s CML file into CML and then start the lab.
  3. Compare the lab topology and interface IDs to this lab, as they may differ (more detail below).
  4. Add your planned configuration to the lab.
  5. Test the configuration using some of the suggestions below.

Download this lab’s CML file!

 

Network Device Info:

This table lists the interfaces used in the lab exercise documentation that differ from those used in the sample CML file.

Device Lab Port  CML Port
SW2 G1/0/1 G0/1
SW2 G1/0/2 G0/2
SW2 G1/0/3 G0/3
SW2 G1/0/4 G1/0

Lab Answers Below: Spoiler Alert

Lab Answers: Configuration (Click Tab to Reveal)

Answers

Figure 1: Device Discovery Topology

lldp run
!
interface GigabitEthernet0/1
 no cdp enable
!
interface GigabitEthernet0/2
 no lldp transmit
 no lldp receive

Example 1: R1 Config

 

lldp run
!
interface GigabitEthernet0/1
 no cdp enable
!
interface GigabitEthernet0/2
 no lldp transmit
 no lldp receive

Example 2: R2 Config

 

no cdp run
lldp run

Example 3: R3 Config

 

no cdp run
lldp run

Example 4: R4 Config

 

no cdp run
lldp run

Example 5: SW2 Config

Commentary, Issues, and Verification Tips (Click Tabs to Reveal)

Commentary

The default behavior of all Cisco devices is to have the Cisco Discovery Protocol (CDP) enabled on all interfaces. This behavior works well as long as the other deployed equipment in the network is either from Cisco or from a vendor that supports CDP. However, in cases where the connected device happens to use the standards-based Link Layer Discovery Protocol (LLDP), you need to disable CDP and enable LLDP.

For this lab, you were tasked with several configuration tasks that test your ability to configure different variations of CDP and LLDP; the specific order of the configuration is subjective.

On R1 and R2, the first task to configure is to enable LLDP globally with the lldp run global command. Then to run CDP only on some interfaces and LLDP only on other interfaces, you need to use some interface subcommands. Specifically, to disable CDP on their G0/1 interfaces, use the no cdp enable interface subcommand. LLDP uses a slightly different command; to disable LLDP on the R1 and R2 G0/2 interfaces, use both the no lldp transmit and no lldp receive interface subcommands.

For R3 and R4, because both use LLDP only, you can disable CDP completely and enable LLDP on all interfaces. First, to disable CDP globally, configure the no cdp run global command. Then, to enable LLDP globally, which automatically enables LLDP for both transmit and receive on all interfaces, configure the lldp run global command.

Next, consider the switches. Switch SW1 needs only default configuration, with CDP enabled globally, and LLDP disabled globally, so no new configuration is needed. Example 11 shows the configuration needed on switch SW2 to reverse those settings so that SW2 runs LLDP but not CDP.

Known Issues in this Lab

This section of each Config Lab Answers post hopes to help with those issues by listing any known issues with Packet Tracer related to this lab. In this case, the issues are:

# Summary Detail
1 None No known issues related to this lab.

 

Why Would Cisco Packet Tracer Have Issues?

(Note: The below text is the same in every Config Lab.)

Cisco Packet Tracer (CPT) simulates Cisco routers and switches. However, CPT does not run the same software that runs in real Cisco routers and switches. Instead, developers wrote CPT to predict the output a real router or switch would display given the same topology and configuration – but without performing all the same tasks, an actual device has to do. On a positive note, CPT requires far less CPU and RAM than a lab full of devices so that you can run CPT on your computer as an app. In addition, simulators like CPT help you learn about the Cisco router/switch user interface – the Command Line Interface (CLI) – without having to own real devices.

CPT can have issues compared to real devices because CPT does not run the same software as Cisco devices. CPT does not support all commands or parameters of a command. CPT may supply output from a command that differs in some ways from what an actual device would give. Those differences can be a problem for anyone learning networking technology because you may not have experience with that technology on real gear – so you may not notice the differences. So this section lists differences and issues that we have seen when using CPT to do this lab.

Beyond comparing your answers to this lab’s Answers post, you can test in Cisco Packet Tracer (CPT) or Cisco Modeling Labs (CML). In fact, you can and should explore the lab once configured. For this lab, once you have completed the configuration, try these verification steps. 

  1. Connect to any of the routers and display the LLDP and CDP neighbors. Use commands like show cdp neighbors, show lldp neighbors, show cdp interfaces, and show lldp interfaces. For instance, R1 should see SW1 as a neighbor with CDP and SW2 as a neighbor with LLDP. SW2 should see R1, R2, R3, and R4 as a neighbor with LLDP.

More Labs with Related Content!

Config Lab: DAI 1
Config Lab: NTP Client/Server
Subscribe
Notify of
guest

28 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Erik

Hi,

Just one typo in Example 6 SW2 Config: hostname SW1 global configuration command should reference “SW2”.

certskills

Agreed, and fixed. Thanks for the heads up.
Wendell

almeidajoaodealmeida

Hi,
I see that lldp was enabled globally, couldn’t it be possible to enable it per interface by using
lldp receive
lldp transmit, commands ?

Wendell Odom (@Wendellodom)

Sure, no problem.

almeidajoaodealmeida

Hello Mr Odom,
Just one typo on the last requirement, R4 was referenced twice.

Elton

Hello, Master Odom, I was a bit confused, including reading the comments: Is it possible to just disable the CDP protocol that is enabled by default on Cisco devices and some manufacturers, and use, in specific interfaces, the commands per interface?

Example:

lldp transmit / lldp receive

enable cdp.

Why use the “no cdp enable” or “no lldp transmit/receive” command on interfaces where these commands have never been enabled before?

ERMUNDO C RUSSELL

Hey Wendell,

The show lldp interfaces global command does not appear to be available in CPT using the layer 3650-24ps model layer 3 switch assigned to (SW2) in this topology. It is available in the 2911 routers in use but it is not available in the layer 2 switch assigned to (SW1) in this topology as well. You may need to add this to the known packet tracer issues tab. Just FYI.

Tewa

Hello Wendell,

Pleaser a question.. I need clarification about CDP broadcast messages. You indicated in the textbook – Vol 2 page 191 that “To ensure all devices receive a CDP message, the Ethernet header uses a multicast destination MAC address (0100.0CCC.CCCC).” My interpretation of this sentence is that all devices on the local link will receive this message when sent to the multicast address. My confusion stems from the fact that the CDP message broadcast by R1 in Figure 9-8 will not be received by SW1 which appears to be on the local link. Why is that? Are multicast messages not meant to be received by all hosts on the local link?

Sana

Hello,

I’m trying to do this for R1

interface g0/1
no cdp enable
lldp transmit
lldp receive

but after disabling cdp without even configuring lldp commands , the show command
result on this interface is still showing that cdp is enabled .why is that?

Also, what if we don’t configure anything on g0/2 interfaces(as cdp is enabled already by default)?

Sana

Thanks for explaination
if im using the lldp transmit and lldp receive commands ,instead of global lldp run command that would not enable lldp globally .please correct if wrong.

the show cdp int command shows that cdp is enabled on g0/2
but i think pkt tracer dont hav show lldp int command so i tried show lldp neighbours and it shows that lldp is not enabled and i thought to enable lldp only per interface so i used the transmit and receive for g0/1

Arsalan

Hi sana, yes I got the same issue as yours in packet tracer, so it seems like CPT issue

Sana

i think in order to use lldp transmit and recieve commands first we need to enable lldp globally then issue the transmit receive or no transmit receive per interface because lldp is not enabled by default.so first we need to enable the lldp service and then disable or enable per interface .
everything was fine for cdp as it is enabled by default on cisco devices i guess.
didn’t got the concept before…

Jay

So just to clarify, does this configuration alone (and no global or g0/2 commands) meet the requirements of the lab for R1 and R2?

R2(config)#int g0/1
R2(config-if)#no cdp enable
R2(config-if)#lldp transmit
R2(config-if)#lldp receive

Thank you!

Mizael

Greetings Mr.Wendell!
Hopefully you can shed some light and clarify this question regarding the interaction between global and interface commands. The “lldp run” global command enables LLDP on the entire switch. By “enabling” does that mean that the device starts generating LLDP advertisement messages plus sending/receiving them as soon as the global command it’s issued? Or is it more like a “LLDP messages are ready to be sent/received, but cannot be sent/received until the interface commands are issued.” Where I’m going with this if BOTH global and interface commands are needed together for LLDP to properly function? Or can you do one without the other? EG not issuing the global command but ONLY issuing “lldp transmit” and “lldp receive” on their own and expect the device to send and receive LLDP messages?
Will the same logic apply for CDP as well? (Both global and interface commands are needed for CDP to properly function, or can you just do one or the other?)

Thanks a lot!

wendell

Hey Mizael,
Good to hear from you!
I think this one example will clear your question.
Take a switch with all default settings. LLDP is off on all ports.
Add the global command “lldp run”.
LLDP is now on, both directions on all ports

More formally, “lldp run” changes the global setting, that is, the setting applied to an interface with no LLDP subcommands. The logic applied to such interfaces is to enable LLDP in both directions.

Clearer?

Last edited 2 months ago by Wendell Odom
wendell

In case you read this in email subscription… so sorry, I typoed “now” as “not”, which made my explanation incorrect… I hope you came here to read the corrected version!!!

Mizael

I came to the right place 👍, thanks for the correction. Yes that clears it very well regarding the global command’s function/logic. I think what raised the other question/confusion was the “regardless” word in the following explanation for command “lldp transmit” (same for receive) (key topic vol. 2 pg 290) “an interface subcommand that defines the operation of LLDP on the interface REGARDLESS of the global [no] lldp run command” so that made me wondered if for example, I log in into a device with LLDP disabled globally, and say I wanted to enable LLDP on just one specific interface only, could I just issue the interface subcommands “lldp transmit” and “lldp receive” and skip the global command?

wendell

You’re welcome!

To your latest, short answer is “yes”.

Regardless of the global setting, the interface config takes precedence.

Hope this helps,
Wendell

Mizael

Thank you! After breaking things, messing around and toggling multiple things on/off in lab, I found out some interesting things. (Hopefully future CCNA candidates benefit from this in the future here in your blog) This applied to both CDP/LLDP. (I just really hope most of this mirrors real gear!)
*The global commands are absolutely necessary for both protocols to work. (Which of course matched the configuration in the lab’s answers) If they are disabled globally, and you only try to use interface subcommands, the protocol just won’t work. (In fact, if LLDP/CDP are disabled globally, and you issue interface subcommands only, IOS will accept them but won’t even add them to the running-config, and the device won’t be added to other device’s CDP/LLDP neighbor tables until the protocol is enabled globally)
*The global commands also unlock all show commands related to each protocol. If the protocol is globally disabled, the show commands won’t work.
*Basically, the interface subcommands are used to “fine-tune” the configuration to match the needs, and just like you said, for example LLDP interface subcommands will override the global command (for that interface only)
I probably overcomplicated things more than I needed to, but your awesome lab design helped me with my debuts. Thanks a lot!
PS: On the DAI lab blog page I had a quick question, hopefully you can take a look when if you get a free minute. Thanks!

wendell

Sorry, it finally hit me.You’re asking about behavior IN PACKET TRACER, right? I was answering for behavior IN REAL DEVICES. Understood now. Thanks for posting what you saw in Packet Tracer. I’ll try and do some experiments with it as well and update the known issues tab in the lab.

Mizael

Oh man! I guess I should have started by mentioning I was basing everything off Packet Tracer from the start. Will definitely mention that from now on haha, sorry about that! (Also, if you could check out my post on that DAI blog page, I would really appreciate it! Thanks a lot Mr. Wendell!)

Matt

i cant seem to get lldp transmit or receive commands to work on switch 2. Not that they are needed for this lab but curious if they should work on that switch?

Contact Us

We're not around right now. But you can send us an email and we'll get back to you, asap.

28
0
Would love your thoughts, please comment.x
()
x