交換機端口“假死”的現象,在交換機不重啓的狀態下將該端口“拯救”回來的方法。
拯救步驟1:查看日誌/端口的狀態
登錄進入交換機後,執行show log,會看到如下的提示:
21w6d: %ETHCNTR-3-LOOP_BACK_DETECTED: Keepalive packet loop-back detected on FastEthernet0/20.
21w6d: %PM-4-ERR_DISABLE: loopback error detected on Fa0/20, putting Fa0/20 in err-disable state
以上信息就明確表示由於檢測到第20端口出現了環路,所以將該端口置於了err-disable狀態。
查看端口的狀態
Switch# show inter fa0/20 status
Port Name Status Vlan Duplex Speed Type
Fa0/20 link to databackup err-disabled 562 auto auto 10/100BaseTX
這條信息更加明確的表示了該端口處於err-disabled狀態。
該端口是被置於了錯誤的狀態。
拯救步驟2:將端口從錯誤狀態中恢復回來
進入交換機全局配置模式,執行errdisable recovery cause ?,會看到如下信息:
Switch(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 state
從列出的選項中,可以看出,有非常多的原因會引起端口被置於錯誤狀態,由於我們明確的知道這臺交換機上的端口是由於環路問題而被置於錯誤狀態的,所以就可以直接鍵入命令:
Switch(config)#errdisable recovery cause loopback
拯救步驟3:顯示被置於錯誤狀態端口的恢復情況
Switch# show errdisable recovery
ErrDisable Reason Timer Status
----------------- --------------
udld Disabled
bpduguard Disabled
security-violatio Disabled
channel-misconfig Disabled
vmps Disabled
pagp-flap Disabled
dtp-flap Disabled
link-flap Disabled
gbic-invalid Disabled
l2ptguard Disabled
psecure-violation Disabled
gbic-invalid Disabled
dhcp-rate-limit Disabled
unicast-flood Disabled
loopback Enabled
Timer interval: 300 seconds
Interfaces that will be enabled at the next timeout:
Interface Errdisable reason Time left(sec)
--------- ----------------- --------------
Fa0/8 loopback 276
Fa0/17 loopback 267
Fa0/20 loopback 250
從以上顯示的信息可以看出,這臺交換機有三個端口(Fa0/8、Fa0/17、Fa0/20)會分別在276、267、250秒之後恢復爲正常的狀態,實際情況也是這樣,等了幾分鐘以後,我們找了一臺筆記本電腦,分別接到這幾個端口上試了一下,端口都可以正常工作了。這下總算在不重交換機的情況下,將幾個處於“假死”狀態的端口“拯救”了回來。
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~·
爲了讓交換機出現此假死故障後能自動恢復,我們也有相應幫忙來解決
用於cisco交換機自動恢復端口假死的故障
在特權模式下配置如下:
errdisable recovery cause udld
errdisable recovery cause bpduguard
errdisable recovery cause security-violation
errdisable recovery cause channel-misconfig
errdisable recovery cause pagp-flap
errdisable recovery cause dtp-flap
errdisable recovery cause link-flap
errdisable recovery cause sfp-config-mismatch
errdisable recovery cause gbic-invalid
errdisable recovery cause l2ptguard
errdisable recovery cause psecure-violation
errdisable recovery cause dhcp-rate-limit
errdisable recovery cause unicast-flood
errdisable recovery cause vmps
errdisable recovery cause storm-control
errdisable recovery cause inline-power
errdisable recovery cause arp-inspection
errdisable recovery cause loopback
以上這些都是導致端口假死的條件,配置上述可以
Link-flap error
Link flap means that the interface continually goes up and down. The interface is put into the errdisabled state if it flaps more than five times in 10 seconds. The common cause of link flap is a Layer 1 issue such as a bad cable, duplex mismatch, or bad Gigabit Interface Converter (GBIC) card. Look at the console messages or the messages that were sent to the syslog server that state the reason for the port shutdown.
%PM-4-ERR_DISABLE: link-flap error detected on Gi4/1, putting Gi4/
1 in err-disable state
Issue this command in order to view the flap values:
cat6knative#show errdisable flap-values
!--- Refer to show errdisable flap-values for more information on the command.
ErrDisable Reason Flaps Time (sec)
----------------- ------ ----------
pagp-flap 3 30
dtp-flap 3 30
link-flap 5 10
讓端口在出現假死後自動恢復;