码迷,mamicode.com
首页 > 其他好文 > 详细

Lab - Per-VLAN Spanning Tree Behavior

时间:2015-09-03 17:53:03      阅读:193      评论:0      收藏:0      [点我收藏+]

标签:

Per-VLAN Spanning Tree Behavior

Topology

技术分享

 

 

Objectives:

  • Observe the behavior of a separate spanning tree instance per VLAN.
  • Change spanning tree mode to rapid spanning tree.

 

Background:

Four switches have just been installed. The distribution layer switches are Catalyst 3560s, and the access layer switches are Catalyst 2960s. There are redundant uplinks between the access layer and distribution layer. Because of the possibility of bridging loops, spanning tree logically removes any redundant links. In this lab, you will see what happens when spanning tree is configured differently for different VLANs.

 

Step 1: Prepare the switches for the lab.

  1. Delete vlan.dat file, erase the startup config, and reload the switches.
  2. Give each switch a hostname according to the topology diagram.
  3. Configure ports f0/7 through f0/12 on all switches to be trunks. On the 3560, first set the trunk encapsulation to dot1q. On the 2960s, only dot1q is supported, therefore the switchport trunk encapsulation command is unavailable, but the mode stll needs to be changed to trunk. If you do not set the mode of the ports to trunk, they will negotiate the operational mode according to their default DTP settings.
All Switches:
interface range f0/7-12
switchport trunk encapsulation dot1q
switchport mode trunk

 

 


Step 2: Configure the VTP.

a. Configure all switches with VTP mode transparent and VTP domain CISCO. Add VLAN 10 and 20 to all of them. Use the show vlan brief command to view the VLAN configurations.

All Switch:
vtp mode transparent
vtp domain CISCO
vlan 10,20

IOU1#show vlan brief

VLAN Name                             Status    Ports
---- -------------------------------- --------- -------------------------------
1    default                          active    Et1/2, Et1/3, Et2/0, Et2/1
                                                Et2/2, Et2/3, Et3/0, Et3/1
                                                Et3/2, Et3/3
10   VLAN0010                         active    
20   VLAN0020                         active    
1002 fddi-default                     act/unsup
1003 token-ring-default               act/unsup
1004 fddinet-default                  act/unsup
1005 trnet-default                    act/unsup

 

 

b. Issue the show spanning-tree command on any of the four switches. Notice that instead of just one VLAN there are non-reserved VLAN. VLAN 1002-1005 are reserved for internal switch usage. All other VLAN shown are non-reserved.

Note: By default Cisco switches use PVST+, a Cisco-proprietary IEEE 802.1Q-compatible per-VLAN spanning tree protocol.

IOU1#show spanning-tree

VLAN0001
  Spanning tree enabled protocol ieee
  Root ID    Priority    32769
             Address     aabb.cc00.0100
             Cost        100
             Port        1 (Ethernet0/0)
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

  Bridge ID  Priority    32769  (priority 32768 sys-id-ext 1)
             Address     aabb.cc00.0500
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time  300 sec

Interface           Role Sts Cost      Prio.Nbr Type
------------------- ---- --- --------- -------- --------------------------------
Et0/0               Root FWD 100       128.1    Shr 
Et0/1               Altn BLK 100       128.2    Shr 
Et0/2               Altn BLK 100       128.3    Shr 
Et0/3               Altn BLK 100       128.4    Shr 
Et1/0               Altn BLK 100       128.5    Shr 
Et1/1               Altn BLK 100       128.6    Shr 
Et1/2               Desg FWD 100       128.7    Shr 
Et1/3               Desg FWD 100       128.8    Shr 
Et2/0               Desg FWD 100       128.9    Shr 
Et2/1               Desg FWD 100       128.10   Shr 
Et2/2               Desg FWD 100       128.11   Shr 
Et2/3               Desg FWD 100       128.12   Shr 
Et3/0               Desg FWD 100       128.13   Shr 
Et3/1               Desg FWD 100       128.14   Shr 
Et3/2               Desg FWD 100       128.15   Shr 
Et3/3               Desg FWD 100       128.16   Shr 


          
VLAN0010
  Spanning tree enabled protocol ieee
  Root ID    Priority    32778
             Address     aabb.cc00.0100
             Cost        100
             Port        1 (Ethernet0/0)
             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.0500
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time  300 sec

Interface           Role Sts Cost      Prio.Nbr Type
------------------- ---- --- --------- -------- --------------------------------
Et0/0               Root FWD 100       128.1    Shr 
Et0/1               Altn BLK 100       128.2    Shr 
Et0/2               Altn BLK 100       128.3    Shr 
Et0/3               Altn BLK 100       128.4    Shr 
Et1/0               Altn BLK 100       128.5    Shr 
Et1/1               Altn BLK 100       128.6    Shr 

          
          
VLAN0020
  Spanning tree enabled protocol ieee
  Root ID    Priority    32788
             Address     aabb.cc00.0100
             Cost        100
             Port        1 (Ethernet0/0)
             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.0500
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time  300 sec

Interface           Role Sts Cost      Prio.Nbr Type
------------------- ---- --- --------- -------- --------------------------------
Et0/0               Root FWD 100       128.1    Shr 
Et0/1               Altn BLK 100       128.2    Shr 
Et0/2               Altn BLK 100       128.3    Shr 
Et0/3               Altn BLK 100       128.4    Shr 
Et1/0               Altn BLK 100       128.5    Shr 
Et1/1               Altn BLK 100       128.6    Shr

 

 

Step 3: Assign a root switch for each VLAN.

Notice that all the ports have identical spanning tree behavior for each VLAN. This is because all VLANs are running spanning tree with the default behavior. However, you can modify the default spanning tree behavior on a per-VLAN basis. The default priority is 32768. Configuring a switch with a lower priority value for a given VLAN makes it the root bridge for that VLAN. For this lab, we assign DLS1 as the root bridge for VLAN 10, and DLS2 for VLAN 20.

DLS1(config)#spanning-tree vlan 10 priority 4096

DLS2(config)#spanning-tree vlan 20 priority 4096

 

 

IOU1#show spanning-tree

VLAN0001
  Spanning tree enabled protocol ieee
  Root ID    Priority    32769
             Address     aabb.cc00.0100
             Cost        100
             Port        1 (Ethernet0/0)
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

  Bridge ID  Priority    32769  (priority 32768 sys-id-ext 1)
             Address     aabb.cc00.0500
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time  300 sec

Interface           Role Sts Cost      Prio.Nbr Type
------------------- ---- --- --------- -------- --------------------------------
Et0/0               Root FWD 100       128.1    Shr 
Et0/1               Altn BLK 100       128.2    Shr 
Et0/2               Altn BLK 100       128.3    Shr 
Et0/3               Altn BLK 100       128.4    Shr 
Et1/0               Altn BLK 100       128.5    Shr 
Et1/1               Altn BLK 100       128.6    Shr 
Et1/2               Desg FWD 100       128.7    Shr 
          
Interface           Role Sts Cost      Prio.Nbr Type
------------------- ---- --- --------- -------- --------------------------------

Et1/3               Desg FWD 100       128.8    Shr 
Et2/0               Desg FWD 100       128.9    Shr 
Et2/1               Desg FWD 100       128.10   Shr 
Et2/2               Desg FWD 100       128.11   Shr 
Et2/3               Desg FWD 100       128.12   Shr 
Et3/0               Desg FWD 100       128.13   Shr 
Et3/1               Desg FWD 100       128.14   Shr 
Et3/2               Desg FWD 100       128.15   Shr 
Et3/3               Desg FWD 100       128.16   Shr 


          
VLAN0010
  Spanning tree enabled protocol ieee
  Root ID    Priority    4106
             Address     aabb.cc00.0500
             This bridge is the root
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

  Bridge ID  Priority    4106   (priority 4096 sys-id-ext 10)
             Address     aabb.cc00.0500
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time  15  sec

Interface           Role Sts Cost      Prio.Nbr Type
------------------- ---- --- --------- -------- --------------------------------
Et0/0               Desg FWD 100       128.1    Shr 
Et0/1               Desg FWD 100       128.2    Shr 
Et0/2               Desg FWD 100       128.3    Shr 
Et0/3               Desg FWD 100       128.4    Shr 
Et1/0               Desg FWD 100       128.5    Shr 
Et1/1               Desg FWD 100       128.6    Shr 


          
VLAN0020
  Spanning tree enabled protocol ieee
  Root ID    Priority    4116
             Address     aabb.cc00.0100
             Cost        100
             Port        1 (Ethernet0/0)
             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.0500
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time  300 sec

Interface           Role Sts Cost      Prio.Nbr Type
------------------- ---- --- --------- -------- --------------------------------
Et0/0               Root FWD 100       128.1    Shr 
Et0/1               Altn BLK 100       128.2    Shr 
Et0/2               Altn BLK 100       128.3    Shr 
Et0/3               Altn BLK 100       128.4    Shr 
Et1/0               Altn BLK 100       128.5    Shr 
Et1/1               Altn BLK 100       128.6    Shr 

 

 

IOU2#show spanning-tree

VLAN0001
  Spanning tree enabled protocol ieee
  Root ID    Priority    32769
             Address     aabb.cc00.0100
             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     aabb.cc00.0100
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time  300 sec

Interface           Role Sts Cost      Prio.Nbr Type
------------------- ---- --- --------- -------- --------------------------------
Et0/0               Desg FWD 100       128.1    Shr 
Et0/1               Desg FWD 100       128.2    Shr 
Et0/2               Desg FWD 100       128.3    Shr 
Et0/3               Desg FWD 100       128.4    Shr 
Et1/0               Desg FWD 100       128.5    Shr 
Et1/1               Desg FWD 100       128.6    Shr 
Et1/2               Desg FWD 100       128.7    Shr 
Et1/3               Desg FWD 100       128.8    Shr 
Et2/0               Desg FWD 100       128.9    Shr 
Et2/1               Desg FWD 100       128.10   Shr 
Et2/2               Desg FWD 100       128.11   Shr 
Et2/3               Desg FWD 100       128.12   Shr 
Et3/0               Desg FWD 100       128.13   Shr 
Et3/1               Desg FWD 100       128.14   Shr 
Et3/2               Desg FWD 100       128.15   Shr 
Et3/3               Desg FWD 100       128.16   Shr 


          
VLAN0010
  Spanning tree enabled protocol ieee
  Root ID    Priority    4106
             Address     aabb.cc00.0500
             Cost        100
             Port        1 (Ethernet0/0)
             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.0100
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time  300 sec

Interface           Role Sts Cost      Prio.Nbr Type
------------------- ---- --- --------- -------- --------------------------------
Et0/0               Root FWD 100       128.1    Shr 
Et0/1               Altn BLK 100       128.2    Shr 
Et2/0               Desg FWD 100       128.9    Shr 
Et2/1               Desg FWD 100       128.10   Shr 
Et2/2               Desg FWD 100       128.11   Shr 
Et2/3               Desg FWD 100       128.12   Shr 

          
          
VLAN0020
  Spanning tree enabled protocol ieee
  Root ID    Priority    4116
             Address     aabb.cc00.0100
             This bridge is the root
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

  Bridge ID  Priority    4116   (priority 4096 sys-id-ext 20)
             Address     aabb.cc00.0100
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time  300 sec

Interface           Role Sts Cost      Prio.Nbr Type
------------------- ---- --- --------- -------- --------------------------------
Et0/0               Desg FWD 100       128.1    Shr 
Et0/1               Desg FWD 100       128.2    Shr 
Et2/0               Desg FWD 100       128.9    Shr 
Et2/1               Desg FWD 100       128.10   Shr 
Et2/2               Desg FWD 100       128.11   Shr 
Et2/3               Desg FWD 100       128.12   Shr 

 

 

Step 4: Cofigure RSTP

Other spanning tree modes besides PVST+ are available. One of these is RSTP (rapid spanning tree protocol), which greatly reduces the time for a port to transition to forwarding state while still preventing bridging loops. Cisco-proprietary per-VLAN rapid spanning tree (PVRST+) combines the functionality of RSTP and PVST.

 

Note: You can use the clear spanning-tree detected-protocols command after configuring different spanning tree modes. This can avoid a mutual deadlock between two switches when they consider themselves as 802.1D legacy bridges when in fact they were configured for RSTP.

 

a. To change the spanning tree mode to PVST+, use the global configuration command spanning-tree mode rapid-pvst. Configure this on all four switches. During the transition period, rapid spanning tree falls back to 802.1D spanning tree on the links that have 802.1D spanning tree configured on one side.

All switches:
spanning-tree mode rapid-pvst

 

 

challenge:

a. On each switch, add VLAN 50,60,70,80.90,100. Configure ALS1 to be the root bridge for VLAN 50,60,70. and ALS2 to be the root bridge for VLAN 80,90 and 100. Configure the root bridges with a single line on each switch.

 

HINT: Use the question mark when you type the global configuration command spanning-tree vlan?. Notice that you can modify spanning tree attributes in ranges.

 

b. Change the spanning tree cost of VLAN20 on f0/11 and f0/12 between DLS1 AND DLS2 TO 15.

 

Lab - Per-VLAN Spanning Tree Behavior

标签:

原文地址:http://www.cnblogs.com/elewei/p/4780369.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!