受控接口自动恢复、交换机单接口下面环路,STP无法胜任,需要使用环路检测技术Loop Detection或Loopback Detection (环路检测),补LPDT关闭的接口,灯也是不亮的(*down、^down、~down、#down)

受控接口自动恢复、交换机单接口下面环路,STP无法胜任,需要使用环路检测技术Loop Detection或Loopback Detection (环路检测),补LPDT关闭的接口,灯也是不亮的(*down、^down、~down、#down)



Loop Detection和Loopback Detection
(一)Loop Detection只发Tagged检测报文,因此只能基于VLAN进行环路检测,一般部署于汇聚层, 可检测Eth-trunk接口,支持4094个检测VLAN数。
Loop Detection配置:
loopback-detect auto disable
loop-detection enable
loop-detection enable vlan 1 to 4094

配置Loop Detection检测报文的发送周期
[Switch] loop-detection interval-time 10
图片.png

配置Loop Detection处理动作为Shutdown。
[Switch] interface gigabitethernet 1/0/1
[Switch-GigabitEthernet1/0/1] loop-detection mode port-shutdown

<huawei-sw>display loop-detection
Loop Detection is enabled.
Detection interval time is 5 seconds.
Following VLANs enable loop-detection:
 VLAN  1 to 4094
Following ports are blocked for loop:
NULL
Following ports are shutdown for loop:
Eth-Trunk23    Include VLANs:
60
Following ports are nolearning for loop:
NULL
Following ports are trapped for loop:
NULL
Following ports are quitvlan for loop:
NULL
<huawei-sw>

[Switch] display loop-detection interface gigabitethernet 1/0/1



(二)Loopback Detection可发送Untagged和Tagged两种检测报文,因此可基于接口也可基于VLAN进行环路检测,一般部署在接入层, 不可检测Eth-trunk接口,仅支持8个检测VLAN数。
[sw1]loopback-detect enable  #全局配置了这条命令后,会在每个物理接口上配置上 loopback-detect enable,而且默认动作是shutdown。
[HUAWEI]display loopback-detect
[Switch] interface gigabitethernet 0/0/1
[sw1-GigabitEthernet0/0/1]loopback-detect enable
[sw1-GigabitEthernet0/0/1]loopback-detect action shutdown

# 配置Loopback Detection检测报文的发送周期。
[Switch] loopback-detect packet-interval 10




[HUAWEI]loopback-detect enable
[HUAWEI]display loopback-detect

(1)拓扑图

图片.png

(2)上图拓扑图中,如果SW2、SW3、SW4全部开启STP,并且STP工作正常的话,网络也是正常可以通信的了。

图片.png

图片.png

图片.png

(3)但如果SW2、SW3、SW4交换机不支持STP协议,就是普通的非网管交换机,没有防环的功能,但是SW1开启了STP,并且STP功能正常,此情况下,网络还能正常吗?

把SW2、SW3、SW4的STP协议全部关闭。

[sw2]stp disable
Warning: The global STP state will be changed. Continue? [Y/N]y
Info: This operation may take a few seconds. Please wait for a moment...done.
[sw2]
[sw3]stp disable
Warning: The global STP state will be changed. Continue? [Y/N]y
Info: This operation may take a few seconds. Please wait for a moment...done.
[sw3]
[sw4]stp disable
Warning: The global STP state will be changed. Continue? [Y/N]y
Info: This operation may take a few seconds. Please wait for a moment...done.
[sw4]

测试:需要等待几分钟后再测试

图片.png

图片.png

PC2也ping不通SW1了。

图片.png

(4)在PC2上抓包查看,发现ARP包一在刷屏

图片.png

(5)配置loopback-detect

[sw1]loopback-detect enable  #全局配置了这条命令后,会在每个物理接口上配置上 loopback-detect enable

loopback-detect enable
使能所有接口环回检测功能。缺省情况下,全局接口的环回检测功能处于关闭状态。
也可以到接口下单独配置某个接口。
[sw1-GigabitEthernet0/0/1]loopback-detect enable
# 配置Loopback Detection检测报文的发送周期。
[sw1]loopback-detect packet-interval ?
  INTEGER<1-300>  Second, the default value is 5(5seconds).
[sw1]loopback-detect packet-interval 2

# 配置Loopback Detection处理动作,默认动作是shutdown。
[sw1-GigabitEthernet0/0/1]loopback-detect action ?
  block     Block port
  nolearn   Nolearning port
  shutdown  Shutdown port
  trap      Trap only

ensp模拟器上的s57系列的交换机,不知道为什么出现以下报错:
[sw1-GigabitEthernet0/0/1]loopback-detect enable
Error: General error, for more information please contact HUAWEI engineers.
[sw1-GigabitEthernet0/0/1]loopback-detect action shutdown
Error: Please enable loopback detect on port first.
[sw1-GigabitEthernet0/0/1]

环路处理动作,默认动作是shutdown。

[sw1]dis ver
Huawei Versatile Routing Platform Software
VRP (R) software, Version 5.110 (S5700 V200R001C00)
Copyright (c) 2000-2011 HUAWEI TECH CO., LTD
Quidway S5700-28C-HI Routing Switch uptime is 0 week, 0 day, 1 hour, 34 minutes
[sw1]

[sw1]display loopback-detect
Loopback-detect sending-packet interval:  2
--------------------------------------------------------------------------------
Interface                     RecoverTime    Action                       Status
--------------------------------------------------------------------------------
GigabitEthernet0/0/24                   -  shutdown                       NORMAL
--------------------------------------------------------------------------------
[sw1]

(6)ensp模拟器上可能是不支持loopback, 所以改用真机来测试

图片.png

图片.png

图片.png

图片.png


(7)拿一条网线短接交换机

图片.png图片.png

环路后就ping不通了

图片.png

图片.png

(8)配置loopback-detect

[sw1]loopback-detect enable  #全局配置了这条命令后,会在每个物理接口上配置上 loopback-detect enable

Info: This operation may take a few seconds. Please wait for a moment...done.
[sw1]loopback-detect packet-interval 2
[sw1]int GigabitEthernet 0/0/2
[sw1-GigabitEthernet0/0/1]loopback-detect enable
Info: Loopback detection is already enabled on the port.
[sw1-GigabitEthernet0/0/2]loopback-detect action shutdown
[sw1-GigabitEthernet0/0/2]dis this
#
interface GigabitEthernet0/0/2
 port link-type access
 loopback-detect enable

图片.png

(9)拿一条网线短接交换机

[sw1]
Apr  2 2000 18:28:59+08:00 sw1 %%01MSTP/4/LOOPBACK_DETECTED(l)[23]:The port GigabitEthernet0/0/2 was blocked because it received the BPDU packets sent by itself.
[sw1]
Apr  2 2000 18:29:00+08:00 sw1 %%01IFADP/4/PORTDOWNINFO(l)[24]:Interface GigabitEthernet0/0/2 has turned into DOWN state. (Information=Physical state: DOWN, Negotiation: ENABLE, Negotiation complete: No, Local full-duplex(10M: Yes, 100M: Yes, 1000M: Yes, 2.5G: No, 10G: No), Local half-duplex(10M: Yes, 100M: Yes, 1000M: No, 2.5G: No, 10G: No), Remote full-duplex(10M: No, 100M: No, 1000M: No, 2.5G: No, 10G: No), Remote half-duplex(10M: No, 100M: No, 1000M: No, 2.5G: No, 10G: No))
Apr  2 2000 18:29:00+08:00 sw1 LBDT/4/PORTTRAP:OID 1.3.6.1.4.1.2011.5.25.174.3.3 Loopback exists on interface(6)GigabitEthernet0/0/2 ( Untagged ), loopback detection status: 3.(1:normal; 2:block; 3:shutdown; 4:trap; 5:nolearn; 6:quitvlan)
Apr  2 2000 18:29:00+08:00 sw1 %%01IFPDT/4/IF_STATE(l)[25]:Interface GigabitEthernet0/0/2 has turned into DOWN state.
Apr  2 2000 18:29:00+08:00 sw1 %%01IFNET/4/IF_STATE(l)[26]:Interface Vlanif1 has turned into DOWN state.
Apr  2 2000 18:29:00+08:00 sw1 %%01IFNET/4/LINK_STATE(l)[27]:The line protocol IP on the interface Vlanif1 has entered the DOWN state.
[sw1]

图片.png

接口的灯自动灭了。

图片.png

管理员手动关闭的接口带*号,而能过loopback-detect关闭的接口的状态带#

图片.png

接口已自动关闭,证明防环功能已生效。

图片.png





----------------------------------------------

HUAWEI S5700-10P-LI-AC (Version 5.160 (S5700 V200R007C00SPC500))

----------------------------------------------


图片.png

开启STP的情况下,进行测试:把普通交换机环路,结果stp也能起作用。

图片.png

图片.png

图片.png

开启环路检测进行测试:

[HUAWEI]loopback-detect enable

图片.png

测试:把普通交换机环起来。

图片.png

[HUAWEI]
Oct  1 2008 01:11:06+08:00 HUAWEI LBDT/4/PORTTRAP:OID 1.3.6.1.4.1.2011.5.25.174.3.3 Loopback exists on interface(5)GigabitEthernet0/0/1 ( Untagged ), loopback detection status: 3.(1:normal; 2:block; 3:shutdown; 4:trap; 5:nolearn; 6:quitvlan)
[HUAWEI]

图片.png

图片.png

把环起取消:

图片.png

等了10分钟,接口还是shutdown, 把网线拔掉,重新接上还是一样。

图片.png

把接口手工shutdown再no shutdown后,接口恢复通讯。

图片.png





受控接口自动恢复

S系列交换机V200R007(C00&C10)版本(受控接口自动恢复)
为及时在环路消失后将受控接口恢复到正常状态,Loopback Detection支持环路状态自动恢复功能。
系统在经过设置的恢复时间后会尝试在下一个恢复时间内恢复接口,若该恢复时间内没有收到受控接口发出的检测报文,则认为受控接口下的环路已经消除,将恢复该接口为正常状态。
说明:
被Loopback Detection关闭的接口不能自动恢复。

把普通交换机重新环路,进行测试自动恢复的情况:

图片.png

(可选)配置检测报文的发送周期(默认为5秒)
使能Loopback Detection功能后,接口便按一定的时间间隔发送环路检测报文,此时间间隔称为Loopback Detection检测报文的发送周期。周期越小,单位时间内发送的环路检测报文越多,环路检测结果越准确,但也会消耗更多的系统资源来发送报文,影响系统性能。用户可根据现网情况调整Loopback Detection环路检测报文的发送周期,以在系统性能和环路检测的准确度之间进行平衡。
[HUAWEI]loopback-detect packet-interval 2

配置Loopback Detection处理动作,需要进入接口配置(默认为shutdown)
[HUAWEI]int GigabitEthernet 0/0/1
[HUAWEI-GigabitEthernet0/0/1]loopback-detect action shutdown

(可选)配置受控接口的恢复时间(默认为3倍检测报文发送周期)
使能Loopback Detection后,接口会周期性地发送环回检测报文,检测到环路后就对接口采取由loopback-detect action配置的处理动作,使接口处于受控状态,并开始计时。经过设置的恢复时间后,设备会尝试在下一个恢复时间内恢复接口,若该恢复时间内没有收到受控接口发出的检测报文,则认为受控接口下的环路已经消除,将恢复该接口为正常状态。
[HUAWEI]int GigabitEthernet 0/0/1
[HUAWEI-GigabitEthernet0/0/1]loopback-detect recovery-time 5

图片.png

进行环路测试,等了好久,没有发现接口会自动恢复 。

图片.png



[huawei]display interface brief
PHY: Physical
*down: administratively down
^down: standby
~down: LDT down

#down: LBDT down
(l): loopback
(s): spoofing
(E): E-Trunk down
(b): BFD down
(e): ETHOAM down
(dl): DLDP down
(d): Dampening Suppressed
(ld): LDT block
(lb): LBDT block
(lp): Loop-detect block
(o): Observe-port forwarding down



STP生成树(列表、list、全)STPlist、环路排查、环路list
http://www.zh-cjh.com/wenzhangguilei/1485.html
文章归类、所有文章列表、LISTLIST
http://www.zh-cjh.com/wangzhangonggao/2195.html

1、本站资源长期持续更新。
2、本资源基本为原创,部分来源其他付费资源平台或互联网收集,如有侵权请联系及时处理。
3、本站大部分文章的截图来源实验测试环境,请不要在生产环境中随意模仿,以免带来灾难性后果。

转载请保留出处:  www.zh-cjh.com珠海陈坚浩博客 » 受控接口自动恢复、交换机单接口下面环路,STP无法胜任,需要使用环路检测技术Loop Detection或Loopback Detection (环路检测),补LPDT关闭的接口,灯也是不亮的(*down、^down、~down、#down)

作者: cjh


手机扫一扫,手机上查看此文章:

一切源于价值!

其他 模板文件不存在: ./template/plugins/comment/pc/index.htm

未雨绸缪、居安思危!

数据安全、有备无患!

注意操作、数据无价!

一切源于价值!