Config Lab: RSTP Config 1
LAN switches use many default settings that work without you having to do anything, and oftentimes, you can leave those default settings as-is. However, with Spanning Tree Protocol (STP), and its better cousin Rapid STP (RSTP), you should configure some settings based on a few design goals. This config lab works through some of the more common configuration settings to influence the choice of root switch and designated ports.
The Lab Exercise
Lab Requirements
This lab begins with a working network. It shows two PCs in each of the two separate VLANs/Subnets, with a router to router packets between the subnets. In fact, if you implement the lab as shown and use only the initial configuration, all the PCs should be able to ping each other. In that case, STP/RSTP works with all default configuration settings.
(You may want to spend a little more time than usual checking out the detailed initial configuration. Also, if you plan to implement the lab for yourself in Cisco Packet Tracer or elsewhere, you may find it useful to implement the initial configuration and examine the VLANs, VLAN trunking, ROAS, and STP/RSTP behavior before performing the configuration.)
Once you understand the initial configuration, configure some common best practices for STP/RSTP in LANs. Specifically:
- Use default STP/RSTP settings unless you need the setting to implement the lab.
- Configure all switches to use per-vlan RSTP rather than per-vlan STP.
- Root Switch in VLAN 10:
- Configure switch Dist1 with a better priority than the other switches so that Dist1 becomes the root switch.
- Configure the priority setting as a specific number.
- Use the highest priority setting possible for Dist1 while ensuring that Dist1 does not tie with the other switches.
Additionally, consider the following points about the switches’ choices for Designated Ports (DPs):
- After configuring so that Dist1 becomes the root switch in VLAN 10, but with all other STP/RSTP settings as defaults, all three switches will have a root cost of 4.
- As a result, the switches will tie in their Designated Port (DP) elections for the Dist2-Access3 and Dist2-Access4 links.
- As a result, the Designated Port (DP) choices on those links use tiebreakers.
Based on those facts, also configure to achieve the following goals:
- Configure to avoid the tiebreakers for choosing any DPs by lowering the STP/RSTP port cost(s) on switch Dist2, in VLAN 10, on Dist2 port G1/1/1. (Such a change will change switch Dist2’s root cost.)
- Multiple possible cost values could be used. However, for the purposes of this lab, set the cost to one lower than the default cost for a Gigabit Ethernet interface.
Figure 1: RSTP Topology for this Lab
Initial Configuration
The four switches have no pre-configuration related to RSTP. However, all the switches use VLAN trunking on the links between switches. They also use VTP mode transparent, requiring the VLANs to be configured on each switch. So, each switch shows both VLAN 10 and 11 as preconfigured. For information about the PCs and the router, look below these next four examples.
hostname Dist1
!
vtp mode transparent
vlan 10,11
!
interface GigabitEthernet1/1/2
description Trunk link to Dist2
switchport mode trunk
!
interface GigabitEthernet1/1/3
description Trunk link to Access3
switchport mode trunk
!
interface GigabitEthernet1/1/4
description Trunk link to Access4
switchport mode trunk
!
interface GigabitEthernet1/0/1
description Trunk to R1
switchport mode trunk
Example 1: Dist1 Config
hostname Dist2
!
vtp mode transparent
vlan 10,11
!
interface GigabitEthernet1/1/1
description Trunk link to Dist1
switchport mode trunk
!
interface GigabitEthernet1/1/3
description Trunk link to Access3
switchport mode trunk
!
interface GigabitEthernet1/1/4
description Trunk link to Access4
switchport mode trunk
Example 2: Dist2 Config
hostname Access3
!
vtp mode transparent
vlan 10,11
!
interface GigabitEthernet1/1/1
description Trunk link to Dist1
switchport mode trunk
!
interface GigabitEthernet1/1/2
description Trunk link to Dist2
switchport mode trunk
!
interface GigabitEthernet1/0/11
description Access link to PC11
switchport mode access
switchport access vlan 10
!
interface GigabitEthernet1/0/21
description Access link to PC21
switchport mode access
switchport access vlan 11
Example 3: Access3 Config
hostname Access4
!
vtp mode transparent
vlan 10,11
!
interface GigabitEthernet1/1/1
description Trunk link to Dist1
switchport mode trunk
!
interface GigabitEthernet1/1/2
description Trunk link to Dist2
switchport mode trunk
!
interface GigabitEthernet1/0/12
description Access link to PC12
switchport mode access
switchport access vlan 10
!
interface GigabitEthernet1/0/22
description Access link to PC22
switchport mode access
switchport access vlan 11
Example 4: Access4 Config
The four PCs connect to two different access VLANs and subnets, as follows:
- PC11 and PC12: VLAN 10, subnet 10.1.10.0/24, gateway 10.1.10.1.
- PC21 and PC22: VLAN 11, subnet 10.1.11.0/24, gateway 10.1.11.1.
R1 uses a router-on-a-stick (ROAS) configuration to support the subnets. With the initial topology and device configurations, the PCs should be able to ping each other and the default gateway. Their initial configurations are shown next.
Address: 10.1.10.11
Mask: 255.255.255.0
Gateway: 10.1.10.1
Example 5: PC11 Configuration Settings
Address: 10.1.10.12
Mask: 255.255.255.0
Gateway: 10.1.10.1
Example 6: PC12 Configuration Settings
Address: 10.1.11.21
Mask: 255.255.255.0
Gateway: 10.1.11.1
Example 7: PC21 Configuration Settings
Address: 10.1.11.22
Mask: 255.255.255.0
Gateway: 10.1.11.1
Example 8: PC22 Configuration Settings
hostname WAN
!
interface gigabitethernet0/1
no shutdown
!
interface gigabitethernet0/1.10
encapsulation dot1q 10
ip address 10.1.10.1 255.255.255.0
!
interface gigabitethernet0/1.11
encapsulation dot1q 11
ip address 10.1.11.1 255.255.255.0
Example 9: Router R1 Configuration Settings
Finally, you can proceed with the lab based on the above introduction. However, if you want a little different take about the scenario for this lab, check out this video:
Answer Options - Click Tabs to Reveal
You can learn a lot and strengthen real learning of the topics by creating the configuration – even without a router or switch CLI. In fact, these labs were originally built to be used solely as a paper exercise!
To answer, just think about the lab. Refer to your primary learning material for CCNA, your notes, and create the configuration on paper or in a text editor. Then check your answer versus the answer post, which is linked at the bottom of the lab, just above the comments section.
You can also implement the lab using the Cisco Packet Tracer network simulator. With this option, you use Cisco’s free Packet Tracer simulator. You open a file that begins with the initial configuration already loaded. Then you implement your configuration and test to determine if it met the requirements of the lab.
(Use this link for more information about Cisco Packet Tracer.)
Use this workflow to do the labs in Cisco Packet Tracer:
- Download the .pkt file linked below.
- Open the .pkt file, creating a working lab with the same topology and interfaces as the lab exercise.
- Add your planned configuration to the lab.
- Test the configuration using some of the suggestions below.
This Lab Supports Both CML-Free and CML-Personal!!!
The downloadable file listed here works in both CML-P or CML-F because it uses the IOL (router) and IOL-L2 (switch) reference platform images supported by both products as of CML V2.8. Note that these images also require less CPU and RAM than the other CML-P options.
Use the same general workflow as with Cisco Packet Tracer, as follows:
- Download the CML file (filetype .yaml) linked below.
- Import the lab’s CML file into CML.
- Start the lab in CML.
- Compare the CML lab topology and interface IDs to this lab Blog page, as they may differ (more detail below).
- Add your planned configuration to the lab, adjusting for interface ID differences.
- Test the configuration using some of the suggestions below.
Download this lab’s CML file!
Interface ID Differences:
The lab diagrams on this page use interface IDs (IIDs) that match the Packet Tracer version of the lab. When using CML, adjust the lab IIDs based on this table. Also, note that the IOL and IOL-L2 images used by the supplied CML file support only the “Ethernet” interface type, and not “FastEthernet” or “GigabitEthernet”.
The conventions for this lab are:
- All Gigabit interface types become Ethernet.
- All Gigabit interface numbers in the pattern G1/1/x become E0/x (with two exceptions):
- The two exceptions: The two interfaces G1/1/4 become E0/0.
- Two interfaces do not follow the G1/1/x pattern: The interfaces on the link between router R1 and switch Dist1. Use E0/1 for the IID on both ends of that link.
Port Shown in Lab | Â CML Port |
G1/1/1 | E0/1 |
G1/1/2 | E0/2 |
G1/1/3 | E0/3 |
G1/1/4 | E0/0 |
G1/0/1 | E0/1 |
G0/1 | E0/1 |
Lab Answers Below: Spoiler Alert
Lab Answers: Configuration (Click Tab to Reveal)
Lab Answers
spanning-tree mode rapid-pvst
spanning-tree vlan 10 priority 28672
Example: Dist1 Config
spanning-tree mode rapid-pvst
interface GigabitEthernet1/1/1
spanning-tree vlan 10 cost 3
Example: Dist2 Config
spanning-tree mode rapid-pvst
Example: Access3 Config
spanning-tree mode rapid-pvst
Example: Access4 Config
Commentary, Issues, and Verification Tips (Click Tabs to Reveal)
Lab Commentary
Compared to many Config Labs, this lab takes much more time to understand the initial configuration, but then few commands to configure the switches to meet the design requirements.
Cisco switches default with a base priority of 32,768. IOS allows base priority values as a multiple of 4096, in the range from 0 and 61,440. For instance, the values closest to but less than 32,768 – the values used in lab and most often used in real networks – are:
- 28,672
- 24,576
- 20,480
The lab requirements asked you to configure the priority of switch Dist1 to a lower number. This lab shows Dist1 with the next lower value below the default of 32,768, namely 28,672, as configured in the spanning-tree vlan 10 priority 28672 global command.
The other lab requirement asked you to configure Dist2 with a lower port cost (compared to the default cost) on its G1/1/1 port and lower that cost to one less than the default port cost on Gigabit interfaces (which is cost 4.) You do that using the spanning-tree vlan 10 cost 3 interface subcommand on Dist2’s G1/1/1 port. As a result, when Dist2 and Access3 compete to elect the Designated Port on the link that connects them, Dist2 wins with its root cost of 3 versus Access3’s root cost of 4.
Known Issues in this Lab
This section of each Config Lab Answers post hopes to help with those issues by listing any known issues with Packet Tracer related to this lab. In this case, the issues are:
# | Summary | Detail |
1 | VLAN trunking requires the switchport trunk encapsulation command | Old Cisco switches supported both ISL (older) and 802.1Q (newer) trunking protocol options, so those switches required the switchport trunk encapsulation command to be configured on VLAN trunks. Cisco Packet Tracer switches use this same logic, while Cisco switches produced since around 2010 support 802.1Q only. |
2 | Packet Tracer does not support multiple VLANs in the global vlan command | The initial configuration shows the command vlan 10,11 – legal on real Cisco switches but rejected by Cisco Packet Tracer. Instead, configure the VLANs on separate vlan commands. |
3 | Different behavior with the  spanning-tree cost n interface subcommand | This command, on real switches, sets the spanning-tree cost for all VLANs on that interface. In PT, it appears to set the cost for VLAN 1 only. To perform the lab, set the cost in VLAN 10 with the spanning-tree vlan 10 cost n command. |
Why Would Cisco Packet Tracer Have Issues?
(Note: The below text is the same in every Config Lab.)
Cisco Packet Tracer (CPT) simulates Cisco routers and switches. However, CPT does not run the same software that runs in real Cisco routers and switches. Instead, developers wrote CPT to predict the output a real router or switch would display given the same topology and configuration – but without performing all the same tasks, an actual device has to do. On a positive note, CPT requires far less CPU and RAM than a lab full of devices so that you can run CPT on your computer as an app. In addition, simulators like CPT help you learn about the Cisco router/switch user interface – the Command Line Interface (CLI) – without having to own real devices.
CPT can have issues compared to real devices because CPT does not run the same software as Cisco devices. CPT does not support all commands or parameters of a command. CPT may supply output from a command that differs in some ways from what an actual device would give. Those differences can be a problem for anyone learning networking technology because you may not have experience with that technology on real gear – so you may not notice the differences. So this section lists differences and issues that we have seen when using CPT to do this lab.
Known Issues in this Lab w/ CML
This tab lists known issues with running this lab in CML with the supplied file. The issues are:
# | Summary | Detail |
1 | No known issues. | . |
Why Would CML Have Issues?
(Note: The text below is the same as every Config Lab.)
CML supports a variety of Cisco operating systems (called reference platforms.) To make them work in CML, Cisco makes some adjustments to the code. Also, because no real router or switch hardware exists, some software features do not work the same when running in CML versus a real Cisco device. When we come across any difference when testing the lab, we’ll try to leave a note just above in case it helps you with the lab.
Beyond comparing your answers to this lab’s Answers post, you can test in Cisco Packet Tracer (CPT) or Cisco Modeling Labs (CML). In fact, you can and should explore the lab once configured. For this lab, once you have completed the configuration, try these verification steps.Â
- From switch Dist1, issue the show spanning-tree vlan 10 command. Note its STP/RSTP Bridge ID (BID).
- From each switch, issue the show spanning-tree vlan 10 command. Look at the upper part of the output, which identifies the root switch. Note that all should refer to switch Dist1, by its BID, as the root switch.
- Compare the DP roles on all the trunk links between Dist2, Access3, and Access4, which are the switches you configured so that Dist2 should be the DP on those links:
- Issue the show spanning-tree vlan 10 command on each switch.
- On Dist1 and Access1, compare the value of the “Role” heading for the interfaces on the link between the two switches. Dist1 should list “DESG” for “Designated,” while Access3 should list “Altn” for Alternate.
- Likewise, on Dist2 and Access4, make the same comparison. Dist2 should be the DP, with Access4 as an Alternate Port role.
I must say I interpreted the “highest possible number” as 4096 as my perspective was that of STP. Would this be a question that could be considered ambiguous?
Bart,
Well, I may be misunderstanding your comment. But if I’m understanding you, then no, it’s not ambiguous, and the answer shown is clearly right. That’s why I think I’m just not understanding you.
All the others have base priority 32,768.
The next lowest value is the configured value per the answer – making it the highest possible value that also makes the value less than the base priority of the other switches.
4096 would be allowed, but would not be the highest possible number.
Feel free to expound a bit so I can better understand your point, if interested.
Here are my answers (I’m working with paper and text editor), I did shorter the prompt on purpose hehe.
Dist1
>enable
#configure terminal
#(c)#spanning-tree mode rapid-pvst
#(c)#spanning-tree vlan 10 priority 28672
#(c)#do wr
#(c)#end
Dist2
>enable
#configure terminal
#(c)#spanning-tree mode rapid-pvst
#(c)#interface Gi1/1/1
#(c-if)#spanning-tree vlan 10 cost 3
#(c-if)#do wr
#(c-if)#end
Access3
>enable
#configure terminal
#(c)#spanning-tree mode rapid-pvst
#(c)#end
Access4
>enable
#configure terminal
#(c)#spanning-tree mode rapid-pvst
#(c)#end
Hey Wendell
Just doing your spanning-tree RPVST labs and watching your skillcert YouTube vids
Hello Wendell,
First, I would like to thank you for your labs.
As I am Linux OS user, I have no chance to install SIM Lite labs from companion website (they are only available for Windows and MACs).
So, your “*.pt” files for Packet Tracer, which is available on Linux machines are the only chance I may do some labs.
It is great that you prepared them for us, students. It is really, really great. Thank you 🙂
I loaded this lab’s “*.pt” file into my Packet Tracer v. 8.2.2.0400 and I wanted to do some experiments.
I enabled ‘portfast’ on ‘Access 4’ switch in global configuration:
Access4#configure terminal Enter configuration commands, one per line. End with CNTL/Z. Access4(config)#spanning-tree portfast ? bpduguard Enable portfast bpdu guard on this switch default Enable portfast by default on all access ports Access4(config)#spanning-tree portfast default Access4(config)#
and then I wanted to apply ‘BPDU Filter’ (not ‘BPDU Guard’ as ‘BPDU Filter’ looks for me as a better option when it automatically moves ‘PortFast’ into normal ‘STP’ operation when we connect switch instead of end point). In addition I wanted to experiment some settings.
Unfortunately I can’t see that option (I tried for ‘pvst’ and ‘rapid-pvst’ with the same result):
Access4(config)#spanning-tree portfast ? bpduguard Enable portfast bpdu guard on this switch default Enable portfast by default on all access ports Access4(config)#spanning-tree portfast
I thought that maybe IOS doesn’t support that option, but in the output we may see, that it displays it as an disabled option:
Access4#show spanning-tree summary Switch is in rapid-pvst mode Root bridge for: Extended system ID is enabled Portfast Default is enabled PortFast BPDU Guard Default is disabled Portfast BPDU Filter Default is disabled Loopguard Default is disabled
So, my question is if I missed something and hence IOS hid that option (because eg. some configuration conflicts with ‘BPDU Filter’) or there is a different reason?
I am really curious your opinion as STP chapter looks like quite tough topic to understand, so it is not easy for beginners to understand some twists and turns and figure it out how to enable ‘BPDU Filter’ feature.
Best regards,
Arahdalum
Hi Arahdalum,
Did you post under two names, perhaps? 🙂
This is an easy one, but an important one. Cisco Packet Tracer is a simulator, that is, it’s software that acts like IOS. But it’s not a virtualization system that executes IOS code. So, it’s not feature-for-feature and output-line-for-output-line identical to IOS. You will find features that IOS supports that Packet Tracer does not, and features it supports but it may not perform just like real IOS. That’s one reason I put the “Packet Tracer Issues” tab in these labs: Packet Tracer is popular, but it’s hard to recognize that’s different versus real if you’ve never used real.
So, for those extra STP features, like BPDU Guard, BPDU Filter, Loop Guard, I haven’t had a chance to test thoroughly on packet tracer. FYI.
Hi Mr Odom,
Just a word of gratitude. Much appreciated
Wendell,
Can you help clarify something about how PVST works? If I’m understanding correctly, if I leave the default STP mode as-is, and configure three switches, A, B, and C, each with VLANS 10, 20, and 30, and make no other changes, then the same switch would default to be the root bridge for all three VLANs, just like standard STP, and would essentially block the same port for all three VLANS. Even though the VLAN ID would be added to the bridge ID, the lowest switch MAC would win the root election, and the same switch would still be the root bridge for all three VLANs. Is it the case then, that if I want separate switches to be the root bridge for separate VLANs, that I would HAVE to manually configure it to be so? Like I’d have to use the spanning-tree vlan 10 root primary on switch A, and spanning-tree vlan 20 root primary on switch B, etc.? Sorry if this is confusing. I hope you can understand what I’m asking.
Thanks,
Josh
Josh,
Actually, I think you understand it fully. Code primary on one switch, say for all the odd VLANs, primary on the other, for all the even ones, and balance traffic.
In fact, don’t rely on that burned-in address and an expectation that the staff knows which is lower – instead, use the primary/secondary approach, always rely on the lower priority, don’t leave it to defaults.
My 2 cent… 🙂
W
Hello Wendell,
I am using CML-F (free). With the node limitations of 5 nodes the PC’s do not show up. I tried adding them but it’s a no go.
Any suggestions?
Thanks
Mark