实验步骤按照顺序来
1.SWA配置
SWA#conf t
SWA(config)#int rang f0/1 - 2
SWA(config-if-range)#switchport mode trunk
SWA(config-if-range)#channel-group 1 mode on
SWA(config-if-range)#exit
SWA(config)#int range f0/14 - 15
SWA(config-if-range)#switchport mode trunk
SWA(config-if-range)#end
SWA#vlan database
SWA(vlan)#vlan 2
SWA(vlan)#vlan 3
SWA(vlan)#vlan 4
SWA(vlan)#vtp server
SWA(vlan)#vtp domain sy
SWA(vlan)#vtp password cisco
SWA(vlan)#vtp pruning
SWA(vlan)#exit

2.SWB配置
SWB#conf t
SWB(config)#int range f0/1 - 2
SWB(config-if-range)#switchport mode trunk
SWB(config-if-range)#channel-group 1 mode on
SWB(config-if-range)#exit
SWB(config)#int range f0/14 - 15
SWB(config-if-range)#switchport mode trunk
SWB(config-if-range)#end
SWB#vlan database
SWB(vlan)#vtp server
SWB(vlan)#vtp domain sy
SWB(vlan)#vtp password cisco
SWB(vlan)#exit

3.SWC配置
SWC#conf t
SWC(config)#int range f0/14 - 15
SWC(config-if-range)#switchport mode trunk
SWC(config-if-range)#end
SWC#vlan database
SWC(vlan)#vtp client
SWC(vlan)#vtp domain sy
SWC(vlan)#vtp password cisco
SWC(vlan)#exit
SWC#show spanning-tree
Port 15 (FastEthernet0/14) of VLAN1 is forwarding
Port 16 (FastEthernet0/15) of VLAN1 is blocking
Port 15 (FastEthernet0/14) of VLAN2 is forwarding
Port 16 (FastEthernet0/15) of VLAN2 is blocking
Port 15 (FastEthernet0/14) of VLAN3 is blocking
Port 16 (FastEthernet0/15) of VLAN3 is forwarding
Port 15 (FastEthernet0/14) of VLAN4 is blocking
Port 16 (FastEthernet0/15) of VLAN4 is forwarding
4.SWD配置
SWD#conf t
SWD(config)#int range f0/14 - 15
SWD(config-if-range)#switchport mode trunk
SWD(config-if-range)#end
SWD#vlan database
SWD(vlan)#vtp client
SWD(vlan)#vtp domain sy
SWD(vlan)#vtp password cisco
SWD(vlan)#exit
SWD#show vtp status

VTP Version                     : 2
Configuration Revision          : 2
Maximum VLANs supported locally : 256
Number of existing VLANs        : 9
VTP Operating Mode              : Client
VTP Domain Name                 : sy
VTP Pruning Mode                : Enabled
VTP V2 Mode                     : Disabled
VTP Traps Generation            : Disabled
MD5 digest                      : 0xF8 0xB6 0x3B 0x3A 0xF4 0xBF 0xD9 0x1E
Configuration last modified by 0.0.0.0 at 3-1-02 00:20:36
SWD#show vlan-sw brief
VLAN Name                             Status    Ports
---- -------------------------------- --------- -------------------------------
1    default                          active    Fa0/0, Fa0/1, Fa0/2, Fa0/3
                                                Fa0/4, Fa0/5, Fa0/6, Fa0/7
                                                Fa0/8, Fa0/9, Fa0/10, Fa0/11
                                                Fa0/12, Fa0/13
2    VLAN0002                         active   
3    VLAN0003                         active   
4    VLAN0004                         active  
     
1002 fddi-default                     active   
1003 token-ring-default               active   
1004 fddinet-default                  active   
1005 trnet-default                    active
SWD#conf t
SWD(config)#int f0/2
SWD(config-if)#switchport access vlan 2
SWD(config-if)#end
SWD#conf t
SWD(config)#spanning-tree uplinkfast
SWD(config)#int  range f0/1 - 13
SWD(config-if-range)#spanning-tree portfast
SWD(config-if-range)#end
SWD#show spanning-tree summary

   UplinkFast is enabled
SWD#show spanning-tree interface f0/2
   The port is in the portfast mode
SWD#show spanning-tree
Port 15 (FastEthernet0/14) of VLAN1 is blocking
Port 16 (FastEthernet0/15) of VLAN1 is forwarding
Port 15 (FastEthernet0/14) of VLAN2 is blocking
Port 16 (FastEthernet0/15) of VLAN2 is forwarding
Port 15 (FastEthernet0/14) of VLAN3 is forwarding
Port 16 (FastEthernet0/15) of VLAN3 is blocking
Port 15 (FastEthernet0/14) of VLAN4 is forwarding
Port 16 (FastEthernet0/15) of VLAN4 is blocking
5.SWC配置
SWC#conf t
SWC(config)#int f0/2
SWC(config-if)#switchport access vlan 2
SWC(config-if)#end
SWC#conf t
SWC(config)#spanning-tree uplinkfast 
SWC(config)#int range f0/1 - 13
SWC(config-if-range)#spanning-tree portfast

SWC#show spanning-tree summary
   UplinkFast is enabled
SWC#show spanning-tree interface fastEthernet 0/2
   The port is in the portfast mode
6.SWB配置
SWB#conf t
SWB(config)#spanning-tree vlan 3 root primary
SWB(config)#spanning-tree vlan 4 root primary
SWB(config)#end
SWB#show spanning-tree summary
Root bridge for: VLAN3, VLAN4.
7.SWA配置
SWA#conf t
SWA(config)#spanning-tree vlan 2 root primary
SWA(config)#spanning-tree vlan 1 root primary
SWA(config)#end
SWA#show spanning-tree summary

Root bridge for: VLAN1, VLAN2.
8.客户机配置
HostA(VLAN2):
IP:192.168.1.2/24
HostB(VLAN2):
ip:192.168.1.3/24
9.测试:
HostA#ping 192.168.1.3
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.1.3, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 68/127/144 ms