06 - Le protocole STP [Français] - Les commandes STP

3 min read 5 hours ago
Published on Nov 15, 2024 This response is partially generated with the help of AI. It may contain inaccuracies.

Table of Contents

Introduction

This tutorial will guide you through the Spanning Tree Protocol (STP), an essential protocol in network switching that helps prevent loops caused by redundancy at the physical layer. By following these steps, you will learn about various STP commands and how to configure them effectively to maintain a stable network environment.

Step 1: Understanding the Purpose of STP

  • STP is designed to prevent network loops, which can occur in redundant paths between switches.
  • Only one active path will be maintained between devices, ensuring efficient data transmission and preventing broadcast storms.

Step 2: Displaying STP Information

  • Use the command show spanning-tree to view the current STP configuration and status.
  • This command provides insights into the spanning tree topology and helps troubleshoot issues.

Step 3: Configuring STP Modes

  • You can set the STP mode using the following commands:
    • spanning-tree mode rapid-pvst: Configures Rapid Per-VLAN Spanning Tree.
    • spanning-tree mode pvst: Configures Per-VLAN Spanning Tree.

Step 4: Managing Root Bridges

  • To configure a switch as the primary or secondary root bridge for VLAN 1, use:
    • spanning-tree vlan 1 root primary: Makes the switch the primary root bridge.
    • spanning-tree vlan 1 root secondary: Makes the switch the secondary root bridge.
  • Setting root bridge priority can be done with:
    • spanning-tree vlan 1 priority [4096]: Adjust the priority to influence root bridge selection.

Step 5: Enhancing Port Configuration

  • Enable PortFast on interfaces to allow them to bypass the listening and learning states:
    • spanning-tree portfast: Enables PortFast on a specific interface.
    • spanning-tree portfast default: Enables PortFast on all access ports by default.
  • Protect against BPDU (Bridge Protocol Data Unit) attacks with:
    • spanning-tree bpduguard default: Enables BPDU Guard on all ports.
    • spanning-tree bpduguard enable: Enables BPDU Guard on a specific interface.

Step 6: Adjusting Port Priority and Link Types

  • Modify port priority with:
    • spanning-tree vlan 1 port-priority [16]: Adjust the priority for a specific VLAN.
  • Set link types using:
    • spanning-tree link-type point-to-point: Configures a point-to-point link.
    • spanning-tree link-type shared: Configures a shared link.

Conclusion

By following these steps, you have learned how to configure and manage the Spanning Tree Protocol effectively. Proper STP configuration helps ensure a stable and efficient network by preventing loops and reducing downtime. For further exploration, consider practicing these commands in a lab environment or on a network simulator to reinforce your understanding.