一、 组网需求:
NMS通过以太网与Switch A相连,Switch A分别通过GigabitEthernet1/0/1、GigabitEthernet1/0/2与MED设备、Switch B相连。
在Switch A和Switch B的相应端口配置LLDP功能,使得NMS可以对Switch A链路的通信情况进行判断。
二、 组网图:
三、 配置步骤:
1. 配置Switch A
# 全局使能LLDP功能。
<SwitchA> system-view
[SwitchA] lldp enable
V7:
lldp global enable
V5:
lldp enable
# 分别在GigabitEthernet1/0/1和GigabitEthernet1/0/2端口使能LLDP功能并配置其工作模式为rx。
[SwitchA] interface gigabitethernet1/0/1
[SwitchA-GigabitEthernet1/0/1] lldp enable
[SwitchA-GigabitEthernet1/0/1] lldp admin-status rx
[SwitchA-GigabitEthernet1/0/1] quit
[SwitchA] interface gigabitethernet1/0/2
[SwitchA-GigabitEthernet1/0/2] lldp enable
[SwitchA-GigabitEthernet1/0/2] lldp admin-status rx
[SwitchA-GigabitEthernet1/0/2] quit
2. 配置Switch B
# 全局使能LLDP功能。
<SwitchB> system-view
[SwitchB] lldp enable
# 在GigabitEthernet1/0/1使能LLDP功能并配置其工作模式为tx。
[SwitchB] interface gigabitethernet1/0/1
[SwitchB-GigabitEthernet1/0/1] lldp enable
[SwitchB-GigabitEthernet1/0/1] lldp admin-status tx
[SwitchB-GigabitEthernet1/0/1] quit
3. 验证配置结果
# 在Switch A上显示全局和端口的状态信息。
[SwitchA] display lldp status
Global status of LLDP : Enable
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
Hold multiplier : 4
Reinit delay : 2s
Transmit delay : 2s
Trap interval : 5s
Fast start times : 3
Port 1 [GigabitEthernet1/0/1] :
Port status of LLDP : Enable
Admin status : Rx_Only
Trap flag : No
Roll time : 0s
Number of neighbors : 1
Number of MED neighbors : 1
Number of CDP neighbors : 0
Number of sent optional TLV : 0
Number of received unknown TLV : 0
Port 2 [GigabitEthernet1/0/2] :
Port status of LLDP : Enable
Admin status : Rx_Only
Trap flag : No
Roll time : 0s
Number of neighbors : 1
Number of MED neighbors : 0
Number of CDP neighbors : 0
Number of sent optional TLV : 0
Number of received unknown TLV : 3
# 将Switch A和Switch B上的链路断掉。
# 在Switch A上显示全局和端口的状态信息。
[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
Hold multiplier : 4
Reinit delay : 2s
Transmit delay : 2s
Trap interval : 5s
Fast start times : 3
Port 1 [GigabitEthernet1/0/1] :
Port status of LLDP : Enable
Admin status : Rx_Only
Trap flag : No
Roll time : 0s
Number of neighbors : 1
Number of MED neighbors : 1
Number of CDP neighbors : 0
Number of sent optional TLV : 0
Number of received unknown TLV : 5
Port 2 [GigabitEthernet1/0/2] :
Port status of LLDP : Enable
Admin status : Rx_Only
Trap flag : No
Roll time : 0s
Number of 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 是华三和华为交换机都支持的邻居信息协议。在交换机运行 dis lldp neighbor-information list
, 可以显示最近的邻居信息。显示信息中的 chassisID,可以在对端交换机用dis lldp local-information
,
Global LLDP local-information:
Chassis ID : ac74-0937-e800
System name : dianjiaolou_7503e
System description : H3C Comware Platform Software, Software Version 7.1.070,
Release 7524
H3C S7503E-M
Copyright (c) 2004-2016 Hangzhou H3C Tech. Co., Ltd. All
rights reserved.
System capabilities supported : Bridge, Router, Customer Bridge, Service Bridge
System capabilities enabled : Bridge, Router, Customer Bridge
作者:saronic
链接:https://www.jianshu.com/p/da7abb4ee7a7
来源:简书
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。