构建生成树链接

网络工程 思科 转变 交换 cisco催化剂 生成树
2021-07-21 03:32:36

我有两个 3560 交换机,我有 2 个上行链路。目标是使每台交换机的两个端口上的一个链接变为绿色,另一个链接变为黄色(备用),因此当我拉出活动的绿色链接时,另一个备用链接需要 30 秒才能成为新的活动链接。我迷失了我所缺少的东西。我制作了一个根交换机和 VLAN 以及所有东西。我不确定如何使一个链接处于活动状态而另一个处于备用状态,

昏昏欲睡的人:

second#sh span

VLAN0005
  Spanning tree enabled protocol ieee
  Root ID    Priority    28677
             Address     001a.e3cd.9e80
             Cost        19
             Port        26 (GigabitEthernet0/26)
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

  Bridge ID  Priority    28677  (priority 28672 sys-id-ext 5)
             Address     0023.abcd.b900
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time 300

Interface        Role Sts Cost      Prio.Nbr Type
---------------- ---- --- --------- -------- --------------------------------
Gi0/26           Root FWD 19         32.26   P2p
Gi0/28           Altn BLK 19        128.28   P2p


VLAN0010
  Spanning tree enabled protocol ieee
  Root ID    Priority    28682
             Address     001a.e3cd.9e80
             Cost        19
             Port        26 (GigabitEthernet0/26)
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

  Bridge ID  Priority    28682  (priority 28672 sys-id-ext 10)
             Address     0023.abcd.b900
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time 300

Interface        Role Sts Cost      Prio.Nbr Type
---------------- ---- --- --------- -------- --------------------------------
Gi0/26           Root FWD 19         32.26   P2p
Gi0/28           Altn BLK 19        128.28   P2p


VLAN0015
  Spanning tree enabled protocol ieee
  Root ID    Priority    28687
             Address     001a.e3cd.9e80
             Cost        19
             Port        26 (GigabitEthernet0/26)
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

  Bridge ID  Priority    28687  (priority 28672 sys-id-ext 15)
             Address     0023.abcd.b900
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time 300

Interface        Role Sts Cost      Prio.Nbr Type
---------------- ---- --- --------- -------- --------------------------------
Gi0/26           Root FWD 19         32.26   P2p
Gi0/28           Altn BLK 19        128.28   P2p


VLAN0020
  Spanning tree enabled protocol ieee
  Root ID    Priority    28692
             Address     001a.e3cd.9e80
             Cost        19
             Port        26 (GigabitEthernet0/26)
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

  Bridge ID  Priority    28692  (priority 28672 sys-id-ext 20)
             Address     0023.abcd.b900
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time 300

Interface        Role Sts Cost      Prio.Nbr Type
---------------- ---- --- --------- -------- --------------------------------
Gi0/26           Root FWD 19         32.26   P2p
Gi0/28           Altn BLK 19        128.28   P2p

second#





new#sh span

VLAN0005
  Spanning tree enabled protocol ieee
  Root ID    Priority    28677
             Address     001a.e3cd.9e80
             This bridge is the root
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

  Bridge ID  Priority    28677  (priority 28672 sys-id-ext 5)
             Address     001a.e3cd.9e80
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time 300

Interface        Role Sts Cost      Prio.Nbr Type
---------------- ---- --- --------- -------- --------------------------------
Fa0/24           Desg FWD 19         32.26   P2p
Fa0/26           Desg FWD 19        128.30   P2p


VLAN0010
  Spanning tree enabled protocol ieee
  Root ID    Priority    28682
             Address     001a.e3cd.9e80
             This bridge is the root
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

  Bridge ID  Priority    28682  (priority 28672 sys-id-ext 10)
             Address     001a.e3cd.9e80
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time 300

Interface        Role Sts Cost      Prio.Nbr Type
---------------- ---- --- --------- -------- --------------------------------
Fa0/24           Desg FWD 19         32.26   P2p
Fa0/26           Desg FWD 19        128.30   P2p


VLAN0015
  Spanning tree enabled protocol ieee
  Root ID    Priority    28687
             Address     001a.e3cd.9e80
             This bridge is the root
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

  Bridge ID  Priority    28687  (priority 28672 sys-id-ext 15)
             Address     001a.e3cd.9e80
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time 300

Interface        Role Sts Cost      Prio.Nbr Type
---------------- ---- --- --------- -------- --------------------------------
Fa0/24           Desg FWD 19         32.26   P2p
Fa0/26           Desg FWD 19        128.30   P2p


VLAN0020
  Spanning tree enabled protocol ieee
  Root ID    Priority    28692
             Address     001a.e3cd.9e80
             This bridge is the root
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

  Bridge ID  Priority    28692  (priority 28672 sys-id-ext 20)
             Address     001a.e3cd.9e80
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time 300

Interface        Role Sts Cost      Prio.Nbr Type
---------------- ---- --- --------- -------- --------------------------------
Fa0/24           Desg FWD 19         32.26   P2p
Fa0/26           Desg FWD 19        128.30   P2p
3个回答

您无需执行任何操作——交换机已经在运行生成树,并且一个端口(第二个交换机上的 G0/28)正在阻塞。

但:

配置此功能的首选方法是在两个交换机之间创建端口通道。端口通道将两个物理接口合并为一个逻辑接口。由于两条链路都在转发,因此您获得了两倍的带宽,您仍然可以获得冗余,并且您没有生成树的缓慢收敛时间。

这是一个示例。两边做同样的事情。

interface gi 0/26
channel-group 1 mode active
!
interface gi 0/28
channel-group 1 mode active
!
interface port-channel 1
switchport
switchport mode trunk
switcport trunk allowed vlan 10-20
no shut

从你的第二个开关:

Interface        Role Sts Cost      Prio.Nbr Type
---------------- ---- --- --------- -------- --------------------------------
Gi0/26           Root FWD 19        128.26   P2p
Gi0/28           Altn BLK 19        128.28   P2p

它清楚地表明 STP 正在阻止该 VLAN 的链接之一。如果拔掉转发链路上的插头,STP 将收敛并开始在阻塞的链路上转发。这就是您想要的,也是默认行为。

我认为您要做的是选择两个交换机上的哪个端口处于阻塞状态。

如果您有两台交换机并且它们通过两条以太网电缆相互连接,假设端口速度相同,即成本相同,生成树将通过查看端口优先级和端口号。

由于 BPDU 来自计数的根桥/上游交换机,您需要在根桥侧将端口优先级调整为较低的值,以便与第二个以太网链路相比,相邻交换机端口将收到较低端口优先级的 BPDU ,使其成为返回根网桥的首选路径。这反过来会将第二个端口设置为阻塞状态,琥珀色 LED。

要查看端口优先级编号,请使用

Cisco 交换机上的show spanning-tree命令。

您应该会看到端口列表和Prio.Nbr 之类的128.24

要更改端口优先级,您可以使用以下命令:

switch(config-if)# 生成树端口优先级 32

优先级值为 0、32、64、96、128、160、192 和 224。所有其他值都被拒绝。

我希望这对你的追求有所帮助。

困人