恢复err-disabled状态

show inter status

show inter status err

show errdisable recovery

errdisable detect

errdisable recovery cause ?


(config)#no errdisable detect cause all

errdisable recovery interval 300


(config-if)#no keep


当出现err-disabled状态后,首先要做的,是找出引起该状态的根源,然后重新启用该端口;如果顺序不一致,将导致该端口再次进入err-disabled状态.


找出问题的根源,以比较常见的做为例子:

导致交换机接口出现err-disable的几个常见原因:

1. EtherChannel misconfiguration

2. Duplex mismatch

3. BPDU port guard

4. UDLD

5. Link-flap error

6. Loopback error

7. Port security violation


1.以太网信道(EC)的错误配置:

如果要让EC能够正常工作,参与到EC绑定的端口的配置,必须是一致的,比如处于同一VLAN,trunk模式相同,速率和双工模式都匹配等等.如果一端配置了EC,而另一端没有配置EC,STP将关闭配置了EC一方的参与到EC中的端口.并且当PAgP的模式是处于on模式的时候,交换机是不会向外发送PAgP信息去进行协商的(它认为对方是处于EC).这种情况下STP判定出现环路问题,因此将端口设置为err-disabled状态.如:

%SPANTREE-2-CHNL_MISCFG: Detected loop due to etherchannel misconfiguration

   of Gi2/1


如下,查看EC信息显示使用的信道组数量为0:

NUAIKO#show etherchannel summary


Flags: D - down            P - in port-channel

          I - stand-alone   s - suspended

          H - Hot-standby (LACP only)

          R - Layer3          S - Layer2

          U - in use           f - failed to allocate aggregator

         

          u - unsuitable for bundling

Number of channel-groups in use: 0

Number of aggregators:               0


EC没有正常工作是由于端口被设置为err-disabled状态:

NUAIKO#show interfaces gigabitethernet 2/1 status


Port     Name            Status          Vlan      Duplex     Speed     Type

Gi2/1                   err-disabled     100            full      1000       1000BaseSX


为找出为何EC没有正常工作,根据错误信息暗示,STP检测到环路.之前提到过,这种情况的发生,是由于一方配置了EC,设置PAgP模式为on模式,这种模式和desirable模式正好相反,而另一方没有配置EC.因此,为了解决这种问题的发生,将EC的PAgP模式设置为可以主动协商的desirable模式.,然后再重新启用该端口.如下:

!

interface gigabitethernet 2/1

channel-group 1 mode desirable non-silent

!


2.双工模式不匹配:

双工模式不匹配的问题比较常见,由于速率和双工模式自动协商的故障,常导致这种问题的发生.可以使用show interfaces命令查看双方端口的速率和双工模式.后期版本的CDP也能够在将端口处于err-disabled状态之前发出警告日志信息.另外,网卡的不正常设置也将引起双工模式的不匹配.解决办法,如双方不能自动协商,使用duplex命令(CISCO IOS和CatOS有所不同)修改双方双工模式使之一致.


3.BPDU Guard:

通常启用了快速端口(PortFast)特性的端口用于直接连接端工作站这种不会产生BPDU的末端设备.由于PortFast特性假定交换机的端口不会产生物理环路,因此,当在启用了PortFast和BPDU Guard特性的端口上收到BPDU后,该端口将进入err-disabled状态,用于避免潜在环路.


假如我们将两台6509交换机相连,在其中一台上启用PortFast特性并打开BPDU Guard特性:

!

interface gigabitethernet 2/1

spanning-tree bpduguard enable

spanning-tree portfast enable

!


此时将看到如下日志信息:

%PM-SP-4-ERR_DISABLE: bpduguard error detected on Gi2/1, putting Gi2/1 in

   err-disable state.


验证:

NUAIKO#show interfaces gigabitethernet 2/1 status


Port     Name            Status          Vlan      Duplex     Speed     Type

Gi2/1                   err-disabled     100            full      1000       1000BaseSX


像这种情况,不能启用PortFast特性,因此禁用该特性可以解决该问题.


4.UDLD:

UDLD协议允许通过光纤或铜线相连的设备监控线缆的物理配置,并且可以检测是否存在单向链路.如果检测到有单向链路,UDLD将关闭相关端口并发出警告日志信息.单向链路可以引起一系列的问题,最常见的就是STP拓扑环路.注意,为了启用UDLD,双方必须都支持该协议,并且要单独在每个端口启用UDLD.如果你只在一方启用了UDLD,同样的会引起端口进入err-disabled状态,如:

%PM-SP-4-ERR_DISABLE: udld error detected on Gi2/1, putting Gi2/1 in

   err-disable state.


5.链路振荡错误:

链路振荡(flap)是指短时间内端口不停的处于up/down状态,如果端口在10秒内连续振荡5次,端口将被设置为err-disabled状态,如:

%PM-4-ERR_DISABLE: link-flap error detected on Gi2/1, putting Gi2/1 in

   err-disable state


可以使用如下命令查看不同的振荡的值:

NUAIKO#show errdisable flap-values


ErrDisable Reason              Flaps       Time (sec)

 

pagp-flap                              3          30

dtp-flap                                 3          30

link-flap                                 5         10


引起链路震荡的常见因素,可能是物理层的问题,比如GBIC的硬件故障等等.因此解决这种问题通常先从物理层入手.


6.回环(loopback)错误:

当keepalive信息从交换机的出站端口被发送出去后,又从该接口收到该信息,就会发生回环错误.交换机默认情况下会从所有端口向外发送keepalive信息.但由于STP没能阻塞某些端口,导致这些信息可能会被转发回去形成逻辑环路.因此出现这种情况后,端口将进入err-disabled状态,如:

%PM-4-ERR_DISABLE: loopback error detected on Gi2/1, putting Gi2/1 in

   err-disable state


从CISCO IOS 12.2SE之后的版本,keepalive信息将不再从光纤和上行端口发送出去,因此解决这种问题的方案是升级CISCO IOS软件版本到12.2SE或后续版本.更多信息可以参见CISCO BUG ID CSCea46385(需要一定权限的CCO).


7.违反端口安全(Port Security)策略:

端口安全特性提供了根据MAC地址,动态的对交换机端口进行保护的特性.违反该策略将导致端口进入err-disabled状态.端口安全的原理和配置这里就不再赘述,有兴趣的可以去CISCO的Documentation CD里查阅(当然如果你比我还懒的话,可以加我Q:13030130,我讲给你听).


五.重新启用进入err-disabled状态的端口:

再找到引起err-disabled状态的根源后,如果没有配置errdisable recovery,此时端口仍然处于禁用状态.这种情况下,就必须手动的重新启动这些端口(在接口下先shutdown再no shutdown).


errdisable recovery允许你根据错误类型,在一定时间后(默认值是300秒)自动的重新启用该端口.使用show errdisable recovery命令查看该特性的默认设置:

NUAIKO#show errdisable recovery

ErrDisable Reason             Timer Status

udld                                  Disabled

bpduguard                         Disabled

security-violation                Disabled

channel-misconfig               Disabled

pagp-flap                           Disabled

dtp-flap                             Disabled

link-flap                             Disabled

l2ptguard                           Disabled

psecure-violation                Disabled

gbic-invalid                        Disabled

dhcp-rate-limit                   Disabled

mac-limit                           Disabled

unicast-flood                      Disabled

arp-inspection                    Disabled


Timer interval: 300 seconds

Interfaces that will be enabled at the next timeout:


Interface         Errdisable reason                      Time left(sec)

 

   Fa2/4                   bpduguard                                 273


默认情况下超时特性是禁用的.如下是启用errdisable recovery并选择相应的条件:

NUAIKO#errdisable recovery cause ?

其中?对应show errdisable recovery的输出内容中"ErrDisable Reason"一项.如下:

NUAIKO#show errdisable recovery

ErrDisable Reason             Timer Status

udld                                  Disabled

bpduguard                         Enabled

security-violation                Disabled

channel-misconfig               Disabled

pagp-flap                           Disabled

dtp-flap                             Disabled

link-flap                             Disabled

l2ptguard                           Disabled

psecure-violation                Disabled

gbic-invalid                        Disabled

dhcp-rate-limit                   Disabled

mac-limit                           Disabled

unicast-flood                      Disabled

arp-inspection                    Disabled


Timer interval: 300 seconds

Interfaces that will be enabled at the next timeout:


Interface         Errdisable reason                      Time left(sec)

 

   Fa2/4                   bpduguard                                 273


注意上面的输出内容,可以看出BPDU Guard是引起Fa2/4进入err-disabled状态的原因.当任意errdisable条件被启用,默认300秒后将重新启用该端口.该时间可以通过errdisable recovery interval {sec}进行修改.


你可能感兴趣的:(status,Security,交换机,recovery,以太网,err-disabled)