6.5 STP Configuration Explained
1. Key Concepts of STP Configuration
STP (Spanning Tree Protocol) configuration involves setting up switches to ensure a loop-free topology. Key concepts include:
- STP Mode: The type of STP protocol being used (e.g., Rapid PVST+, MSTP).
- Root Bridge Priority: The priority value assigned to the switch to influence Root Bridge election.
- Port Cost: The cost assigned to each port to determine the best path to the Root Bridge.
- Port Priority: The priority assigned to each port to influence port role assignment.
- BPDU Guard: A security feature that disables a port if it receives BPDUs.
- BPDU Filtering: A feature that prevents BPDUs from being sent or received on a port.
2. STP Mode
The STP mode determines the type of STP protocol being used. Common modes include Rapid PVST+ (Per-VLAN Spanning Tree Plus) and MSTP (Multiple Spanning Tree Protocol). The mode is configured globally on the switch.
Example: To configure Rapid PVST+ on a MikroTik switch, you would use the command /interface bridge stp set [find] mode=rapid-pvst
. This command sets the switch to use Rapid PVST+ for all VLANs.
3. Root Bridge Priority
The Root Bridge Priority is a value assigned to a switch to influence its chances of being elected as the Root Bridge. Lower values have higher priority. The priority can be manually configured to ensure a specific switch becomes the Root Bridge.
Example: To set the Root Bridge priority to 4096 on a MikroTik switch, you would use the command /interface bridge stp set [find] priority=4096
. This command increases the switch's chances of being elected as the Root Bridge.
4. Port Cost
Port Cost is the cost assigned to each port to determine the best path to the Root Bridge. Lower costs indicate better paths. Port costs can be manually configured to influence the path selection process.
Example: To set the port cost to 10 on a specific interface (e.g., ether1), you would use the command /interface bridge port set [find interface=ether1] path-cost=10
. This command ensures that ether1 is preferred as the path to the Root Bridge.
5. Port Priority
Port Priority is a value assigned to each port to influence its role in the STP topology. Lower values have higher priority. Port priority can be manually configured to ensure a specific port becomes the Root Port or Designated Port.
Example: To set the port priority to 16 on a specific interface (e.g., ether2), you would use the command /interface bridge port set [find interface=ether2] priority=16
. This command increases the chances of ether2 being selected as the Root Port.
6. BPDU Guard
BPDU Guard is a security feature that disables a port if it receives BPDUs. This prevents unauthorized devices from participating in the STP process and potentially causing network loops.
Example: To enable BPDU Guard on a specific interface (e.g., ether3), you would use the command /interface bridge port set [find interface=ether3] bpdu-guard=yes
. This command ensures that ether3 is disabled if it receives BPDUs.
7. BPDU Filtering
BPDU Filtering prevents BPDUs from being sent or received on a port. This is useful for securing access ports where BPDUs are not expected. BPDU Filtering can be configured globally or on specific ports.
Example: To enable BPDU Filtering on a specific interface (e.g., ether4), you would use the command /interface bridge port set [find interface=ether4] bpdu-filter=yes
. This command prevents BPDUs from being sent or received on ether4.