请问loopback-detection的机制是如何的? 比如我在同一台S5130的1口上不配置loopback-detection,2口上配置loopback-detection,动作为shutdown,1、2口成环,1口收到2口的报文,那这时loopback-detection会生效吗?如果生效的话,是shutdown 1口还是2口? 假如我不知道是1、2口成环,有命令可以看到是哪2个端口之间成环了吗?
(0)
最佳答案
如下仅在1/0/1口配置环路检测,会有日志提示1/0/2口有环路,但因为1/0/2口未配置环路检测,所以不会shutdown1/0/2口。
[H3C-GigabitEthernet1/0/1]loopback-detection action shutdown
[H3C-GigabitEthernet1/0/1]loopback-detection enable vlan all
[H3C-GigabitEthernet1/0/1]%Mar 2 09:15:56:205 2021 H3C LPDT/4/LPDT_LOOPED: Loopback exists on GigabitEthernet1/0/2.
%Mar 2 09:15:56:205 2021 H3C LPDT/4/LPDT_VLAN_LOOPED: Loopback exists on GigabitEthernet1/0/2 in VLAN 1.
[H3C]dis loopback-detection
Loopback detection is enabled.
Loopback detection interval is 30 second(s).
Loopback is detected on following interfaces:
Interface Action mode
GigabitEthernet1/0/2 none
(0)
LPDT/5/LPDT_VLAN_RECOVERED: Loopback on Bridge-Aggregation1 in VLAN 18 recovered. 那这个日志是表示环路消除了吗?
环路检测默认30s一次,30秒一到被shutdown的端口就会恢复,如果再次发现环路会继续shutdown。此日志表示端口恢复了,不是环路消失
· 三台设备Device A、Device B和Device C组成一个物理上的环形网络。
· 通过在Device A上配置环路检测功能,使系统能够自动关闭Device A上出现环路的端口,并通过打印日志信息来通知用户检查网络。
图1-3 环路检测典型组网图
(1) 配置Device A
# 创建VLAN 100,并全局使能该VLAN内的环路检测功能。
<DeviceA> system-view
[DeviceA] vlan 100
[DeviceA–vlan100] quit
[DeviceA] loopback-detection global enable vlan 100
# 配置端口Ten-GigabitEthernet1/0/1和Ten-GigabitEthernet1/0/2为Trunk类型,并允许VLAN 100通过。
[DeviceA] interface ten-gigabitethernet 1/0/1
[DeviceA-Ten-GigabitEthernet1/0/1] port link-type trunk
[DeviceA-Ten-GigabitEthernet1/0/1] port trunk permit vlan 100
[DeviceA-Ten-GigabitEthernet1/0/1] quit
[DeviceA] interface ten-gigabitethernet 1/0/2
[DeviceA-Ten-GigabitEthernet1/0/2] port link-type trunk
[DeviceA-Ten-GigabitEthernet1/0/2] port trunk permit vlan 100
[DeviceA-Ten-GigabitEthernet1/0/2] quit
# 全局配置环路检测的处理模式为Shutdown模式。
[DeviceA] loopback-detection global action shutdown
# 配置环路检测的时间间隔为35秒。
[DeviceA] loopback-detection interval-time 35
(2) 配置Device B
# 创建VLAN 100。
<DeviceB> system-view
[DeviceB] vlan 100
[DeviceB–vlan100] quit
# 配置端口Ten-GigabitEthernet1/0/1和Ten-GigabitEthernet1/0/2为Trunk类型,并允许VLAN 100通过。
[DeviceB] interface ten-gigabitethernet 1/0/1
[DeviceB-Ten-GigabitEthernet1/0/1] port link-type trunk
[DeviceB-Ten-GigabitEthernet1/0/1] port trunk permit vlan 100
[DeviceB-Ten-GigabitEthernet1/0/1] quit
[DeviceB] interface ten-gigabitethernet 1/0/2
[DeviceB-Ten-GigabitEthernet1/0/2] port link-type trunk
[DeviceB-Ten-GigabitEthernet1/0/2] port trunk permit vlan 100
[DeviceB-Ten-GigabitEthernet1/0/2] quit
(3) 配置Device C
# 创建VLAN 100。
<DeviceC> system-view
[DeviceC] vlan 100
[DeviceC–vlan100] quit
# 配置端口Ten-GigabitEthernet1/0/1和Ten-GigabitEthernet1/0/2为Trunk类型,并允许VLAN 100通过。
[DeviceC] interface ten-gigabitethernet 1/0/1
[DeviceC-Ten-GigabitEthernet1/0/1] port link-type trunk
[DeviceC-Ten-GigabitEthernet1/0/1] port trunk permit vlan 100
[DeviceC-Ten-GigabitEthernet1/0/1] quit
[DeviceC] interface ten-gigabitethernet 1/0/2
[DeviceC-Ten-GigabitEthernet1/0/2] port link-type trunk
[DeviceC-Ten-GigabitEthernet1/0/2] port trunk permit vlan 100
[DeviceC-Ten-GigabitEthernet1/0/2] quit
当配置完成后,系统在一个环路检测时间间隔内在Device A的端口Ten-GigabitEthernet1/0/1和Ten-GigabitEthernet1/0/2上都检测到了环路,于是将这两个端口自动关闭,并打印了如下日志信息:
[DeviceA]
%Feb 24 15:04:29:663 2011 DeviceA LPDT/4/LOOPED:Slot=1;
Loopback exists on Ten-GigabitEthernet1/0/1.
%Feb 24 15:04:29:667 2011 DeviceA LPDT/4/LOOPED:Slot=1;
Loopback exists on Ten-GigabitEthernet1/0/2.
%Feb 24 15:04:44:243 2011 DeviceA LPDT/4/RECOVERED:Slot=1;
Loopback on Ten-GigabitEthernet1/0/1 recovered.
%Feb 24 15:04:44:248 2011 DeviceA LPDT/4/RECOVERED:Slot=1;
Loopback on Ten-GigabitEthernet1/0/2 recovered.
使用display loopback-detection命令可以查看Device A上环路检测的配置和运行情况:
# 显示Device A上环路检测的配置和运行情况。
[DeviceA] display loopback-detection
Loopback detection is enabled.
Loopback detection interval is 35 second(s).
No loopback is detected.
由此可见,Device A上并未显示在端口Ten-GigabitEthernet1/0/1和Ten-GigabitEthernet1/0/2上检测到环路,这是由于环路检测功能运行在Shutdown模式下,端口Ten-GigabitEthernet1/0/1和Ten-GigabitEthernet1/0/2上出现环路后均已被自动关闭,因此这两个端口上的环路已消除。此时,使用display interface命令分别查看Device A上端口Ten-GigabitEthernet1/0/1和Ten-GigabitEthernet1/0/2的状态信息:
# 显示Device A上端口Ten-GigabitEthernet1/0/1的状态信息。
[DeviceA] display interface ten-gigabitethernet 1/0/1
Ten-GigabitEthernet1/0/1 current state: DOWN (Loopback detection down)
...
# 显示Device A上端口Ten-GigabitEthernet1/0/2的状态信息。
[DeviceA] display interface ten-gigabitethernet 1/0/2
Ten-GigabitEthernet1/0/2 current state: DOWN (Loopback detection down)
...
由此可见,端口Ten-GigabitEthernet1/0/1和Ten-GigabitEthernet1/0/2均已被环路检测模块自动关闭。
(1)
您好,请知:
以下是环路检测的配置参考命令及相关查询说明:
[H3C]loopback-detection global enable vlan all //全局开启环路检测,并对所有的VLAN生效
[H3C]loopback-detection interval-time 250 //配置环路检测的时间间隔为250秒
[H3C]int gi 1/0/1
[H3C-GigabitEthernet1/0/1]loopback-detection enable vlan all //接口开启环路检测,并对所有的VLAN生效
[H3C-GigabitEthernet1/0/1]loopback-detection action shutdown //当检测到环路时,环路检测会将此端口关闭
查看环路检测的显示信息:
[H3C]dis loopback-detection
Loopback detection is enabled. //环路检测已开启
Loopback detection interval is 250 second(s). //环路检测的时间间隔为250秒
No loopback is detected. //目前没有检测到环路
(0)
亲~登录后才可以操作哦!
确定你的邮箱还未认证,请认证邮箱或绑定手机后进行当前操作
举报
×
侵犯我的权益
×
侵犯了我企业的权益
×
抄袭了我的内容
×
原文链接或出处
诽谤我
×
对根叔社区有害的内容
×
不规范转载
×
举报说明
环路检测默认30s一次,30秒一到被shutdown的端口就会恢复,如果再次发现环路会继续shutdown。此日志表示端口恢复了,不是环路消失