幾天在維護宿舍網絡時碰着一個當時感受很獨特的問題:4樓交換機的20口無論怎麼連線,鏈路都不通;進入交換機,端口也啓不了;連其他的端口全沒有問題。本覺得是端口壞掉了,其後聽說是因爲環路,20口被關了,錯誤規復就好了。華爲交換機配置
於是上網查了查,大白了箇中的原理:
交換機正在事情的端口,溘然變成封鎖狀態的假死現象,第一可以用重啓交換機來辦理,第二可以用呼籲規復。
對付用呼籲規復的要領的詳細步調如下:
步調1:查察日誌/端口的狀態
登錄進入交換機後,執行showlog,會看到如下的提示:
21w6d:%ETHCNTR-3-LOOP_BACK_DETECTED:Keepalivepacketloop-backdetectedonFastEthernet0/20.
21w6d:%PM-4-ERR_DISABLE:loopbackerrordetectedonFa0/20,puttingFa0/20inerr-disablestate
以上信息就明晰暗示由於檢測到第20端口呈現了環路,所以將該端口置於了err-disable狀態。
查察端口的狀態
Switch#showinterfa0/20status
PortNameStatusVlanDuplexSpeedType
Fa0/20linktodatabackuperr-disabled562autoauto10/100BaseTX
這條信息越發明晰的暗示了該端口處於err-disabled狀態。
既然看到了該端口是被置於了錯誤的狀態了,我們就應該有步伐將其再規復成正常的狀態。
拯救步調2:將端口從錯誤狀態中規復返來
進入交換機全局設置模式,執行errdisablerecoverycause?,會看到如下信息:
Switch(config)#errdisablerecoverycause?
allEnabletimertorecoverfromallcauses
bpduguardEnabletimertorecoverfromBPDUGuarderrordisablestate
channel-misconfigEnabletimertorecoverfromchannelmisconfigdisablestate
dhcp-rate-limitEnabletimertorecoverfromdhcp-rate-limiterrordisablestate
dtp-flapEnabletimertorecoverfromdtp-flaperrordisablestate
gbic-invalidEnabletimertorecoverfrominvalidGBICerrordisablestate
l2ptguardEnabletimertorecoverfroml2protocol-tunnelerrordisablestate
link-flapEnabletimertorecoverfromlink-flaperrordisablestate
loopbackEnabletimertorecoverfromloopbackdetecteddisablestate
pagp-flapEnabletimertorecoverfrompagp-flaperrordisablestate
psecure-violationEnabletimertorecoverfrompsecureviolationdisablestate
security-violationEnabletimertorecoverfrom802.1xviolationdisablestate
udldEnabletimertorecoverfromudlderrordisablestate
unicast-floodEnabletimertorecoverfromunicastflooddisablestate
vmpsEnabletimertorecoverfromvmpsshutdownerrordisablestate
從列出的選項中,我們可以看出,有很是多的原因會引起端口被置於錯誤狀態,由於我們明晰的知道這臺交換機上的端口是由於環路問題而被置於錯誤狀態的,所以就可以直接鍵入呼籲:
Switch(config)#errdisablerecoverycauseloopback
拯救步調3:顯示被置於錯誤狀態端口的規復情形
Switch#showerrdisablerecovery
ErrDisableReasonTimerStatus
-------------------------------
udldDisabled
bpduguardDisabled
security-violatioDisabled
channel-misconfigDisabled
vmpsDisabled
pagp-flapDisabled
dtp-flapDisabled
link-flapDisabled
gbic-invalidDisabled
l2ptguardDisabled
psecure-violationDisabled
gbic-invalidDisabled
dhcp-rate-limitDisabled
unicast-floodDisabled
loopbackEnabled
Timerinterval:300seconds
Interfacesthatwillbeenabledatthenexttimeout:
InterfaceErrdisablereasonTimeleft(sec)
----------------------------------------
Fa0/8loopback276
Fa0/17loopback267
Fa0/20loopback250
從以上顯示的信息可以看出,這臺交換機有三個端口(Fa0/8、Fa0/17、Fa0/20)會別離在276、267、250秒之後規復爲正常的狀態,實際情形也是這樣,等了幾分鐘今後,我們找了一臺條記本電腦,別離接到這幾個端口上試了一下,端口都可以正常事情了。這下總算在不重交換機的情形下,將幾個處於“假死”狀態的端口“拯救”了返來。