2018年9月26日周三晚,计划更换楼层交换机,之前已经把交换机按照旧的贾环己配置完毕。楼层交换机与核心交换机是采用2个光纤做捆绑,做链路聚合使用。交换机上架开启后,发现公司无线异常,ping服务器丢包严重,ping一些其他网络基本不通,但是ping外网正常。
赶紧用console连接交换机发现如下代码:
Sep 26 11:49:57.994: %SW_MATM-4-MACFLAP_NOTIF: Host 44c3.46a3.3f65 in vlan 300 is flapping between port Po24 and port Gi1/0/49
Sep 26 11:50:00.958: %SW_MATM-4-MACFLAP_NOTIF: Host 68ed.d00c.d6a4 in vlan 300 is flapping between port Po24 and port Gi1/0/49
以及:
*Aug 20 07:45:23.022: %LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet2/1/1, changed state to up
*Sep 26 11:52:40.975: %ETHCNTR-3-LOOP_BACK_DETECTED: Loop-back detected on GigabitEthernet2/0/24.
*Sep 26 11:52:40.975: %PM-4-ERR_DISABLE: loopback error detected on Gi2/0/24, putting Gi2/0/24 in err-disable state
*Sep 26 11:52:41.972: %LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet2/0/24, changed state to down
赶紧查询两个端口,发现一个端口做了portchannel,另一个居然没做!!!!!!!!,赶紧拔掉一个光纤,网络恢复正常,然后把另一个端口加入portchannel。
一会又发现另外交换机出现异常,登录查看也是err-disable state
由于环路问题而被置于错误状态的,所以就可以直接键入命令:
步骤一:拯救步骤1:查看日志/端口的状态
Switch# show inter g2/0/24 status
*Sep 26 11:52:40.975: %PM-4-ERR_DISABLE: loopback error detected on Gi2/0/24, putting Gi2/0/24 in err-disable state
这条信息更加明确的表示了该端口处于err-disabled状态
步骤二:拯救步骤2:将端口从错误状态中恢复回来
Switch(config)#errdisable recovery cause loopback
步骤三:显示被置于错误状态端口的恢复情况
Switch# show errdisable recovery
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)
--------- ----------------- --------------
Gi2/0/24 loopback 276
这个是gi2/0/24端口在276s后恢复正常。
总结:
1.配置需要检查再检查,往往因为疏忽大意酿成大错;
2.实施项目前需要有详细的计划,以及回滚计划;
3.实施项目最好是选择有充裕的失败缓冲时间(这次我差点选择在午休的时间操作,还好选择在下班后,断网大概2分钟不到,影响微乎其微)
4.遇到问题不要慌,先看日志,根据日志对症下药。
失败是成功之母!