Configuring LLDP

LLDP Overview

LLDP (Link Layer Discovery Protocol) is a Layer 2 discovery protocol defined in IEEE 802.1AB. With the use of LLDP technology, when the network scale is expanded rapidly, the network management system can quickly understand the Layer 2 network topology information and topology change information.

The basic principle of LLDP is as follows: A device in a network sends a notification of its status information to its neighboring devices, and each port of each device stores its own information. If a local device has a state change, it can also send updated information to the neighbor device directly connected to it. The neighbor device stores the information in the standard SNMP MIB. The network management system can inquire the connection situation of the current second layer from the SNMP MIB. Note that LLDP is a remote device state information discovery protocol. It cannot perform the functions of network device configuration and port control.

LLDP Working Mode

The following list the LLDP working modes:

  • TxRx: Send and receive LLDP packets, the port works in this mode by default.

  • Tx: Only send LLDP packets, but do not receive.

  • Rx: Only receive LLDP packets, but do not send.

  • Disable: LLDP packets are neither sent nor received.

The port initializes the protocol state machine if the LLDP working mode changes.

  • Sending mechanism: When the port works in TxRx or Tx mode, the device periodically sends LLDP packets to the neighbor. If the local configuration of the device changes, LLDP packets are sent immediately to notify the neighboring devices of the changes in the local information. However, to prevent large amount of LLDP packets from being sent due to frequent changes of local information, after sending an LLDP packet, it needs to be delayed for a period of time before sending the next LLDP packet.

  • Receiving mechanism: When the port works in TxRx or Rx mode, the device checks the validity of received LLDP packets and TLVs carried in the packets. After checking, the neighbor information is saved to the local device and the aging time of the neighbor information on the local device is set according to the TTL (Time To Live) value in the TLV. If the value is zero, the neighbor information is aged out immediately.

Configuring LLDP

Procedure

  Command or Action Purpose
Step 1

enable

Example:

Device> enable 

Enables privileged EXEC mode.

Enter your password if prompted.

Step 2

configure terminal

Example:

Device# configure terminal 

Enters global configuration mode.

Step 3

lldp

Example:

Device(config)# lldp 

Enables LLDP.

Step 4

interface ethernet port-num

Example:

Device(config)# interface ethernet 2 

Enters port configuration mode.

Step 5

lldp [rxtx | tx | rx]

Example:

Device(config)# lldp tx 

(Optional) Configures the LLDP working mode.

Note 

There is no specific command to turn off the working mode.

Step 6

end

Example:

Device(config)# end 

(Optional) Exits the global configuration mode and returns to privileged EXEC mode.

Configuring LLDP Time Parameters

Procedure

  Command or Action Purpose
Step 1

enable

Example:

Device> enable 

Enables privileged EXEC mode.

Enter your password if prompted.

Step 2

configure terminal

Example:

Device# configure terminal 

Enters global configuration mode.

Step 3

lldp hello-time value

Example:

Device(config)# lldp hello-time 45 

Configures LLDP hello time.

Step 4

lldp hold-time value

Example:

Device(config)# lldp hold-time 65 

Configures LLDP hold time.

Step 5

end

Example:

Device(config)# end 

(Optional) Exits global configuration mode and returns to privileged EXEC mode.

Step 6

show lldp interface

Example:

Device# show lldp interface 

(Optional) Displays the system LLDP configurations.

Example: Configuring LLDP

Both devices must be directly connected through port 1 to open the LLDP function. For example:

Device> enable
Device# configure terminal

Device1(config)# lldp
Device2(config)# lldp

The following is sample output from the show lldp interface ethernet command:

Device1(config)# show lldp interface ethernet 1/1

System LLDP: enable
LLDP hello-time: 30(s)  LLDP hold-time: 4  LLDP TTL: 120(s)
Interface Ethernet 1/1
Port LLDP: rxtx         Pkt Tx: 158        Pkt Rx: 160
Total neighbor count: 1
Neighbor (1):
TTL: 106(s)
Chassis ID: 00:0a:5a:20:4d:ad
Port ID: port e1/1
System Name: SW2
System Description: New GreenNet Switch
Port Description: NULL
Management Address: 192.168.4.52
Port Vlan ID: 4
Port SetSpeed: auto
Port ActualSpeed: FULL-1000
Port Link Aggregation: support ,not in aggregation