Sunday, 14 April 2013

Basic STP



  • Cable the network
  • Examine default configuration of STP
  • Install Root switch
  • Enable RSTP
  • Configure PortFast and BPDU ports.


Examine default configuration of STP

From the information below we can determine which switch is the current Root switch, by looking at the switch with the lowest Bridge ID (BID). By default the BID will be the same on all switches, when this occures it will then pick the lowest MAC address.

In this case SW1 is the Root, you can also determine that SW 1 is root as all ports are forwarding. Additionaly you can see that SW2 fa0/1 and SW3 fa0/3 are root ports.





Install Root switch

Luckly for me the switch i wanted to be the Root switch is the Root switch. By leaving the BID value to default however, will have consequences if you do not takes steps to ensure the Root switch in your network stays the root switch.

If one of the other switches had a lower MAC address, the one with the lowest would of been selected as the Root switch. If that switch were an Access layer switch you would have alot of problems on your network. As paths out of your network may of been blocking during STP convergence.

SW1(config)#spanning-tree vlan 1 priority 4096

You may be wondering why i chose VLAN 1, this is because it is the default VLAN, which all the switches are a part of. You now know that each switch can now set different priorities for VLANs, this is known as PVSTP. If you do have multiple vlans you can use a range command to include them in one command.

You can verfiy the changes, as seen below;




Enable RSTP

RSTP cuts down on convergence time if a link were to go down. The command needs to be put on all switches.
SW1(config)#spanning-tree mode rapid-pvst

Configure portfast and BPDU guard

Portfast should only be enabled on ports that are connected to non STP speaking devices, like end devices.

Portfast allows the port to immedietly to move to an STP forwarding state and forward traffic.

SW2(config)#int range fa0/3 - 20
SW2(config-if-range)#spanning-tree portfast
%Warning: portfast should only be enabled on ports connected to a single
 host. Connecting hubs, concentrators, switches, bridges, etc... to this
 interface  when portfast is enabled, can cause temporary bridging loops.
 Use with CAUTION

%Portfast will be configured in 18 interfaces due to the range command
 but will only have effect when the interfaces are in a non-trunking mode.

BPDU guard is often used on ports that have PortFast enabled. BPDU disables a port if any BPDUs are received.

SW2(config)#int range fa0/3 - 20
SW2(config-if-range)#spanning-tree bpduguard enable


No comments:

Post a Comment