恢復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}進行修改.


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章