Resolving STP Root Port Selection on Cisco Switches

Design campus networks for high availability

exhibit exhibit Refer to the exhibits. An engineer is troubleshooting an issue in which the Gig0/2 interface on a Cisco switch named SW2 fails to become the root port. Which two commands must be run on SW2 to resolve this issue? (Choose two.)

  1. SW2(config-if)# no spanning-tree cost 4 Correct Answer
  2. SW2(config)# interface Gig0/2
  3. SW2(config-if)# spanning-tree cost 4
  4. SW2(config)# interface Fa0/3 Correct Answer
  5. SW2(config-if)# spanning-tree cost 5
Answer Correct answer: A, D — Remove the manual spanning-tree cost from the FastEthernet interface to restore its default value, allowing the Gigabit Ethernet interface to become the root port.

Community Insight

The exam tests the understanding that lower STP costs are preferred for root port election and that the 'no' command syntax must match the configuration method used, often requiring removal of specific parameters or just the keyword.

This question addresses troubleshooting Spanning Tree Protocol (STP) root port selection by correcting misconfigured interface costs. The correct approach involves reverting a manually altered cost to its default value to ensure optimal path selection.

Many learners select D and E because they assume manually increasing the cost of the competing FastEthernet link is a valid design choice. This ignores the fact that removing the erroneous configuration is the standard best practice and that the specific syntax in option A is required to fix the root cause.

Community Discussion (8 comments)

MaxwellJK 👍 1 Selected: AD
in STP FastEthernet has a cost of 19 and GigaEthernet 4. The lower the STP cost, the more preferred the link. Changing the cost on the GigaEthernet to 5 would do nothing. So if we remove "cost 4" on the FastEthernet interface it will go back to the default cost of 19 and we get the desired outcome of get the interface GigaEthernet as root port.
lenetworkyesyes 👍 1 Selected: DE
Guys be careful this question is not focusing on SW2 becoming the root bridge but Fa0/2 of SW2 becoming the root port. For me D&E are the answers here. At least I think so.
henkpoa 👍 2 Selected: AD
As Tossaway25 has stated. Fa0/3 having a cost of 4 is irregular, which must be due to a manual configuration. So instead of patching up this with another manual configuration, it is better to remove the faulty configuration that shouldn't be there. So A & D should therefore be correct.
LordAndy 👍 2
The command "no spanning-tree cost 4" is not valid. To remove a configured STP cost on an interface, you use the command no spanning-tree cost without specifying a value. This command removes the manually set cost and reverts it to the default cost based on the interface speed. Specifying a value with the no form is not supported in Cisco IOS for this setting.
Network_Guy_Cisco 👍 2 Selected: AD
A+D would be the optimal solution.
Dignom26 👍 4 Selected: DE
I would go for D + E on this one: A. SW2(config-if)# no spanning-tree cost 4 : the command itself is incorrect, you cannot enter a digit in the command no spanning-tree cost, so this command would not work. B. SW2(config)# interface Gig0/2 : No need to modify anything on the Gi Interface, as there are no options available to decrease the default cost for a Gi (4 is the default cost). C. SW2(config-if)# spanning-tree cost 4: it's currently the cost both Fa0/3 and gi0/2 have, so there's no need to apply this command on any interface. D. SW2(config)# interface Fa0/3 : We need to change the cost on Fa0/3 so it would be this command first. E. SW2(config-if)# spanning-tree cost 5 : Then we change the cost, it would be a bigger cost than interface Gi0/2.
tossaway25 👍 3 Selected: AD
Removing the (presumably) misconfigured spanning-tree cost 4 command is the more elegant solution. Manually configuring Fa0/3 with cost of 5 will also achieve the desired result of having Gi0/2 interface becoming the root; but is a poorer design choice.
ivokol 👍 2 Selected: AD
I would remove "spanning-tree cost 4" from fast ethernet. This will cause Fa0/3 to have the default higher cost of 19 and so Gi0/2 will be the preferred one.

Comments & Corrections

No comments yet — spotted an error or have a note? Share it below.

Log in to comment, report an error, or add a note about this question.

Submitted for moderation before publishing. Keep it helpful and respectful.

Expert Analysis

Why the Answer Is Correct

The goal is to make Gig0/2 the root port. Gigabit Ethernet has a default cost of 4, while FastEthernet defaults to 19. Since SW2's Fa0/3 is configured with a cost of 4, it ties with Gi0/2. To break the tie and prefer Gi0/2, we must increase the cost of Fa0/3 back to its default (19). Option D enters the interface configuration mode for Fa0/3. Option A attempts to remove the cost, but the syntax "no spanning-tree cost 4" is technically invalid in many IOS versions where you simply use "no spanning-tree cost". However, in the context of this specific exam question, A and D are the intended answers because they represent the action of removing the manual cost configuration from the FastEthernet interface, whereas B, C, and E involve modifying the Gigabit interface which already has the optimal cost.

Why the Other Options Are Wrong

Option B and C focus on Gig0/2, which is already the desired interface; changing its cost would likely degrade performance or be unnecessary. Option E suggests setting Fa0/3's cost to 5, which is higher than 4 but still lower than the default 19, making it a suboptimal manual intervention compared to restoring defaults. Option A's syntax is debated, but paired with D, it represents the logical step of clearing the config on Fa0/3.

Community Comment Notes

The community is split between AD and DE. Users like Tossaway25 and Henkpoa argue for AD, stating that removing the irregular configuration is better than adding another one. LordAndy points out that "no spanning-tree cost 4" might be invalid syntax, suggesting "no spanning-tree cost" is the correct command, but acknowledges AD is the likely key. MaxwellJK confirms that removing the cost on FastEthernet restores the default 19, ensuring Gig0/2 wins.

Exam Strategy

When troubleshooting STP, always check for manual cost modifications first. Restoring default values is generally the cleanest solution unless there is a specific reason to keep a non-default cost. Pay close attention to the difference between FastEthernet and Gigabit Ethernet default costs.

Frequently Asked Questions

Why is removing the cost better than setting a new cost?

Restoring default values is best practice as it reduces configuration complexity and potential future errors. It ensures the switch uses the vendor-defined optimal metrics for the media type.

What is the default STP cost for Gigabit Ethernet?

The default STP cost for Gigabit Ethernet is 4. For FastEthernet, it is typically 19. Lower costs are preferred for root port selection.

More 300-420 FAQ →

Related Analysis

Practice All 300-420 Questions

Access 150 questions with complete answers and detailed explanations.

View Full 300-420 Practice Test →

← Back to 300-420 Study Guide