



Spanning Tre e Protocol:





Spanning- tree protocol (STP) is a layer-2 loop prevention protocol that is used in redundant switched networks to ensure a loop-free topology.



Spanning- tree protocol (STP) was developed by Digital equipment corporation and revised by in the IEEE802.1d.



Spanning tree protocol (STP) is used to allows multiple switches to communicate with each other to discover physical loops in the network.



Spanning- tree protocol (STP) creates a tree structure of loop-free leaves and branches that spans the layer-2 network.



Spanning- tree protocol (STP) allows for the network to include the redundant links for high availability without the danger of bridging loops. if the link goes down spanning tree activates the standby path.

















Enabling Spanning Tree Protocol:





SW1( config )#spanning-tree vlan 10 Enables STP on VLAN 10 SW1( config )#no spanning-tree vlan 10 Disables STP on VLAN 10





Configuring the Root Switch:





SW1( config spanning-tree vlan 10 root {primary | secondary} Let’s Modify the switch priority from the default 32768 to a lower value to allow the switch to become the primary or secondary root switch for VLAN 10.









SW1( config )# spanning- tree vlan 10 root primary Configures the switch to become the root switch for VLAN 10. SW1(config) #spanning-tree vlan 10 root primary diameter 7 Configures the switch to be the root switch for VLAN 10 and sets the network diameter to 7.





Configuring a Secondary Root Switch:





SW1( config )# spanning-tree vlan 10 root secondary Configures switch to become the root switch for VLAN 10 should the primary root switch fail. thetothefor10the SW1(config)#spanning-tree vlan 10 root secondary diameter 7 Configures the switch to be the secondary root switch for VLAN 10 and sets the network diam eter to 7.





Configuring Port Priority:





SW1( config )# interface gigabitethernet 0/1 Moves to configuration interface mode. SW1( config-if spanning-tree port-priority 64 Configures the port priority for the interface that is an access port on Switch. SW1( config-if ) #spanning tree vlan 10 port-priority 64 Configures the VLAN port priority for an interface that is a trunk port on switch.





Configuring the Path Cost:



SW1( config )# interface gigabitethernet 0/1 Moves to interface configuration mode. SW1( config-if )# spanning- tree cost 10000 Configures the cost for the interface that is an access port on switch. SW1( config-if )# spanning tree vlan 10 cost 100000 Configures the VLAN cost for an interface that is a trunk port on switch.

