登錄進入交換機后,執行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秒之后恢復為正常的狀態,實際情況也是這樣,等了幾分鐘以后,我們找了一臺筆記本電腦,分別接到這幾個端口上試了一下,端口都可以正常工作了。這下總算在不重交換機的情況下,將幾個處于“假死”狀態的端口“拯救”了回來。
作為一名網絡管理員,除了日常網絡故障的處理外,還會不時碰到自己知識范圍以外的東西,但只要引起足夠的重視,總會找到解決問題的辦法。如果您在工作中也遇到交換機端口“假死”的情況,不妨用這個辦法試一下。