实验目的:

1、掌握PVST的基本配置。

2、理解PVST的负载均衡原理。

实验拓扑:

实验步骤:

1、依据图中拓扑部署PVST技术,其中SW1为VLAN10的Root,VLAN20的Secondary,SW2为VLAN20的Root,VLAN10的Secondary,配置如下:

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

SW1(config)#spanning-tree vlan 20 root secondary

SW2(config)#spanning-tree vlan 20 root primary

SW2(config)#spanning-tree vlan 10 root secondary

2、查看STP状态,如下:

SW1上:

SW1#show spanning-tree vlan 10 brief

                                     

VLAN10

  Spanning tree enabled protocol ieee

  Root ID    Priority    8192

             Address     cc05.0810.0001

             This bridge is the root

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


  Bridge ID  Priority    8192

             Address     cc05.0810.0001

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

             Aging Time 300


Interface                                   Designated

Name                 Port ID Prio Cost  Sts Cost  Bridge ID            Port ID

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

FastEthernet0/0      128.1    128    19 FWD     0  8192 cc05.0810.0001 128.1 

FastEthernet0/1      128.2    128    19 FWD     0  8192 cc05.0810.0001 128.2

可以看到,SW1已经成为VLAN 10的主根。

SW2上:

SW2#show spanning-tree vlan 20 brief


VLAN20

  Spanning tree enabled protocol ieee

  Root ID    Priority    8192

             Address     cc06.0810.0002

             This bridge is the root

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


  Bridge ID  Priority    8192

             Address     cc06.0810.0002

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

             Aging Time 300


Interface                                   Designated

Name                 Port ID Prio Cost  Sts Cost  Bridge ID            Port ID

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

FastEthernet0/0      128.1    128    19 FWD     0  8192 cc06.0810.0002 128.1 

FastEthernet0/2      128.3    128    19 FWD     0  8192 cc06.0810.0002 128.3 

可以看到,SW2已经成为VLAN 20的主根。

SW3上:

SW3#show spanning-tree vlan 10 brief


VLAN10

  Spanning tree enabled protocol ieee

  Root ID    Priority    8192

             Address     cc05.0810.0001

             Cost        19

             Port        2 (FastEthernet0/1)

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


  Bridge ID  Priority    32768

             Address     cc07.0810.0001

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

             Aging Time 300


Interface                                   Designated

Name        Port ID  Prio   Cost Sts   Cost  Bridge ID  Port ID

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

FastEthernet0/1 128.2   128   19  FWD   0  8192  cc05.0810.0001  128.2 

FastEthernet0/2 128.3   128   19  BLK   19  16384 cc06.0810.0001  128.3  

 

SW3#show spanning-tree vlan 20 brief


VLAN20

  Spanning tree enabled protocol ieee

  Root ID    Priority    8192

             Address     cc06.0810.0002

             Cost        19

             Port        3 (FastEthernet0/2)

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


  Bridge ID  Priority    32768

             Address     cc07.0810.0002

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

             Aging Time 300


Interface                                   Designated

Name         Port ID  Prio   Cost Sts   Cost  Bridge ID  Port ID

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

FastEthernet0/1 128.2    128    19 BLK    19 16384 cc05.0810.0002 128.2 

FastEthernet0/2 128.3    128    19 FWD     0  8192 cc06.0810.0002 128.3 

从上面可以看到,SW3在VLAN10所在生成树中阻塞F0/2,在VLAN20所在生成树阻塞F0/1,通过此方法可以实现负载均衡。此实验完成。