1.首先完成三个交换机各个接口的绑定。
SW1(config)#int range e0/0-1
SW1(config-if-range)#channel-group 12 mode on
Creating a port-channel interface Port-channel 12
SW1(config-if-range)#exit
SW1(config)#int port-channel 12
SW1(config-if)#switchport trunk encapsulation dot1q
SW1(config-if)#switchport mode trunk
SW1(config-if)#exit
SW1(config-if-range)#switchport trunk encapsulation dot1q
SW1(config-if-range)#switchport mode trunk
SW1(config)#int range e0/2-3
SW1(config-if-range)#channel-group 13 mode on
Creating a port-channel interface Port-channel 13
SW1(config-if-range)#exit
SW1(config)#
SW1(config)#int port-channel 13
SW1(config-if)#SWitchport trunk encapsulation dot1q
SW1(config-if)#switchport mode trunk
SW1(config-if)#exit
SW1(config)#int range e0/2-3
SW1(config-if-range)#switchport trunk encapsulation dot1q
SW1(config-if-range)#switchport mode trunk
SW1(config-if-range)#shutdown
SW1(config#int range e0/0-3
SW1(config-if-range)#no shut
SW2(config)#int range e0/0-1
SW2(config-if-range)#channel-group 12 mode on
Creating a port-channel interface Port-channel 12
SW2(config)#int port-channel 12
SW2(config-if)#switchport trunk encapsulation dot1q
SW2(config-if)#switchport mode trunk
SW2(config-if)#ex
SW2(config)#int range e0/0-1
SW2(config-if-range)#switchport trunk encapsulation dot1q
SW2(config-if-range)#switchport mode trunk
SW2(config-if-range)#shutdown
SW2(config)#int range e0/2-3
SW2(config-if-range)#channel-group 23 mode on
Creating a port-channel interface Port-channel 23
SW2(config)#int port-channel 23
SW2(config-if)#switchport trunk encapsulation dot1q
SW2(config-if)#switchport mode trunk
SW2(config-if)#exit
SW2(config)#int range e0/2-3
SW2(config-if-range)#switchport trunk encapsulation dot1q
SW2(config-if-range)#switchport mode t
SW2(config-if-range)#switchport mode trunk
SW2(config-if-range)#no shut
SW2(config-if-range)#ex
SW2(config)#int range e0/0-3
SW2(config-if-range)#no shut
SW3(config)#int range e0/0-1
SW3(config-if-range)#channel-group 13 mode on
Creating a port-channel interface Port-channel 13
SW3(config)#int port-channel 13
SW3(config-if)#switchport trunk encapsulation dot1q
SW3(config-if)#switchport mode trunk
SW3(config-if)#exit
SW3(config)#int range e0/0-1
SW3(config-if-range)#switchport mode trunk
SW3(config-if-range)#switchport trunk encapsulation dot1q
SW3(config-if-range)#switchport mode trunk
SW3(config-if-range)#shutdown
SW3(config)#int range e0/2-3
SW3(config-if-range)#channel-group 23 mode on
Creating a port-channel interface Port-channel 23
SW3(config-if-range)#ex
SW3(config)#int port-channel 23
SW3(config-if)#switchport trunk encapsulation dot1q
SW3(config-if)#switchport mode trunk
SW3(config-if)#ex
SW3(config)#int range e0/2-3
SW3(config-if-range)#switchport trunk encapsulation dot1q
SW3(config-if-range)#switchport mode trunk
SW3(config-if-range)#shut
SW3(config-if-range)#ex
SW3(config)#int range e0/0-3
SW3(config-if-range)#no shut
SW1#show int trunk 查看命令
Port Mode Encapsulation Status Native vlan
Po12 on 802.1q trunking 1
Po13 on 802.1q trunking 1
SW1#show etherchannel summary 查看命令
------+-------------+-----------+-----------------------------------------------
12 Po12(SU) - Et0/0(P) Et0/1(P)
13 Po13(SU) - Et0/2(P) Et0/3(P)
2.设置PVRST+快速生成树rapid-pvst。
SW1(config)#vlan 10
SW1(config-vlan)#vlan 20
SW1(config)#spanning-tree mode rapid-pvst
SW1(config)#spanning-tree vlan 10 root primary
SW1(config)#spanning-tree vlan 20 root secondary
SW1#show spanning-tree vlan 10
VLAN0010
Spanning tree enabled protocol rstp
Root ID Priority 24586
Address aabb.cc00.1000
This bridge is the root
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Bridge ID Priority 24586 (priority 24576 sys-id-ext 10)
Address aabb.cc00.1000
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Aging Time 300 sec
Interface Role Sts Cost Prio.Nbr Type
------------------- ---- --- --------- -------- --------------------------------
Po12 Desg FWD 56 128.65 Shr
Po23 Desg FWD 56 128.66 Shr
SW1#show spanning-tree vlan 20
VLAN0020
Spanning tree enabled protocol rstp
Root ID Priority 24596
Address aabb.cc00.2000
Cost 56
Port 65 (Port-channel12)
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Bridge ID Priority 28692 (priority 28672 sys-id-ext 20)
Address aabb.cc00.1000
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Aging Time 300 sec
Interface Role Sts Cost Prio.Nbr Type
------------------- ---- --- --------- -------- --------------------------------
Po12 Root FWD 56 128.65 Shr
Po23 Desg FWD 56 128.66 Shr
SW2(config)#vlan 10
SW2(config-vlan)#vlan 20
SW2(config-vlan)#ex
SW2(config)#spanning-tree mode rapid-pvst
SW2(config)#spanning-tree vlan 20 root primary
SW2(config)#spanning-tree vlan 10 root secondary
SW2#show spanning-tree vlan 10
VLAN0010
Spanning tree enabled protocol rstp
Root ID Priority 24586
Address aabb.cc00.1000
Cost 56
Port 65 (Port-channel12)
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Bridge ID Priority 28682 (priority 28672 sys-id-ext 10)
Address aabb.cc00.2000
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Aging Time 300 sec
Interface Role Sts Cost Prio.Nbr Type
------------------- ---- --- --------- -------- --------------------------------
Po12 Root FWD 56 128.65 Shr
Po23 Desg FWD 56 128.66 Shr
SW2#show spanning-tree vlan 20
VLAN0020
Spanning tree enabled protocol rstp
Root ID Priority 24596
Address aabb.cc00.2000
This bridge is the root
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Bridge ID Priority 24596 (priority 24576 sys-id-ext 20)
Address aabb.cc00.2000
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Aging Time 300 sec
Interface Role Sts Cost Prio.Nbr Type
------------------- ---- --- --------- -------- --------------------------------
Po12 Desg FWD 56 128.65 Shr
Po23 Desg FWD 56 128.66 Shr
SW3(config)#vlan 10
SW3(config-vlan)#vlan 20
SW3(config-vlan)#ex
SW3(config)#spanning-tree mode rapid-pvst
SW3#show spanning-tree vlan 10
VLAN0010
Spanning tree enabled protocol rstp
Root ID Priority 24586
Address aabb.cc00.1000
Cost 56
Port 65 (Port-channel13)
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Bridge ID Priority 32778 (priority 32768 sys-id-ext 10)
Address aabb.cc00.3000
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Aging Time 300 sec
Interface Role Sts Cost Prio.Nbr Type
------------------- ---- --- --------- -------- --------------------------------
Po13 Root FWD 56 128.65 Shr
Po23 Altn BLK 56 128.66 Shr
SW3#show spanning-tree vlan 20
VLAN0020
Spanning tree enabled protocol rstp
Root ID Priority 24596
Address aabb.cc00.2000
Cost 56
Port 66 (Port-channel23)
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Bridge ID Priority 32788 (priority 32768 sys-id-ext 20)
Address aabb.cc00.3000
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Aging Time 300 sec
Interface Role Sts Cost Prio.Nbr Type
------------------- ---- --- --------- -------- --------------------------------
Po13 Altn BLK 56 128.65 Shr
Po23 Root FWD 56 128.66 Shr
3.用快速生成树mst模式。