LLDP

This chapter describes how to configure LLDP and how to display LLDP neighbors.

Overview

LLDP is a vendor neutral layer 2 protocol.

LLDP allows a network device to:

  • advertise its identity and capabilities on the local network,
  • receive the same information from a physically adjacent layer 2 peer.

Typically, LLDP uses Ethernet as its transport protocol. The Ethernet type for LLDP is 0x88cc.

LLDP information is sent by devices in the form of an Ethernet frame. Each frame contains one LLDP Data Unit (LLDPDU). Each LLDPDU is a sequence of type-length-value (TLV) structures.

LLDP context

All commands for configuring LLDP have to be typed in the lldp context.

Displaying LLDP configuration

To display information about LLDP, enter:

router{conf:myconfig-lldp}display

or

router{conf:myconfig}display lldp

Example

router{conf:myconfig-lldp}display
    # LLDP ENABLE
      lldp enable
    # LLDP HOSTNAME
      hostname router
    # LLDP DESCRIPTION
      description Router
    # LLDP MGMTIP
      management-ip 10.80.*
    # LLDP INTERFACES
      interfaces eth1_0,eth2_0
    # LOG SERVICE
      log lldp session1 info

Enabling and disabling LLDP

You can enable or disable LLDP by using respectively the two following commands in the lldp context:

router{conf:myconfig-lldp}lldp enable
router{conf:myconfig-lldp}lldp disable

By default, LLDP is disabled.

System description

The description string will be included in LLDP packet as a single TLV structure. By default, the LLDP system description is a string concatenation of kernel name, node name, kernel version, build date and architecture.

To configure your own LLDP system description, use the following command:

router{conf:myconfig-lldp}description default|DESCRIPTION
default
Description is the default string including kernel name, node name, kernel version, build date and architecture (e.g., Linux 3.10.20 #127 SMP Fri Jan 16 16:20:45 CST 2015 x86_64).
DESCRIPTION
Custom system description (maximum length: 255 characters).

LLDP hostname

This string will be included in the LLDP packet as a single TLV structure. By default, the LLDP hostname is the same as the system hostname configured in the gen context.

To configure your own LLDP hostname, use the following command:

router{conf:myconfig-lldp}hostname default|NAME
default
System hostname configured in the gen context.
NAME
Custom LLDP hostname (maximum length: 31 characters).

Interfaces pattern

The interfaces pattern specifies which interfaces LLDP will listen to.

To configure the pattern, use the following command:

router{conf:myconfig-lldp}interfaces default|PATTERN
default
All available physical interfaces will be used.
PATTERN
Several patterns can be defined, each pattern is separated by commas. Wildcards, blacklists and whitelists may be used. For example: eth1_0 or eth1_0,eth2_0 or !eth*,!!eth1_0,!!eth2_0

Management IP pattern

Specify the management addresses of the local device.

To configure the pattern, use the following command:

router{conf:myconfig-lldp}management-ip default|PATTERN
default
The first IPv4 and IPv6 addresses will be used.
PATTERN
Several patterns can be defined, each pattern is separated by commas. Wildcards, blacklists and whitelists may be used. For example: 192.168.1.1 or 192.168.1.1,192.168.2.* or 192.168.*,!192.168.1.*,!!192.168.1.1

Log configuration

To log and stop logging events from LLDP, use the following commands:

router{conf:myconfig-lldp}log lldp SESSION SEVERITY
router{conf:myconfig-lldp}delete log lldp SESSION
SESSION
Name of an existing log session
SEVERITY
System logging severity level

Showing LLDP neighbors

Display information about each neighbor known by LLDP. The information includes system hostname, system description, management IP, port name and port Mac of remote interface, etc.

To show LLDP neighbors, use the following command:

router{}show lldp neighbors [interface ethX] [raw]
ethX
Optional. Ethernet port name. The information displayed is limited to the given interface.
raw
Optional. All available information will be displayed, giving a verbose view.

Example

pere{}show lldp neighbors
LLDP neighbors:
Interface: eth1_0
  SysName:        pom
  SysDescr:       Linux 3.10.20 #2 SMP Wed Jan 21 10:53:58 CST 2015 x86_64
  RemotePort:     eth1_0
  RemotePortMAC:  00:19:0f:10:71:c1
Interface: eth0_0
  SysName:        PVST-Test
  SysDescr:       Cisco IOS Software, C2960 Software, Version 15.0(2)SE3
  MgmtIP:         192.168.100.2
  RemotePort:     FastEthernet0/8


pere{}show lldp neighbors raw
-------------------------------------------------------------------------------
LLDP neighbors:
-------------------------------------------------------------------------------
Interface:    eth1_0, via: LLDP, RID: 1, Time: 0 day, 00:01:10
  Chassis:
    ChassisID:    mac 00:19:0f:10:71:c1
    SysName:      pom
    SysDescr:     Router
    Capability:   Bridge, off
    Capability:   Router, on
    Capability:   Wlan, off
    Capability:   Station, on
  Port:
    PortID:       mac 00:19:0f:10:71:c1
    PortDescr:    eth1_0
    PMD autoneg:  supported: yes, enabled: yes
      Adv:          10Base-T, HD: yes, FD: yes
      Adv:          100Base-TX, HD: yes, FD: yes
      Adv:          1000Base-T, HD: no, FD: yes
      MAU oper type: 1000BaseTFD - Four-pair Category 5 UTP, full duplex mode
-------------------------------------------------------------------------------
Interface:    eth0_0, via: LLDP, RID: 2, Time: 0 day, 00:01:08
  Chassis:
    ChassisID:    mac 00:1b:53:95:e1:00
    SysName:      PVST-Test
    SysDescr:     Cisco IOS Software, C2960 Software, Version 15.0(2)SE3
                  Technical Support: http://www.cisco.com/techsupport
                  Copyright (c) 1986-2013 by Cisco Systems, Inc.
                  Compiled Fri 24-May-13 05:45 by prod_rel_team
    MgmtIP:       192.168.100.2
    Capability:   Bridge, on
  Port:
    PortID:       ifname Fa0/8
    PortDescr:    FastEthernet0/8
    PMD autoneg:  supported: yes, enabled: yes
      Adv:          10Base-T, HD: yes, FD: yes
      Adv:          100Base-TX, HD: yes, FD: yes
      MAU oper type: 100BaseTXFD - 2 pair category 5 UTP, full duplex mode
  VLAN:         1, pvid: yes
-------------------------------------------------------------------------------