启用根保护

3413阅读 0评论2012-02-07 茶乡浪子
分类:

生成树根保护Root Guard会强制一个接口成为指定端口,保护当前根交换机的状态,阻止其他交换机成为根交换机。注意,这一功能目前仅在IOS系统的Catalyst交换机上可以启用。

当在某端口上启用根保护功能时,它将自动应用到该端口所属VLAN中的所有活动VLAN中;而当在某端口禁止根保护功能时,则仅在指定端口上禁止,并且该端口自动进入侦听状态。当在端口上启用了根保护功能的交换机检测到新的根交换机信息时,端口就会进入根冲突(Root-Inconsistent)状态,然后这个交换机不再检测新的根交换机,它的端口又自动进入到侦听状态。

在二层访问端口上启用根保护功能,强制该端口成为指定端口的步骤如表12-27所示。

12-27  启用根保护功能的步骤

步骤

命令

用途说明

Switch(config)# interface {{fastethernet |gigabitethernet |
tengigabitethernet} slot/port}

指定要配置的接口,并进入接口配置模式

Switch(config-if)#spanning-tree guard root

在以上接口上启用根保护功能,可以使用no关键字禁止根保护

Switch(config-if)# end

退出配置模式

Switch# show spanning-tree

校验根保护设置

以下示例显示了如何在Ethernet 5/8接口上启用根保护。

Switch(config)# interface fastethernet 5/8

Switch(config-if)# spanning-tree guard root

Switch(config-if)# end

Switch#

【示例1校验交换机fastethernet 5/8端口的根保护设置(注意输出信息中的粗体字部分)

Switch# show running-config interface fastethernet 5/8

Building configuration...

 

Current configuration: 67 bytes

!

interface FastEthernet5/8

 switchport mode access

 spanning-tree guard root

end

 

Switch#

【示例2查看交换机各VLAN中发生冲突(Inconsistent)的端口。

Switch# show spanning-tree inconsistentports

 

Name                 Interface              Inconsistency

-------------------- ---------------------- ------------------

VLAN0001             FastEthernet3/1        Port Type Inconsistent

VLAN0001             FastEthernet3/2        Port Type Inconsistent

VLAN1002             FastEthernet3/1        Port Type Inconsistent

VLAN1002             FastEthernet3/2        Port Type Inconsistent

VLAN1003             FastEthernet3/1        Port Type Inconsistent

VLAN1003             FastEthernet3/2        Port Type Inconsistent

VLAN1004             FastEthernet3/1        Port Type Inconsistent

VLAN1004             FastEthernet3/2        Port Type Inconsistent

VLAN1005             FastEthernet3/1        Port Type Inconsistent

VLAN1005             FastEthernet3/2        Port Type Inconsistent

 

Number of inconsistent ports (segments) in the system :10

上一篇:显示MST配置和状态
下一篇:配置PortFast