LLDP (Link Local Discovery Protocol) 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:
[email protected]1:~$ sudo apt-get install lldpd snmp
You’ll need to start both of the processes to get them up and running:
[email protected]:~$ sudo service lldpd restart [email protected]:~$ 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
On the Cisco 3750G show lldp neighbors, show the 2 ESXi hosts connected using the switch for Out of Band.
On the server, lldpcli show neighbors, shows all Cisco and Juniper switches and the other ESXi host shared the OOB NIC
You can see detailed information and additional commands that can be run using lldpcli, on the man pages or via Ubuntu documentation