CCIE思科教育培训 CCIE培训

CCNA实验五:生成树协议STP

一、实验拓扑

 

二、配置生成树协议STP

  1. 查看三台交换机上的生成树建立情况

SW1

SW1#show spanning-tree vlan 1

VLAN0001

  Spanning tree enabled protocol ieee

  Root ID    Priority    32769

             Address     0001.C7B1.9138

             Cost        19

             Port        1(FastEthernet0/1)

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

 

  Bridge ID  Priority    32769  (priority 32768 sys-id-ext 1)

             Address     000A.4195.78C9

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

             Aging Time  20

 

Interface        Role Sts Cost      Prio.Nbr Type

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

Fa0/1            Root FWD 19        128.1    P2p  /Fa0/1端口为根端口

Fa0/2            Desg FWD 19        128.2    P2p  /Fa0/2端口为指定端口

 

 

SW2

SW2#show spanning-tree vlan 1

VLAN0001

  Spanning tree enabled protocol ieee

  Root ID    Priority    32769

             Address     0001.C7B1.9138

             This bridge is the root   /该交换机为根桥,根桥的所有端口都为指定端口

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

 

  Bridge ID  Priority    32769  (priority 32768 sys-id-ext 1)

             Address     0001.C7B1.9138

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

             Aging Time  20

 

Interface        Role Sts Cost      Prio.Nbr Type

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

Fa0/2            Desg FWD 19        128.2    P2p  /Fa0/1端口为指定端口

Fa0/1            Desg FWD 19        128.1    P2p  /Fa0/2端口为指定端口

 

 

 

SW3

SW3#show spanning-tree vlan 1

VLAN0001

  Spanning tree enabled protocol ieee

  Root ID    Priority    32769

             Address     0001.C7B1.9138

             Cost        19

             Port        1(FastEthernet0/1)

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

 

  Bridge ID  Priority    32769  (priority 32768 sys-id-ext 1)

             Address     00E0.F7BC.D5C9

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

             Aging Time  20

 

Interface        Role Sts Cost      Prio.Nbr Type

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

Fa0/2            Altn BLK 19        128.2    P2p  /Fa0/2端口为阻塞端口

Fa0/1            Root FWD 19        128.1    P2p  /Fa0/1端口为根端口

 

  1. 交换机自动建立的生成树中SW2为根桥,实际中我们更希望性能更高的三层交换机SW1来担任根桥的重任,所以要手动将SW1交换机指定为根桥,可以通过修改桥ID来实现。桥ID4096的整数倍,交换机会提示我们都有哪些合法的值。www.it165.net

SW1

SW1(config)#spanning-tree vlan 1 priority 123    /修改交换机的优先级

% Bridge Priority must be in increments of 4096.

% Allowed values are:

  0     4096  8192  12288 16384 20480 24576 28672

  32768 36864 40960 45056 49152 53248 57344 61440

SW1(config)#

当指定的优先级数值不符合要求时,交换机便会给出合法的值

 

SW1(config)#spanning-tree vlan 1 priority 4096 /SW1优先级设置为4096

 

 

 

现在可以看到SW3的两个端口都变为橘黄色,此时生成树协议正在重新计算生成树,重新制定端口的状态

 

 

生成树重新建立完成,SW1成为根桥

SW1#show spanning-tree vlan 1

VLAN0001

  Spanning tree enabled protocol ieee

  Root ID    Priority    4097

             Address     000A.4195.78C9

             This bridge is the root

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

 

  Bridge ID  Priority    4097  (priority 4096 sys-id-ext 1)

             Address     000A.4195.78C9

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

             Aging Time  20

 

Interface        Role Sts Cost      Prio.Nbr Type

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

Fa0/1            Desg FWD 19        128.1    P2p

Fa0/2            Desg FWD 19        128.2    P2p

 

另一种方法设置根桥:

SW1(config)#spanning-tree vlan 1 root primary

此命令是将该根桥的优先级从现有网络环境中的最小优先级上再减掉4096,直接将该交换机设为根桥。



Tags:

发布: admin 分类: CCIE思科 评论: 0 浏览: 69
留言列表
发表留言
◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。