Spanning Tree Protocol overview and basic Configuration.


Spanning Tree 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 the switch to become the root switch for VLAN 10 should the primary root switch fail.
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 diameter 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.

Configuring the Switch Priority of the VLAN:

 
SW1(config)#spanning-tree
vlan 10 priority 12288
Configures the switch priority of VLAN 10 to 12288

NOTE:

The default is 32768. The lower Switch priority, the more likely the switch will be chosen as the root switch. Following numbers can be used as priority values:

0
4096
8192
12288
16384
20480
24576
28672
32768
36864
40960
45056
49152
53248
57344
61440
  
Configuring STP Timers:

SW1(config)#spanning-tree
vlan 10 hello-time 5
Changes the hello-delay timer to 5 seconds on VLAN 10
SW1(config)#spanning-tree
vlan 10 forward-time 15
Changes the forward-delay timer to 15 seconds on VLAN 10
SW1(config)#spanning-tree
vlan 10 max-age 30
Changes the maximum-aging timer to 30 seconds on VLAN 10



2 comments: