Got it

Understanding of STP - Example for Configuring Basic STP Functions

Latest reply: May 14, 2021 14:36:14 252 27 23 0 6

OBJECTIVE


The purpose of this post is to present an introduction to the example for configruing basic STP functions.



Networking Requirements


Network designers tend to deploy multiple physical links between two devices (one link is the master and the others are backups) to fulfill network redundancy requirements. Loops are bound to occur on such types of complex networks.


Loops will cause broadcast storms, thereby exhausting network resources and paralyzing the network. Loops also cause MAC address flapping that damages MAC address entries.


STP can be deployed on a network to eliminate loops by blocking some ports. On the network shown in Figure 1, after RouterA, SwitchA, SwitchB, SwitchC and SwitchD running STP discover loops on the network by exchanging information with each other, they trim the ring topology into a loop-free tree topology by blocking an interface. These capabilities help prevent replication and circular propagation of packets on the network which in turn helps improve processing performance

14


Figure 1 - Networking diagram of basic STP configurations



Configuration Roadmap


The configuration roadmap is as follows:


1. Configure basic STP functions, including:

a. Configure the STP mode for the ring network.

b. Configure primary and secondary root bridges.

c. Set path costs for ports to block certain ports.

d. Enable STP to eliminate loops.


  • Enable STP globally.


  • Enable STP on all the interfaces except the interfaces connected to terminals.


i_f42.gifSTP is not required on the interfaces connected to terminals because these interfaces do not need to participate in STP calculation.



Procedure


1. Configure basic STP functions.

    

    a. Configure the STP mode for the devices on the ring network.


    # Configure the STP mode on RouterA.

<Huawei> system-view
[Huawei] sysname RouterA
[RouterA] stp mode stp            


    # Configure the STP mode on SwitchA, SwitchB, SwitchC and SwitchD.


    b. Configure primary and secondary root bridges.


    # Configure RouterA as the primary root bridge.


[RouterA] stp root primary


    # Configure SwitchA as the secondary root bridge.

[Routera] stp root secondary


    c. Set path costs for ports in each spanning tree to block certain ports


i_f42.gifThe values of path costs depend on path cost calculation methods. This example uses the Huawei proprietary calculation method and sets the path cost to 200000. 


All switching devices on a network must use the same path cost calculation method. Refer to STP List of path costs to get standard of other calculation methods.


    # On RouterA, configure the path cost calculation method as the Huawei proprietary method.

[RouterA] stp pathcost-standard legacy


    # On SwitchA, SwitchB, SwitchC and SwitchD, configure the path cost calculation method as the Huawei proprietary method. (The detailed configuration is not provided here.)


    # As shown in Figure 1, set the path cost of Eth0/0/4 on SwitchC and SwitchD to 200000. (The detailed configuration is not provided here.)


    d. Enable STP to eliminate loops.


  • Disable STP on interfaces connected to PCs.


    # Disable STP on interfaces connected to terminals for SwitchC and SwitchD. (The detailed configuration is not provided here.)


  • Enable STP globally.

    

    # Enable STP globally on RouterA

[RouterA] stp enable


    # Enable STP globally on other switching devices.


  • Enable STP on all the interfaces except the interfaces connected to terminals.


    # Enable STP on RouterA Ethernet2/0/0 and Ethernet2/0/1

[RouterA] interface ethernet 2/0/0
[RouterA-Ethernet2/0/0] stp enable
[RouterA-Ethernet2/0/0] quit
[RouterA] interface ethernet 2/0/1
[RouterA-Ethernet2/0/1] stp enable
[RouterA-Ethernet2/0/1] quit


    # Enable STP on all the interfaces except the interfaces connected to terminals for SwitchA, SwitchB, SwitchC and SwitchD.


2. Verify the configuration.


After the previous configurations, run the following commands to verify the configuration when the network is stable:


# Run the display stp brief command on RouterA to view the interface status and protection type. The displayed information is as follows:


[RouterA] display stp brief
   
   MSTID     Port                      Role         STP State             Protection

   0     Ethernet2/0/0                 DESI         FORWARDING             NONE

   0     Ethernet2/0/1                 DESI         FORWARDING             NONE


After RouterA is configured as a root bridge, Ethernet2/0/0 connected to SwitchA and Ethernet2/0/1 connected to SwitchB are elected as designated ports during spanning tree calculation.



Configuration Files


  • Configuration file of RouterA

#
sysname RouterA
#
stp mode stp
stp instance 0 root primary
stp pathcost-standard legacy
#
interface Ethernet2/0/0
#
interface Ethernet2/0/1
#
return          


  • Configuration file of SwitchA

#
sysname SwitchA
#
stp mode stp
stp instance 0 root secondary
stp pathcost-standard legacy
#
interface Ethernet0/0/1
#
interface Ethernet0/0/2
#
interface Ethernet0/0/3
#
return           


  • Configuration file of SwitchB

#
sysname SwitchB
#
stp mode stp
stp pathcost-standard legacy
#
interface Ethernet0/0/1
#
interface Ethernet0/0/2
#
interface Ethernet0/0/3
#
return


  • Configuration file of SwitchC

#
sysname SwitchC
#
stp mode stp
stp pathcost-standard legacy
#
interface Ethernet0/0/1
#
interface Ethernet0/0/2
stp disable
#
interface Ethernet0/0/3
stp disable
#
interface Ethernet0/0/4
stp instance 0 cost 200000
#
return


  • Configuration file of SwitchD

#
sysname SwitchD
#
stp mode stp
stp pathcost-standard legacy
#
interface Ethernet0/0/1
#
interface Ethernet0/0/2
stp disable
#
interface Ethernet0/0/3
stp disable
#
interface Ethernet0/0/4
stp instance 0 cost 200000
#
return



--- End

  • x
  • convention:

BAZ
MVE Author Created May 2, 2021 18:58:56

Thanks for sharing. Do we have STP List of path cost
View more
  • x
  • convention:

andersoncf1
andersoncf1 Created May 3, 2021 16:07:34 (0) (0)
Thanks dear friend  
wissal
MVE Created May 2, 2021 19:06:30

Learning together, I appreciate
View more
  • x
  • convention:

andersoncf1
andersoncf1 Created May 3, 2021 16:08:03 (0) (0)
Thanks a lot my friend  
LilStylz237
Created May 2, 2021 19:52:27

Great, thanks
View more
  • x
  • convention:

Sokrin
Sokrin Created May 3, 2021 05:21:20 (0) (0)
 
lucian2003
MVE Author Created May 3, 2021 00:46:50

Good example to learn it. Thanks
View more
  • x
  • convention:

Unicef
MVE Created May 3, 2021 01:04:58

Well done friend
View more
  • x
  • convention:

zaheernew
MVE Created May 3, 2021 04:43:54

Understanding of STP - Example for Configuring Basic STP Functions-3917759-1
View more
  • x
  • convention:

Laiheang
Created May 3, 2021 04:51:51

Good post
View more
  • x
  • convention:

Abdussamed
MVE Created May 3, 2021 06:36:40

Wow,
Exellent
View more
  • x
  • convention:

Adriale
Adriale Created May 5, 2021 13:02:45 (0) (0)
 
IndianKid
Moderator Author Created May 3, 2021 06:50:52

Great Example. Anderson. Thanks for sharing awesome post.
View more
  • x
  • convention:

123
Back to list

Comment

You need to log in to comment to the post Login | Register
Comment

Notice: To protect the legitimate rights and interests of you, the community, and third parties, do not release content that may bring legal risks to all parties, including but are not limited to the following:
  • Politically sensitive content
  • Content concerning pornography, gambling, and drug abuse
  • Content that may disclose or infringe upon others ' commercial secrets, intellectual properties, including trade marks, copyrights, and patents, and personal privacy
Do not share your account and password with others. All operations performed using your account will be regarded as your own actions and all consequences arising therefrom will be borne by you. For details, see " Privacy."

My Followers

Login and enjoy all the member benefits

Login

Block
Are you sure to block this user?
Users on your blacklist cannot comment on your post,cannot mention you, cannot send you private messages.
Reminder
Please bind your phone number to obtain invitation bonus.