Openstack节点网卡连Cisco交换机出现环路的处理

前一阵子部署了两台Openstack的计算节点,奇怪的是每隔一段时间连管理网的网卡eth0灯不亮,交换机上对应的19端口灯变橙色,登陆上去一看,eth0显示:

2: eth0:  mtu 1500 qdisc mq master ovs−system state DOWN mode DEFAULT group default qlen 1000

运行ip link set eth0 up无效。

登陆交换机,查看端口状态:

Switch>enable 
Switch#show interfaces gigabitethernet 0/19 status 
Port    Name       Status       Vlan       Duplex  Speed Type
G0/19   err−disabled 100          full   1000 1000BaseSX

可以看到19端口出现问题,继续看日志

Switch#show logging
...
Mar 30 01:43:39.827: %ETHCNTR−3−LOOP_BACK_DETECTED: Loop−back detected on GigabitEthernet0/19.
Mar 30 01:43:39.827: %PM−4−ERR_DISABLE: loopback error detected on Gi0/19, putting Gi0/19 in err−disable state
Mar 30 01:43:40.833: %LINEPROTO−5−UPDOWN: Line protocol on Interface GigabitEthernet0/19, changed state to down
Mar 30 01:43:41.840: %LINK−3−UPDOWN: Interface GigabitEthernet0/19, changed state to down

发现原来是出现了环路,参考cisco的官方文档,一个可能的原因是交换机定时发送keepalive,这个数据包进入节点后又出来,到了同一个端口,则交换机认为可能出现环路,从而禁用。

解决办法是禁用keepalive:

Switch(config)#interface gigabitethernet 0/19 
Switch(config−if)#no keepalive

当然也可以升级到高版本的IOS,默认会禁用keeplive。

然后恢复出错的端口:

Switch(config)#errdisable recovery cause loopback 
Switch(config)#exit
Switch#show errdisable recovery
...
Interfaces that will be enabled at the next timeout:  
Interface       Errdisable reason       Time left(sec)
−−−−−−−−−       −−−−−−−−−−−−−−−−−       −−−−−−−−−−−−−−
Gi0/9                   loopback          205
Gi0/10                  loopback          205
Gi0/19                  loopback          205

过了300秒后,端口应该恢复正常,此时能够连接上主机了。

我觉得也可以在节点侧,在连接eth0的ovs桥br0加stp,以观后效

root@node4:~# ovs−vsctl get bridge br0 stp_enable
false
root@node4:~# ovs−vsctl set bridge br0 stp_enable=true

参考文章

Cisco交换机命令行配置(http://www.cisco.com/c/en/us/td/docs/switches/datacenter/nexus5000/sw/configuration/guide/cli_rel_4_0_1a/CLIConfigurationGuide/sm_syslog.html)

Cisco交换机端口出错处理(http://www.cisco.com/c/en/us/support/docs/lan-switching/spanning-tree-protocol/69980-errdisable-recovery.html)

3 thoughts on “Openstack节点网卡连Cisco交换机出现环路的处理

  1. you are in reality a excellent webmaster. The site loading speed is incredible. It kind of feels that you’re doing any distinctive trick. Furthermore, The contents are masterwork. you have done a excellent job on this matter!|

  2. Pingback: 交换机环路 | Sherry

  3. Pingback: 交换机 网络环路 | Sherry

Leave a Comment

Your email address will not be published. Required fields are marked *