蓝色动力网络

 找回密码
 立即注册

扫一扫,访问微社区

QQ登录

只需一步,快速开始

查看: 1454|回复: 0

Cisco 端口策略检测

[复制链接]
发表于 2013-12-29 11:03:25 | 显示全部楼层 |阅读模式
CISCO交换机默认是起用错误检测的,检测到任何错误时,关闭端口。默认的检测类型是全部都检测,具体可以检测的类型有下面的几种:
  RT4(config)#errdisable detect cause
  all Enable error detection on all cases
  arp-inspection Enable error detection for arp inspection
  dhcp-rate-limit Enable error detection on dhcp-rate-limit
  dtp-flap Enable error detection on dtp-flapping
  gbic-invalid Enable error detection on gbic-invalid
  l2ptguard Enable error detection on l2protocol-tunnel
  link-flap Enable error detection on linkstate-flapping
  loopback Enable error detection on loopback
  pagp-flap Enable error detection on pagp-flapping
  自动检测非常烦,遇到错误就会自动把端口关闭。如果不想启动错误检测,可以用命令no errdisable detect cause all来关闭。
  如果想检测一部分内容,不想检测另一部分,可以用下面的命令来关闭其中的检测项目
  RT4(config)#no errdisable detect cause ?
  all Enable error detection on all cases
  arp-inspection Enable error detection for arp inspection
  dhcp-rate-limit Enable error detection on dhcp-rate-limit
  dtp-flap Enable error detection on dtp-flapping
  gbic-invalid Enable error detection on gbic-invalid
  l2ptguard Enable error detection on l2protocol-tunnel
  link-flap Enable error detection on linkstate-flapping
  loopback Enable error detection on loopback
  pagp-flap Enable error detection on pagp-flapping
  CISCO还提供了自动恢复机制。默认自动恢复机制不启动,即关闭了端口不会打开。如果想让交换机关闭了端口一段时间后自动打开,可以用下面的命令来设置各具体项。all参数表示所有的类型都可以关闭一段时间后,自动打开。
  RT4(config)#errdisable recovery cause ?
  all Enable timer to recover from all causes
  arp-inspection Enable timer to recover from arp inspection error disable
  state
  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 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
  storm-control Enable timer to recover from storm-control error 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
  默认的关闭时间是30秒,时间过后自动打开。可以通过命令RT4(config)#errdisable recovery interval<30-86400> timer-interval(sec)来调整这个时间。
大家在调试中注意,判断时,可以通过命令sh interface 看,会有“err-disable”的字样。  导致交换机接口出现err-disable的几个常见原因:  引用  1.EtherChannelmisconfiguration  2.Duplexmismatch  3.BPDUportguard  4.UDLD  5.Link-flaperror  6.Loopbackerror  7.Portsecurityviolation  第一个当FEC两端配置不匹配的时候就会出现err-disable。  假设SwitchA把FEC模式配置为on,这时SwitchA是不会发送PAgP包和相连的SwitchB去协商FEC的,它假设Switch B已经配置好FEC了。但实事上Swtich B并没有配置FEC,当Switch B的这个状态超过1分钟后,Switch A的STP就认为有环路出现,因此也就出现了err-disable。解决办法就是把FEC的模式配置为channel-group 1 mode desirable non-silent这个意思是只有当双方的FEC协商成功后才建立channel,否则接口还处于正常状态。  第二个原因就是双工不匹配。一端配置为half-duplex后,他会检测对端是否在传输数据,只有对端停止传输数据,他才会发送类似于ack的包 来让链路 up,但对端却配置成了full-duplex,他才不管链路是否是空闲的,他只会不停的发送让链路up的请求,这样下去,链路状态就变成err- disable了。  三、第三个原因BPDU,也就是和portfast和BPDUguard有关。如果一个接口配置了portfast,那也就是说这个接口应该和一个 pc连接,pc是不会发送spanning-tree的BPDU帧的,因此这个口也接收BPDU来生成spanning- tree,管理员也是出于好心在同一接口上配置了BPDUguard来防止未知的BPDU帧以增强安全性,但他恰恰不小心把一个交换机接到这个同时配置了 portfast和BPDUguard 接口上,于是这个接口接到了BPDU帧,因为配置了BPDU guard,这个接口自然要进入到err-disable状态。解决办法:no spanning-tree portfast bpduguard default,或者直接把portfast关了。  第四个原因是UDLD。UDLD是cisco的私有2层协议,用于检测链路的单向问题。有的时候物理层是up的,但链路层就是down,这时候就需 要 UDLD去检测链路是否是真的up的。当AB两端都配置好UDLD后,A给B发送一个包含自己portid的UDLD帧,B收到后会返回一个UDLD帧, 并在其中包含了收到的A的portid,当A接收到这个帧并发现自己的portid也在其中后,认为这链路是好的。反之就变成err-disable状态 了。假设A配置了UDLD,而B没有配置UDLD:A给B发送一个包含自己port id的帧,B收到后并不知道这个帧是什么,也就不会返回一个包含A的port id的UDLD帧,那么这时候A就认为这条链路是一个单向链路,自然也就变成err-disable状态了。  第五个原因就是链路的抖动,当链路在10秒内反复up、down五次,那么就进入err-disable状态。  第六个原因就是keepaliveloopback。在12.1EA之前,默认情况下交换机会在所有接口都发送keepalive信息,由于一些不 通交换机协商spanning-tree可能会有问题,一个接口又收到了自己发出的keepalive,那么这个接口就会变成err-disable了。 解决办法就是把keepalive关了。或者把ios升到12.2SE。
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

蓝色动力网络微信平台
网站管理,业务合作联系邮箱: admin#lansedongli.com    QQ:13412492 限网站业务问题.
网站帐号、密码、密保找回请使用注册邮箱,发送邮件至 password#lansedongli.com ,否则不予受理.
免责声明:本论坛所有文字和图片仅代表其个人观点.
本站某些资料或文章来自于互联网,不代表本站观点,如果侵犯了您的权益,请来信告知,我们会在三天内删除.
为了给大家一个更好的交流场所,请勿在本论坛发表与中华人民共和国法律相抵触的言论,请合作,谢谢!
Copyright © 2007-2019 Corporation Powered by网吧系统 版权所有    转载请注明!
浙ICP备11043737号 程序:Discuz! x3.4

湘公网安备 43018102000145号

手机版|Archiver|蓝色动力网络   

快速回复 返回顶部 返回列表