交换机出现err-disable的原因及解决方法
生活随笔
收集整理的這篇文章主要介紹了
交换机出现err-disable的原因及解决方法
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
最簡單的辦法 關閉shutdown 然后 no sh 但是如果根本問題沒有解決接口還是會再次err-disable。 還可以看看這個: 關于接口處于err-disable的故障排查 故障癥狀: 線路不通,物理指示燈滅或者顯示為橙色(不同平臺指示燈狀態不同) show interface 輸出顯示接口狀態: FastEthernet0/47 is down, line protocol is down (err-disabled) 接口狀態是err-disable。 sw1#show interfaces status Port Name Status Vlan Duplex Speed Type Fa0/47 err-disabled 1 auto auto 10/100BaseTX 如果出現了接口狀態為err-disable,show interfaces status err-disabled命令能查看觸發err-disable的原因。 下面示例原因為bpduguard,在連接了交換機的端口配置了spanning-tree bpduguard enable。 sw1#show interfaces status err-disabled[b] Port Name [b]Status Reason Fa0/47 err-disabled [b]bpduguard[b] 接口產生err-disable的原因可以由以下的命令來查看,系統缺省的配置是所有列出的原因都能導致接口被置為err-disable。 sw1#show errdisable detect ErrDisable Reason Detection status ----------------- ---------------- udld Enabled bpduguard Enabled security-violatio Enabled channel-misconfig Enabled psecure-violation Enabled dhcp-rate-limit Enabled unicast-flood Enabled vmps Enabled pagp-flap Enabled dtp-flap Enabled link-flap Enabled l2ptguard Enabled gbic-invalid Enabled loopback Enabled dhcp-rate-limit Enabled unicast-flood Enabled 從列表中,我們可以看出常見的原因有udld,bpduguard,link-flap以及loopback等。 具體由什么原因導致當前接口err-disable可以由show interface status err-disable來查看。 在接口模式下采用shutdown,no shutdown進行手動的激活。 在缺省配置下,一旦接口被置為err-disable,IOS將不會試圖恢復接口。 這個可以由show errdisable recovery來查看,timer status下面所有的值都是disable。 下面的示例中,由于手工配置了bpduguard恢復,所以timer status的值變為Enable。 sw1#show errdisable recovery ErrDisable Reason Timer Status ----------------- -------------- udld Disabled bpduguard Enabled security-violatio Disabled channel-misconfig Disabled vmps Disabled pagp-flap Disabled dtp-flap Disabled link-flap Disabled l2ptguard Disabled psecure-violation Disabled gbic-invalid Disabled dhcp-rate-limit Disabled unicast-flood Disabled loopback Disabled Timer interval: 300 seconds Interfaces that will be enabled at the next timeout: Interface Errdisable reason Time left(sec) --------- ----------------- -------------- Fa0/47 bpduguard 217 配置IOS重新激活errdisable的接口,使用以下命令: sw1(config)#errdisable recovery cause bpduguard sw1(config)#errdisable recovery cause ? all Enable timer to recover from all causes bpduguard Enable timer to recover from BPDU Guard error disable state channel-misconfig Enable timer to recover from channel misconfig disable state dhcp-rate-limit Enable timer to recover from dhcp-rate-limit error disable state dtp-flap Enable timer to recover from dtp-flap error disable state gbic-invalid Enable timer to recover from invalid GBIC error disable state l2ptguard Enable timer to recover from l2protocol-tunnel error disable state link-flap Enable timer to recover from link-flap error disable state loopback Enable timer to recover from loopback detected disable state pagp-flap Enable timer to recover from pagp-flap error disable state psecure-violation Enable timer to recover from psecure violation disable state security-violation Enable timer to recover from 802.1x violation disable state udld Enable timer to recover from udld error disable state unicast-flood Enable timer to recover from unicast flood disable state vmps Enable timer to recover from vmps shutdown error disable 配置完上述命令后,IOS在一段時間后試圖恢復被置為err-disable的接口,這段時間缺省為300秒。 但是,如果引起err-disable的源沒有根治,在恢復工作后,接口會再次被置為err-disable。 調整err-disable的超時時間,可以使用以下命令: sw1(config)#errdisable recovery interval ? < 30-86400> timer-interval(sec) 可以調整在30-86400秒,缺省是300秒。 導致交換機接口出現err-disable的幾個常見原因: EtherChannel misconfiguration Duplex mismatch style=" TEXT-INDENT: 2em" > 3. BPDU port guard UDLD Link-flap error Loopback error 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里查閱
根據相關信息,就可以設置自動恢復了
errdisable recovery cause xxx
errdisable recovery interval 30
errdisable監測某些值,到一個閾值就自動disable
err-disable主要用于端口安全,基于主機MAC地址允許流量,
不愿意查原因的話,你可以用下面的命令把errdisable關了
no errdisable detect cause all
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里查閱
根據相關信息,就可以設置自動恢復了
errdisable recovery cause xxx
errdisable recovery interval 30
errdisable監測某些值,到一個閾值就自動disable
err-disable主要用于端口安全,基于主機MAC地址允許流量,
不愿意查原因的話,你可以用下面的命令把errdisable關了
no errdisable detect cause all
轉載于:https://blog.51cto.com/xpvista/348441
總結
以上是生活随笔為你收集整理的交换机出现err-disable的原因及解决方法的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 单臂路由实验(cisco packet
- 下一篇: 用perl 实现 svn 差异备份