STP负载均衡

网络工程 生成树
2021-07-16 05:11:58

拓扑:

sw3560  gig0/23 ---> fa0/24  sw2960
sw3560  gig0/24 ---> gig0/2  sw2960 

我有一个关于 STP 负载平衡的问题,在我的交换机 3560 上,我配置了以下内容:

!
interface GigabitEthernet0/23
 switchport trunk encapsulation dot1q
 switchport trunk native vlan 200
 switchport mode trunk
 spanning-tree vlan 10,20,30,40,50,60 port-priority 16
!
interface GigabitEthernet0/24
 switchport trunk encapsulation dot1q
 switchport trunk native vlan 200
 switchport mode trunk
 spanning-tree vlan 70,80,90,100,150 port-priority 16

这是正确的配置吗??

谢谢...

 VLAN0001
   Spanning tree enabled protocol ieee
   Root ID    Priority    32769
         Address     0018.18da.8b80
         Cost        4
         Port        24 (GigabitEthernet0/24)
         Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

         Bridge ID  Priority    32769  (priority 32768 sys-id-ext 1)
         Address     0019.5601.7600
         Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
         Aging Time  300 sec

         Interface           Role Sts Cost      Prio.Nbr Type
         Gi0/23              Altn BLK 19        128.23   P2p
         Gi0/24              Root FWD 4         128.24   P2p

 VLAN0010
   Spanning tree enabled protocol ieee
   Root ID    Priority    32778
         Address     0018.18da.8b80
         Cost        4
         Port        24 (GigabitEthernet0/24)
         Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

         Bridge ID  Priority    32778  (priority 32768 sys-id-ext 10)
         Address     0019.5601.7600
         Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
         Aging Time  300 sec

         Interface           Role Sts Cost      Prio.Nbr Type
         Gi0/23              Altn BLK 19         16.23   P2p
         Gi0/24              Root FWD 4         128.24   P2p

 VLAN0020
   Spanning tree enabled protocol ieee
   Root ID    Priority    32788
         Address     0018.18da.8b80
         Cost        4
         Port        24 (GigabitEthernet0/24)
         Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

         Bridge ID  Priority    32788  (priority 32768 sys-id-ext 20)
         Address     0019.5601.7600
         Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
         Aging Time  300 sec

         Interface           Role Sts Cost      Prio.Nbr Type
         Gi0/23              Altn BLK 19         16.23   P2p
         Gi0/24              Root FWD 4         128.24   P2p

 VLAN0030
   Spanning tree enabled protocol ieee
   Root ID    Priority    32798
         Address     0018.18da.8b80
         Cost        4
         Port        24 (GigabitEthernet0/24)
         Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

         Bridge ID  Priority    32798  (priority 32768 sys-id-ext 30)
         Address     0019.5601.7600
         Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
         Aging Time  300 sec

         Interface           Role Sts Cost      Prio.Nbr Type
         Gi0/23              Altn BLK 19         16.23   P2p
         Gi0/24              Root FWD 4         128.24   P2p

 VLAN0040
   Spanning tree enabled protocol ieee
   Root ID    Priority    32808
         Address     0018.18da.8b80
         Cost        4
         Port        24 (GigabitEthernet0/24)
         Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

         Bridge ID  Priority    32808  (priority 32768 sys-id-ext 40)
         Address     0019.5601.7600
         Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
         Aging Time  300 sec

         Interface           Role Sts Cost      Prio.Nbr Type
         Gi0/23              Altn BLK 19         16.23   P2p
         Gi0/24              Root FWD 4         128.24   P2p

 VLAN0050
   Spanning tree enabled protocol ieee
   Root ID    Priority    32818
         Address     0018.18da.8b80
         Cost        4
         Port        24 (GigabitEthernet0/24)
         Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

         Bridge ID  Priority    32818  (priority 32768 sys-id-ext 50)
         Address     0019.5601.7600
         Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
         Aging Time  300 sec

         Interface           Role Sts Cost      Prio.Nbr Type
         Gi0/23              Altn BLK 19         16.23   P2p
         Gi0/24              Root FWD 4         128.24   P2p

 VLAN0060
   Spanning tree enabled protocol ieee
   Root ID    Priority    32828
         Address     0018.18da.8b80
         Cost        4
         Port        24 (GigabitEthernet0/24)
         Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

         Bridge ID  Priority    32828  (priority 32768 sys-id-ext 60)
         Address     0019.5601.7600
         Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
         Aging Time  300 sec

         Interface           Role Sts Cost      Prio.Nbr Type
         Gi0/23              Altn BLK 19         16.23   P2p
         Gi0/24              Root FWD 4         128.24   P2p

 VLAN0070
   Spanning tree enabled protocol ieee
   Root ID    Priority    32838
         Address     0018.18da.8b80
         Cost        4
         Port        24 (GigabitEthernet0/24)
         Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

         Bridge ID  Priority    32838  (priority 32768 sys-id-ext 70)
         Address     0019.5601.7600
         Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
         Aging Time  300 sec

         Interface           Role Sts Cost      Prio.Nbr Type
         Gi0/23              Altn BLK 19        128.23   P2p
         Gi0/24              Root FWD 4          16.24   P2p

 VLAN0080
   Spanning tree enabled protocol ieee
   Root ID    Priority    32848
         Address     0018.18da.8b80
         Cost        4
         Port        24 (GigabitEthernet0/24)
         Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

         Bridge ID  Priority    32848  (priority 32768 sys-id-ext 80)
         Address     0019.5601.7600
         Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
         Aging Time  300 sec

         Interface           Role Sts Cost      Prio.Nbr Type
         Gi0/23              Altn BLK 19        128.23   P2p
         Gi0/24              Root FWD 4          16.24   P2p

  VLAN0090
    Spanning tree enabled protocol ieee
    Root ID    Priority    32858
         Address     0018.18da.8b80
         Cost        4
         Port        24 (GigabitEthernet0/24)
         Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

         Bridge ID  Priority    32858  (priority 32768 sys-id-ext 90)
         Address     0019.5601.7600
         Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
         Aging Time  300 sec

         Interface           Role Sts Cost      Prio.Nbr Type
         Gi0/23              Altn BLK 19        128.23   P2p
         Gi0/24              Root FWD 4          16.24   P2p

 VLAN0100
   Spanning tree enabled protocol ieee
   Root ID    Priority    32868
         Address     0018.18da.8b80
         Cost        4
         Port        24 (GigabitEthernet0/24)
         Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

         Bridge ID  Priority    32868  (priority 32768 sys-id-ext 100)
         Address     0019.5601.7600
         Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
         Aging Time  300 sec

         Interface           Role Sts Cost      Prio.Nbr Type
         Gi0/12              Desg FWD 19        128.12   P2p
         Gi0/23              Altn BLK 19        128.23   P2p
         Gi0/24              Root FWD 4          16.24   P2p

  VLAN0150
    Spanning tree enabled protocol ieee
    Root ID    Priority    32918
         Address     0018.18da.8b80
         Cost        4
         Port        24 (GigabitEthernet0/24)
         Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

         Bridge ID  Priority    32918  (priority 32768 sys-id-ext 150)
         Address     0019.5601.7600
         Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
         Aging Time  300 sec

         Interface           Role Sts Cost      Prio.Nbr Type
         Gi0/23              Altn BLK 19        128.23   P2p
         Gi0/24              Root FWD 4          16.24   P2p

 VLAN0200
   Spanning tree enabled protocol ieee
   Root ID    Priority    32968
         Address     0018.18da.8b80
         Cost        4
         Port        24 (GigabitEthernet0/24)
         Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

         Bridge ID  Priority    32968  (priority 32768 sys-id-ext 200)
         Address     0019.5601.7600
         Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
         Aging Time  300 sec

         Interface           Role Sts Cost      Prio.Nbr Type
         Gi0/23              Altn BLK 19        128.23   P2p
         Gi0/24              Root FWD 4         128.24   P2p
2个回答

由于没有问题,我将假设以下内容。

这是按照我打算让它工作的方式工作吗?

不幸的是,事实并非如此。生成树已Gi0/24在每个端口上进行选择,因为它具有较低的根路径成本,因此它没有考虑生成树端口优先级。当 STP 进行计算时,它遵循这些顺序。

  1. Root Bridge Identifier,桥的桥标识符被发送器认为是根
  2. Root Path Cost,从传输网桥到该根网桥
  3. 传输桥的桥标识符
  4. 端口标识符,通过其传输消息的端口
  5. 接收消息的端口的端口标识符(如果相关)

信息源自 IEEE 标准 802.1D - 2004,媒体访问控制 (MAC) 桥接器,第 17.5 节生成树优先级向量

由于Gi0/23连接到 FastEthernet 端口,它本质上具有较低的速度(导致成本较高)。

     Interface           Role Sts Cost      Prio.Nbr Type
     Gi0/23              Altn BLK 19        128.23   P2p
     Gi0/24              Root FWD 4         128.24   P2p
                                  ^^^

如果要使用 STP 在这些链路之间进行负载平衡,还需要添加以下配置:

interface GigabitEthernet0/24
 spanning-tree vlan 70,80,90,100,150 cost 4
interface GigabitEthernet0/23
 spanning-tree vlan 10,20,30,40,50,60 cost 4

配置已过时,因为 STP 已过时,替换为 802.1q-2014(.aq Shortest Path Bridging, SPB)。

* 不要部署 STP
MLAG Multi-Chassis Link Aggregation Groups
    VSS
    Cross-Stack Etherchannel
    FabricPath(在第 2 层使用 IS-IS)
    VPC(虚拟端口通道)
    Brocade 的 VCS(虚拟集群交换)
IETF TRILL(大量链路的透明互连) )
IEEE 802.1aq(最短路径桥接 – SPB)