Link Local Discovery Protocol (LLDP) is an Open Standard Layer-2 protocol that is used by servers and network devices to advertise their identity and capabilities to other device, by directly connected devices. This standard is defined in IEEE 802.1AB. The information is sent via lldp-enabled interfaces, as Ethernet frame, over fixed interval. These frames contain LLDPDS (Link Local Discovery Protocol Data Unit) in a Type-Length-Value (TLV) format.

LLPDS include a wide range of information from hostname, description, and port name etc. Using LLPD can be very useful as you will be able to find out what devices are directly connected to a switch without having the joy of going cable tracking, and it’s useful for troubleshooting. With that in mind, this post will go into how you would enable LLDP on a Juniper and Cisco switch, and how to enable on Ubuntu 14.04LTS.

Let’s get cracking!

For my set up I’ve got ESXi host running Ubuntu 14.04LTS. It has three vNICs; one is connected to the OOB Cisco 3750G switch and other two connections go into a Virtual Chassis Juniper EX4200

Firstly enable lldp on your network device:

For a Juniper device set protocols lldp interface all and for a Cisco device lldp run or for CDP, under the interface you will need to run cdp enable (CDP is Cisco’s proprietary link discovery protocol)

You’ll need to install the LLDP and SNMP packages onto the server:

sudo apt-get install lldpd snmp

You’ll need to start both of the processes to get them up and running:

sudo service lldpd restart
sudo service snmpd restart

Once you’ve started these you’ll have both enabled on your server, and you’ll have LLDP configured! Nice and simple :)

To confirm everything is working as expected, you can run a show command on switches and the server for verification:

On the Juniper EX4200 show lldp neighbors, shows the 2 server NICs connected to each member

root@EX4200-A> show lldp neighbors 
Local Interface    Parent Interface    Chassis Id          Port info          System Name
ge-0/0/2.0         - 00:0c:29:4f:26:bb   eth1               km-vm1              
ge-1/0/2.0         - 00:0c:29:4f:26:bb   eth2               km-vm1              
vme.0              - 00:19:06:cd:8f:80   GigabitEthernet1/0/36 oob-sw0-10.lab

On the Cisco 3750G show lldp neighbors, show the 2 ESXi hosts connected using the switch for Out of Band.

oob-sw0-10.lab#show lldp neighbors g1/0/48
Capability codes:
    (R) Router, (B) Bridge, (T) Telephone, (C) DOCSIS Cable Device
    (W) WLAN Access Point, (P) Repeater, (S) Station, (O) Other

Device ID           Local Intf     Hold-time  Capability      Port ID
km-vm2              Gi1/0/48       120                        000c.29d3.ac6d
km-vm1              Gi1/0/48       120                        000c.294f.26bb

On the server, lldpcli show neighbors, shows all Cisco and Juniper switches and the other ESXi host shared the OOB NIC

marquk01@km-vm1:~$ lldpcli show neighbors
-------------------------------------------------------------------------------
LLDP neighbors:
-------------------------------------------------------------------------------
Interface:    eth0, via: LLDP, RID: 1, Time: 0 day, 22:19:29
  Chassis:     
    ChassisID:    mac 00:0c:29:d3:ac:77
    SysName:      km-vm2
    SysDescr:     Ubuntu 14.04.2 LTS Linux 3.16.0-30-generic #40~14.04.1-Ubuntu SMP Thu Jan 15 17:43:14 UTC 2015 x86\_64
    MgmtIP:       10.1.0.141
    MgmtIP:       2001:41c1:4:8040:20c:29ff:fed3:ac6d
    Capability:   Bridge, off
    Capability:   Router, off
    Capability:   Wlan, off
  Port:        
    PortID:       mac 00:0c:29:d3:ac:6d
    PortDescr:    eth0
-------------------------------------------------------------------------------
Interface:    eth0, via: LLDP, RID: 2, Time: 0 day, 22:19:11
  Chassis:     
    ChassisID:    mac 00:19:06:cd:8f:80
    SysName:      oob-sw0-10.lab
    SysDescr:     Cisco IOS Software, C3750 Software (C3750-IPSERVICESK9-M), Version 15.0(1)SE, RELEASE SOFTWARE (fc1)
Technical Support: http://www.cisco.com/techsupport
Copyright (c) 1986-2011 by Cisco Systems, Inc.
Compiled Wed 20-Jul-11 09:32 by prod\_rel\_team
    MgmtIP:       10.1.0.4
    Capability:   Bridge, on
    Capability:   Router, off
  Port:        
    PortID:       ifname Gi1/0/48
    PortDescr:    GigabitEthernet1/0/48
-------------------------------------------------------------------------------
Interface:    eth1, via: LLDP, RID: 6, Time: 0 day, 00:02:58
  Chassis:     
    ChassisID:    mac 40:a6:77:5f:60:00
    SysName:      EX4200-A
    SysDescr:     Juniper Networks, Inc. ex4200-48t , version 12.3R5.7 Build date: 2013-12-18 03:01:12 UTC 
    MgmtIP:       10.1.0.243
    Capability:   Bridge, on
    Capability:   Router, on
  Port:        
    PortID:       local 503
    PortDescr:    KM-VM-1
-------------------------------------------------------------------------------
Interface:    eth2, via: LLDP, RID: 6, Time: 0 day, 00:03:01
  Chassis:     
    ChassisID:    mac 40:a6:77:5f:60:00
    SysName:      EX4200-A
    SysDescr:     Juniper Networks, Inc. ex4200-48t , version 12.3R5.7 Build date: 2013-12-18 03:01:12 UTC 
    MgmtIP:       10.1.0.243
    Capability:   Bridge, on
    Capability:   Router, on
  Port:        
    PortID:       local 661
    PortDescr:    KM-VM-1
-------------------------------------------------------------------------------

You can see detailed information and additional commands that can be run using lldpcli, on the man pages or via Ubuntu documentation

Share on LinkedIn
Share on Reddit