Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

The principle and basic configuration of STP

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Network Security >

Share

Shulou(Shulou.com)06/01 Report--

The principle and basic configuration of STP

STP (spanning Tree Protocol): is to change a ring structure into a tree structure. The network with physical loops is used to generate a logical tree structure by logically blocking some ports through an algorithm.

Configuration purpose: to solve routing loops and achieve load balancing

Note: the current router will not produce loops, the main purpose of the configuration is to select a better performance switch as the root bridge to achieve load balancing.

How it works:

The spanning tree algorithm consists of three steps:

1. Select the root bridge (Root Bridge)

two。 Select the root port (Root Ports)

3. Select designated port (Designated Ports)

The selection of the root bridge is based on the bridge ID (including priority and MAC address). Compare which switch has the lowest bridge ID value, and the one with the lowest priority is chosen as the root bridge; in the case of the same priority, the one with the lowest MAC address is the root bridge.

Select the root port: 1. The lowest root path cost to the root bridge.

two。 The directly connected bridge ID is the smallest.

3. Port ID is the smallest.

Select the designated port: 1. The cost of root path is lower.

two。 The bridge ID value of the switch is low.

3. The port ID value is low.

Note: unlike selecting the root port, when comparing the port ID value, you compare its own port ID value.

PVST+ configuration command

Sw1 configuration vlan (vlan1 does not need to be configured by default) configure the trunk link and open the port.

Sw2 and sw3 do the same (ports are configured according to the actual situation)

View the root bridge by default

It is best to mark the MAC address of each switch before viewing.

The following figure shows the query results on sw2. It is both the root bridge of vlan1 and the root bridge of vlan2.

Use: show spanning-tree vlan1 to view the root bridge of vlan1

Use: Show spanning-tree vlan2 to view the root bridge of vlan2

This line displays the MAC address of the root bridge when viewed by other switches

Now the root bridge with sw2 as vlan1 is the backup root bridge for vlan2, and the root bridge with sw3 as vlan2 is the backup root bridge for vlan1.

Sw2:

Spanning-treevlan 1 root primary

Spanning-treevlan 2 root secondary

Sw3:

Spanning-tree vlan 2 root primary

Spanning-treevlan 1 root secondary

At this point, use showspanning-tree vlan 1 on sw2 to view the results

At this point, use showspanning-tree vlan 2 on sw2 to view the results

It means that the root bridge is at the connection of port f0max 1, that is, sw3

The above is over!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Network Security

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report