BPDU guard和bpdufilter的一些介绍

 

BPDU GUARD的功能是当这个端口收到任何的BPDU就马上设为Error-Disabled状态。我们知道,当交换机STP功能启用的时候,默认所有端口都会参与STP,并发送和接受BPDU,当BPDU GUARD开启后,在正常情况下,一个下联的端口是不会收到任何BPDU的,因为PC和非网管换机都不支持STP,所以不会收发BPDU。当这个端口下如果有自回环的环路,那么它发出去的BPDU在非网管换机上回环后就会被自己接收到,这个时候BPDU GUARD就会把它立刻设为Error-Disabled状态,这个端口就相当于被关闭了,不会转发任何数据,也就切断了环路,保护了整个网络。

BPDU Guard特性可以全局启用也可以基于基于接口的启用,两种方法稍有不同.当在启用了Port Fast特性的端口收到了BPDU后,BPDU Guard特性将关闭(err-disable)该端口 端口处于err-disable状态时必须手动才能把此端口回复为正常状态。
配置方法:
Switch(config)# spanning-tree portfast bpduguard default          /---在启用了Port Fast特性的端口上启用BPDU Guard---/
Switch(config-if)# spanning-tree bpduguard enable                        /---在不启用Port Fast特性的情况下启用BPDU Guard---/


BPDU Filtering特性和BPDU Guard特性非常类似.通过使用BPDU Filtering,将能够防止交换机在启用了Port Fast特性的端口上发送BPDU给主机。

如果全局配置了BPDU Filtering,当某个端口接收到了BPDU,那么交换机将把端口更改回正常的STP状态,也就是它将禁用Port Fast和BPDU Filtering特性。

/*Cisco的原文是:
If an operational PortFast port receives a BPDU, it immediately loses its operational PortFast status. In that case, PortFast BPDU filtering is disabled on this port and STP resumes sending BPDUs on this port.

*/


注意,如果在连接到其他交换机的端口上配置了BPDU Filtering,那么就有可能导致层2环路(Prevent from sending and receiving BPDU).另外,如果在与启用了BPDU Filtering的相同端口上配置了BPDU Guard特性,所以BPDU Guard将不起作用,起作用的将是BPDU Filtering.
配置BPDU Filtering:
Switch(config)# spanning-tree portfast bpdufilter default              /---在启用了Port Fast特性的端口上启用BPDU Filtering---/
Switch(config-if)# spanning-tree bpdufilter enable                          /---在不启用Port Fast特性的情况下启用BPDU Filtering---/

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章