Basic LLDP configuration example
Network requirements
As shown in Figure 81, the NMS and Switch A are located in the same Ethernet network. A MED device and Switch B are connected to Ten-GigabitEthernet1/0/1 and Ten-GigabitEthernet 1/0/2 of Switch A.
Enable LLDP globally on Switch A and Switch B to perform the following tasks:
Monitor the link between Switch A and Switch B.
Monitor the link between Switch A and the MED device on the NMS.
Figure 81: Network diagram
Configuration procedure
Configure Switch A:
# Enable LLDP globally.
<SwitchA> system-view [SwitchA] lldp global enable
# Enable LLDP on Ten-GigabitEthernet 1/0/1. By default, LLDP is enabled on ports.
[SwitchA] interface ten-gigabitethernet 1/0/1 [SwitchA-Ten-GigabitEthernet1/0/1] lldp enable
# Set the LLDP operating mode to Rx.
[SwitchA-Ten-GigabitEthernet1/0/1] lldp admin-status rx [SwitchA-Ten-GigabitEthernet1/0/1] quit
# Enable LLDP on Ten-GigabitEthernet 1/0/2. By default, LLDP is enabled on ports.
[SwitchA] interface ten-gigabitethernet 1/0/2 [SwitchA-Ten-GigabitEthernet1/0/2] lldp enable
# Set the LLDP operating mode to Rx.
[SwitchA-Ten-GigabitEthernet1/0/2] lldp admin-status rx [SwitchA-Ten-GigabitEthernet1/0/2] quit
Configure Switch B:
# Enable LLDP globally.
<SwitchB> system-view [SwitchB] lldp global enable
# Enable LLDP on Ten-GigabitEthernet 1/0/1. By default, LLDP is enabled on ports.
[SwitchB] interface ten-gigabitethernet 1/0/1 [SwitchB-Ten-GigabitEthernet1/0/1] lldp enable
# Set the LLDP operating mode to Tx.
[SwitchB-Ten-GigabitEthernet1/0/1] lldp admin-status tx [SwitchB-Ten-GigabitEthernet1/0/1] quit
Verify the configuration:
# Verify that:
Ten-GigabitEthernet 1/0/1 of Switch A connects to a MED device.
Ten-GigabitEthernet 1/0/2 of Switch A connects to a non-MED device.
Both ports operate in Rx mode, and they can receive LLDP frames but cannot send LLDP frames.
[SwitchA] display lldp status Global status of LLDP: Enable Bridge mode of LLDP: customer-bridge The current number of LLDP neighbors: 2 The current number of CDP neighbors: 0 LLDP neighbor information last changed time: 0 days, 0 hours, 4 minutes, 40 seconds Transmit interval : 30s Fast transmit interval : 1s Transmit credit max : 5 Hold multiplier : 4 Reinit delay : 2s Trap interval : 30s Fast start times : 4 LLDP status information of port 1 [Ten-GigabitEthernet1/0/1]: LLDP agent nearest-bridge: Port status of LLDP : Enable Admin status : RX_Only Trap flag : No MED trap flag : No Polling interval : 0s Number of LLDP neighbors : 1 Number of MED neighbors : 1 Number of CDP neighbors : 0 Number of sent optional TLV : 21 Number of received unknown TLV : 0 LLDP agent nearest-customer: Port status of LLDP : Enable Admin status : Disable Trap flag : No MED trap flag : No Polling interval : 0s Number of LLDP neighbors : 0 Number of MED neighbors : 0 Number of CDP neighbors : 0 Number of sent optional TLV : 16 Number of received unknown TLV : 0 LLDP status information of port 2 [Ten-GigabitEthernet1/0/2]: LLDP agent nearest-bridge: Port status of LLDP : Enable Admin status : RX_Only Trap flag : No MED trap flag : No Polling interval : 0s Number of LLDP neighbors : 1 Number of MED neighbors : 0 Number of CDP neighbors : 0 Number of sent optional TLV : 21 Number of received unknown TLV : 3 LLDP agent nearest-nontpmr: Port status of LLDP : Enable Admin status : Disable Trap flag : No MED trap flag : No Polling interval : 0s Number of LLDP neighbors : 0 Number of MED neighbors : 0 Number of CDP neighbors : 0 Number of sent optional TLV : 1 Number of received unknown TLV : 0 LLDP agent nearest-customer: Port status of LLDP : Enable Admin status : Disable Trap flag : No MED trap flag : No Polling interval : 0s Number of LLDP neighbors : 0 Number of MED neighbors : 0 Number of CDP neighbors : 0 Number of sent optional TLV : 16 Number of received unknown TLV : 0
# Remove the link between Switch A and Switch B.
# Verify that Ten-GigabitEthernet 1/0/2 of Switch A does not connect to any neighboring devices.
[SwitchA] display lldp status Global status of LLDP: Enable The current number of LLDP neighbors: 1 The current number of CDP neighbors: 0 LLDP neighbor information last changed time: 0 days, 0 hours, 5 minutes, 20 seconds Transmit interval : 30s Fast transmit interval : 1s Transmit credit max : 5 Hold multiplier : 4 Reinit delay : 2s Trap interval : 30s Fast start times : 4 LLDP status information of port 1 [Ten-GigabitEthernet1/0/1]: LLDP agent nearest-bridge: Port status of LLDP : Enable Admin status : RX_Only Trap flag : No MED trap flag : No Polling interval : 0s Number of LLDP neighbors : 1 Number of MED neighbors : 1 Number of CDP neighbors : 0 Number of sent optional TLV : 0 Number of received unknown TLV : 5 LLDP agent nearest-nontpmr: Port status of LLDP : Enable Admin status : Disable Trap flag : No MED trap flag : No Polling interval : 0s Number of LLDP neighbors : 0 Number of MED neighbors : 0 Number of CDP neighbors : 0 Number of sent optional TLV : 1 Number of received unknown TLV : 0 LLDP status information of port 2 [Ten-GigabitEthernet1/0/2]: LLDP agent nearest-bridge: Port status of LLDP : Enable Admin status : RX_Only Trap flag : No MED trap flag : No Polling interval : 0s Number of LLDP neighbors : 0 Number of MED neighbors : 0 Number of CDP neighbors : 0 Number of sent optional TLV : 0 Number of received unknown TLV : 0 LLDP agent nearest-nontpmr: Port status of LLDP : Enable Admin status : Disable Trap flag : No MED trap flag : No Polling interval : 0s Number of LLDP neighbors : 0 Number of MED neighbors : 0 Number of CDP neighbors : 0 Number of sent optional TLV : 1 Number of received unknown TLV : 0 LLDP agent nearest-customer: Port status of LLDP : Enable Admin status : Disable Trap flag : No MED trap flag : No Polling interval : 0s Number of LLDP neighbors : 0 Number of MED neighbors : 0 Number of CDP neighbors : 0 Number of sent optional TLV : 16 Number of received unknown TLV : 0