天天看点

Understanding and Configuring Spanning Tree Protocol on Catalyst Swiches

Document ID:5234

[url]http://www.cisco.com/en/US/tech/tk389/tk621/technologies_configuration_example09186a008009467c.shtml[/url]

Understanding and Configuring Spanning Tree Protocol on Catalyst Swiches

Step-by-Step Instructions

complete these steps:

1 Issue the show version command in order to display the software version that the switch runs.

用show version 命令显示当前交换机运行的软件版本

Swich-15 >(enable) show version

WS-C5505 software ,Version McpSw: 4.2( 1 ) NmpSW: 4.2 ( 1 )

Copyright  (c) 1995-1998 by Cisco Systems      September  九月

NMP S/W compiled on sep 8  1998, 10:30:21

MCP S/W compiled on sep 08 1998, 10:26:29

System Bootstrap Version: 5.1(2)

Hardware Version :1.0 Model: WS-5505 Serial # : 066509227

Mod    Port      Model        Serial   #       versions

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

1          0          WS-5505    008676033    HW: 2.3

FW:     5.1 (2)

FW1:   4.4(1)

SW:      4.2(1)

In this scenario,Swich 15 is the best choice for the root switch of the network for all the VLANs because Swich 15 is the backbone switch.

在这个实验中switch 15 将成为各VLAN 的根,switch 15 为骨干交换机。

2 Issue the set spantree root vlan_id command in order to set priority of the switch to 8192 for the

VLAN or  VLANs that the vlan_id specifies.

使用 spantree root vlan_id 这个命令将各VLAN中交换机的优先级更改为8192。

Note: The default priority for switches is 32768. When you set the priority with this command,you force the selection of switch 15 as the root switch because Switch 15 has the lowest

priority.

交换机的自定义优先级为32768。使用命令强制改低优先级的值使之成为根交换机。

Switch-15> (enable) set spantree root 1

VLAN 1 bridge priority set to 8192

VLAN 1 bridge max aging time set to 20

VLAN 1 bridge hello time set to 2

VLAN 1 bridge forward delay set to 15

Switch is now the root switch for active VLAN 1

Switch-15> (enable)

Switch-15> (enable) set spantree root 200

Switch is now the root switch for active VLAN 200

Switch-15> (enable) set spantree root 201

Switch is now the root switch for active VLAN 201

Switch-15> (enable) set spantree root 202

Switch is now the root switch for active VLAN 202

Switch-15> (enable) set spantree root 203

Switch is now the root switch for active VLAN 203

Switch-15> (enable) set spantree root 204

Switch is now the root switch for active VLAN 204

The shorter version of the command has the same effect, as this example shows:

一种简单的写法

Switch-15> (enable) set spantree root 1,200-204

VLAN 1,200-204 bridge priority set to 8192

VLAN 1,200-204 bridge max aging time set to 20

VLAN 1,200-204 bridge hello time set to 2

VLAN 1,200-204 bridge forward delay set to 15

Switch is now the root switch for active VLAN 1,200-204

The set spantree priority command provides a third method to specify the root switch:

第三种写法

Switch-15> (enable) set spantree priority 8192 1

Spantree 1 bridge priority set to 8192

Note: In this scenario, all the switches started with cleared configurations.Therefore, all the switches started with a bridge priority of 32768. If you are not certain that all the switches in your

network have a priority that is greater than 8192,set the priority of your desired root birdge to 1.

交换机在初始时优先级都为32768。如果你想使一个交换机成为根,但又不能确定网络中的优先级值都高于8192,你可以将交换机优先级设为1。

3 Issue the set spantree portfast mod_num/port _num enable command in order to configure the portfast setting on swtiches 12,13,14,16,and 17.

在12 13 14 16 17 依次配置portfast

Note: Only configure this setting on ports that connect to workstations or PCs. Do not enable portfast on any port that connects to another switch.

portfast 只能配置在连接PC终端的接口上。不能配置在连接交换机的接口上。

This example only configure switch 12. You can configure other switches in the same way. Switch

12 has these port connections:

只配置交换机12做为例子。交换机12连接着以下端口:

   port 2/1 connects to swtich 13.

   port 2/2 connects to swtich 15.

   port 2/3 connects to swtich 16.

   port 3/1 through 3/24 connect to pcs

   port 4/1 through 4/24 connect to UNIX workstatons

  With this information as a basis, issue the set spantree portfast command on ports 3/1 through 3/24 and on ports 4/1 through 4/24:

     Switch-12> (enable) set spantree portfast 3/1-24 enable

     Waring:Spantree port fast start should only be enabled on ports connected to a single host. Connecting hubs, concentrators ,switches ,bridge , etc. to a fast start port can cause temporary spanning-tree loops. Use with caution.

Spantree ports 3/1-24 fast start enable.

Swtich-12> (enable) set spantree portfast 4/1-24 enable

Warning: Spantree port fast start should only be enable on ports connected to a single host. Connecting hubs, concentrators, switches, bridge , etc. to  fast start port can cause temporary spanning-tree loops.Use with caution.

Spantree ports 4/1-24 fast start enabled.

Switch-12> (enable)

4 Issue the show spantree vlan_id command in order to verify that Switch 15 is the root of all the appropriate VLANs.

使用 show spanntree vlan_id 来判断switch 15 是否是各VLAN 的根

Switch-15> (enable) show spantree 1

VLAN1

spanning-tree enable

spanning-tree type                            ieee

Designated root                                 00-10-0d-b1-78-00

!--This is the MAC address of the root switch for VLAN1.

Designated root priority                  8192

Designated root cost                        0

Designated root port                       1/0

Root  MAX Age     20  sec             Hello Time 2 sec            Forward Delay 15 sec

Bridge ID MAC ADDR                  00-10-0d-b1-78-00

Bridge ID priority                            8192

Bridge MAX Age    20 sec            Hello Time 2 sec             Forward Delay  15  sec

This output shows that Switch 15 is the designated root on spanning tree for VLAN1. The MAC

address of the designated root switch, 00-10-0d-b1-78-00, is the same as the bridge ID MAC address of  Switch 15, 00-10-0d-b1-78-00. Another indicator that this switch is the designated root

is that the designated root port is 1/0.

输出显示交换机15是vlan1 的根。根交换机的MAC地址和指定交换机的MC地址都是 00-10-0d-b1-78-00。另外还显示了根端口 1/0。

In this output from Switch 12, the Switch recognizes Switch 15 as the Designated Root for VLAN1:

在交换机12验证交换机15是根

Switch-12 > (enable) show spantree 1

VLAN 1

spanning-tree type                     ieee

Designated Root                        00-10-0d-b1-78-00

!-- This is the MAC  address of the root swtich for VLAN1.

Designated Root Priority    8192

Designated Root Cost         19

Designated Root Por t         2/3

Root Max Age        20   sec         Hello Time    2  sec   Forward  Delay 15 sec

Bridge ID MAC  ADDR       00-10-0d-b2-8c-00

Bridge IDPriority                   32768

Bridge Max Age 20  sec             Hello  Time  2 sec        Forward  Delay  15 sec

Note:The output of the show spantree vlan_id command for the other switches and VLANs can also indicate that switch 15 is the descignated root for all VLANs.

输出显示在不同的交换机上显示相同VLAN 的根是相同的

继续阅读