两个 Cisco 堆栈之间的上行链路端口被 RSTP 阻止

网络工程 思科 生成树
2021-07-17 02:00:17

我应该自己解决这个问题,但实际上我似乎是个笨蛋。

我有两个 Cisco 3750X 堆栈,每个堆栈中有两个交换机。一个堆栈在建筑物 A 中,另一个堆栈在建筑物 B 中。每个堆栈充当建筑物的核心交换机和本地流量的路由器。此外,两个堆栈之间共享一些 VLAN,但没有路由。

堆栈通过暗光纤和 1Gbps 单模 SFP 连接。这就像一个魅力。

现在,我们要在两个堆栈之间安装第二个上行链路以进行备份。不幸的是,我们只能在建筑物之间租用 100 Mbit (STM-100) 以太网线路,因此无法使用端口通道/以太网通道。

然后我想:只需将第二个端口配置为与第一个上行链路端口相同的设置(中继)并插入线路。由于成本较高,生成树将禁用它,并在主上行链路(Gbit 光纤)发生故障时启用它。还有一个问题:

生成树 (RSTP) 已禁用“新”端口,但将其检测为“备份”并使其丢弃所有数据包,并且在主上行链路出现故障时不启用它。

问题是:如果主线路发生故障,我如何让堆栈启用备用线路,或者如果这不可能,那么实现相同目标的更好方法是什么。

这是一个简单的绘图来可视化问题:

##

运行配置的相关部分:

堆叠在A楼:

interface GigabitEthernet1/0/28
 description downlink trunk BldB
 switchport access vlan 666
 switchport trunk encapsulation dot1q
 switchport trunk native vlan 666
 switchport trunk allowed vlan 2-99,101-199,201-4094
 switchport mode trunk
 switchport nonegotiate
 speed nonegotiate
end


interface GigabitEthernet2/0/28
 description "downlink trunk BldgB 100M-Backup"
 switchport access vlan 666
 switchport trunk encapsulation dot1q
 switchport trunk native vlan 666
 switchport trunk allowed vlan 2-99,101-109,111-4094
 switchport mode trunk
 switchport nonegotiate
 shutdown
 speed 100
 duplex full
 spanning-tree vlan 99 port-priority 128
 spanning-tree vlan 99 cost 50
end

B楼的堆栈:

interface GigabitEthernet1/0/1
 description downlink trunk BldgA
 switchport access vlan 666
 switchport trunk encapsulation dot1q
 switchport trunk native vlan 666
 switchport trunk allowed vlan 2-99,101-199,201-4094
 switchport mode trunk
 switchport nonegotiate
 speed nonegotiate
 duplex full
end

interface GigabitEthernet2/0/1
 description "downlink trunk BldgA 100Mbit-Backup"
 switchport access vlan 666
 switchport trunk encapsulation dot1q
 switchport trunk native vlan 666
 switchport trunk allowed vlan 2-99,101-109,111-4094
 switchport mode trunk
 switchport nonegotiate
 speed 100
 duplex full
end

编辑:添加生成树信息:

bldga-core# show spanning-tree summary
Switch is in rapid-pvst mode
Root bridge for: VLAN0099, VLAN0101-VLAN0117, VLAN0200
Extended system ID           is enabled
Portfast Default             is disabled
PortFast BPDU Guard Default  is disabled
Portfast BPDU Filter Default is disabled
Loopguard Default            is disabled
EtherChannel misconfig guard is enabled
UplinkFast                   is disabled
Stack port is StackPort1
BackboneFast                 is disabled
Configured Pathcost method used is short


bldgb-core# show spanning-tree summary
Switch is in rapid-pvst mode
Root bridge for: VLAN0100, VLAN0110, VLAN0118, VLAN0200
EtherChannel misconfig guard is enabled
Extended system ID           is enabled
Portfast Default             is disabled
PortFast BPDU Guard Default  is disabled
Portfast BPDU Filter Default is disabled
Loopguard Default            is disabled
UplinkFast                   is disabled
Stack port is StackPort1
BackboneFast                 is disabled
Configured Pathcost method used is short


bldga-core# show spanning-tree vlan 99

VLAN0099
  Spanning tree enabled protocol rstp
  Root ID    Priority    99
             Address     081f.f31e.9c80
             This bridge is the root
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

  Bridge ID  Priority    99     (priority 0 sys-id-ext 99)
             Address     081f.f31e.9c80
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time  300 sec

Interface           Role Sts Cost      Prio.Nbr Type
------------------- ---- --- --------- -------- --------------------------------
Po14                Desg FWD 3         128.592  P2p
Po15                Desg FWD 3         128.600  P2p
Po17                Desg FWD 3         128.616  P2p
Po19                Desg FWD 3         128.632  P2p
Po22                Desg FWD 3         128.656  P2p
Po23                Desg FWD 3         128.664  P2p
Po24                Desg FWD 3         128.672  P2p
Po28                Desg FWD 4         128.704  P2p

bldgb-core#show spanning-tree vlan 99

VLAN0099
  Spanning tree enabled protocol rstp
  Root ID    Priority    99
             Address     081f.f31e.9c80
             Cost        4
             Port        616 (Port-channel14)
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

  Bridge ID  Priority    4195   (priority 4096 sys-id-ext 99)
             Address     d072.dc9b.4980
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time  300 sec

Interface           Role Sts Cost      Prio.Nbr Type
------------------- ---- --- --------- -------- --------------------------------
Po14                Root FWD 4         128.616  P2p
Po15                Desg FWD 4         128.624  P2p
Po16                Desg FWD 4         128.632  P2p
Po17                Desg FWD 4         128.640  P2p
Po18                Desg FWD 4         128.648  P2p
Po19                Desg FWD 4         128.656  P2p
Po20                Desg FWD 4         128.664  P2p
Po21                Desg FWD 4         128.672  P2p
Po22                Desg FWD 4         128.680  P2p
Po23                Desg FWD 4         128.688  P2p
Po25                Desg FWD 4         128.704  P2p

bldga-core#show interfaces gi2/0/28
GigabitEthernet2/0/28 is administratively down, line protocol is down (disabled)
  Hardware is Gigabit Ethernet, address is 081f.f31e.c39c (bia 081f.f31e.c39c)
  MTU 1500 bytes, BW 100000 Kbit, DLY 100 usec,
     reliability 255/255, txload 1/255, rxload 1/255
  Encapsulation ARPA, loopback not set
  Keepalive not set
  Full-duplex, 100Mb/s, link type is force-up, media type is 10/100/1000BaseTX SFP
  input flow-control is off, output flow-control is unsupported
  ARP type: ARPA, ARP Timeout 04:00:00
  Last input 20:35:08, output 20:34:56, output hang never
  Last clearing of "show interface" counters never
  Input queue: 0/75/0/0 (size/max/drops/flushes); Total output drops: 6039
  Queueing strategy: fifo
  Output queue: 0/40 (size/max)
  5 minute input rate 0 bits/sec, 0 packets/sec
  5 minute output rate 0 bits/sec, 0 packets/sec
     964013646 packets input, 740488440354 bytes, 0 no buffer
     Received 3529649 broadcasts (2477004 multicasts)
     0 runts, 0 giants, 0 throttles
     12 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored
     0 watchdog, 2477004 multicast, 0 pause input
     0 input packets with dribble condition detected
     975352039 packets output, 923509356637 bytes, 0 underruns
     0 output errors, 0 collisions, 9 interface resets
     0 babbles, 0 late collision, 0 deferred
     0 lost carrier, 0 no carrier, 0 PAUSE output
     0 output buffer failures, 0 output buffers swapped out


bldgb-core#show interfaces gigabitEthernet 2/0/1
GigabitEthernet2/0/1 is down, line protocol is down (notconnect)
  Hardware is Gigabit Ethernet, address is 74a0.2f7e.3001 (bia 74a0.2f7e.3001)
  MTU 1500 bytes, BW 100000 Kbit/sec, DLY 100 usec,
     reliability 255/255, txload 1/255, rxload 1/255
  Encapsulation ARPA, loopback not set
  Keepalive not set
  Full-duplex, 100Mb/s, link type is auto, media type is 10/100/1000BaseTX SFP
  input flow-control is off, output flow-control is unsupported
  ARP type: ARPA, ARP Timeout 04:00:00
  Last input never, output 20:25:27, output hang never
  Last clearing of "show interface" counters never
  Input queue: 0/75/0/0 (size/max/drops/flushes); Total output drops: 346
  Queueing strategy: fifo
  Output queue: 0/40 (size/max)
  5 minute input rate 0 bits/sec, 0 packets/sec
  5 minute output rate 0 bits/sec, 0 packets/sec
     0 packets input, 0 bytes, 0 no buffer
     Received 0 broadcasts (0 multicasts)
     0 runts, 0 giants, 0 throttles
     0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored
     0 watchdog, 0 multicast, 0 pause input
     0 input packets with dribble condition detected
     160167 packets output, 19128660 bytes, 0 underruns
     0 output errors, 0 collisions, 2 interface resets
     0 unknown protocol drops
     0 babbles, 0 late collision, 0 deferred
     0 lost carrier, 0 no carrier, 0 pause output
     0 output buffer failures, 0 output buffers swapped out

bldga-core#show etherchannel summary
Flags:  D - down        P - bundled in port-channel
        I - stand-alone s - suspended
        H - Hot-standby (LACP only)
        R - Layer3      S - Layer2
        U - in use      f - failed to allocate aggregator

        M - not in use, minimum links not met
        u - unsuitable for bundling
        w - waiting to be aggregated
        d - default port


Number of channel-groups in use: 15
Number of aggregators:           15

Group  Port-channel  Protocol    Ports
------+-------------+-----------+-----------------------------------------------
1      Po1(SD)          -
14     Po14(SU)         -        Gi1/0/14(P) Gi2/0/8(P)
15     Po15(SU)         -        Gi1/0/15(P) Gi2/0/9(P)
16     Po16(SD)         -        Gi2/0/16(D)
17     Po17(SU)         -        Gi1/0/17(P) Gi2/0/17(P)
18     Po18(SD)         -
19     Po19(SU)         -        Gi1/0/22(P) Gi2/0/19(P)
20     Po20(SD)         -
21     Po21(SD)         -
22     Po22(SU)         -        Gi1/0/9(P)  Gi2/0/10(P) Gi2/0/14(P)
                                 Gi2/0/15(P)
23     Po23(SU)         -        Gi1/0/10(P) Gi1/0/18(P) Gi2/0/11(P)
                                 Gi2/0/18(P)
24     Po24(SU)         -        Gi2/0/5(P)  Gi2/0/6(P)
27     Po27(SD)         -        Gi2/0/23(D)
28     Po28(SU)         -        Gi1/0/28(P)
29     Po29(SD)         -

谢谢你的帮助!

3个回答

首先,您可能希望删除辅助上行链路上不必要的生成树配置。STP 根据链路速度计算成本度量。您的 100Mbit/sec CU 上行链路的默认成本为 19,而您的主要 1Gbit/sec SM 光纤上行链路的成本为 4,因此无需手动设置。

您还可以删除“访问 vlan 配置”,因为您的本地 vlan 666 中继配置将是首选。还要更改您允许的 vlan 配置以匹配主链接。我不知道您实际使用了哪些 vlan,但是如果您的主链接出现故障,不一致可能会成为一个很大的痛苦。

 interface GigabitEthernet2/0/28
 description "downlink trunk BldgB 100M-Backup"
 switchport access vlan 666              -> unnecessary
 switchport trunk encapsulation dot1q
 switchport trunk native vlan 666
 switchport trunk allowed vlan 2-99,101-109,111-4094
 switchport mode trunk
 switchport nonegotiate
 shutdown
 speed 100
 duplex full
 spanning-tree vlan 99 port-priority 128 -> unnecessary
 spanning-tree vlan 99 cost 50           -> unnecessary
end

来自 Gi1/0/28(站点 A)的一个有趣的计数器是接口上的输入错误。可能是第 1 层问题,但由于您没有任何 crc 错误并且现实性为 255/255,因此可能是由于重新插入电缆。

由于没有明显的配置问题,我建议重新启用端口并发布以下输出:

站点A:

show spanning-tree interface gi1/0/28
show spanning-tree detail

站点B:

show spanning-tree interface gi2/0/1
show spanning-tree detail

最后但并非最不重要的是,您能否提供以下信息:

  • 您在堆栈上运行哪个 IOS 版本?
  • 您的服务提供商是否提供透明的 L2 服务(双方收到的 BPDU?...您可以通过 show cdp neighbor 来检查两个站点是否都收到了 CDP 数据包)

生成树 (RSTP) 已禁用“新”端口,但将其检测为“备份”并使其丢弃所有数据包,并且在主上行链路出现故障时不启用它。

STP 应在主要故障时启用它。这是 STP 的正常行为。也许您没有启用快速 STP,切换到备份大约需要几分钟(50 秒)。

在两台交换机上运行“show spanning-tree summary”命令,它会在第一行显示操作模式。它应该是“交换机处于快速 pvst 模式”。如果没有 - 则在两个堆栈上都执行“快速生成树模式”。

STP 可以工作,但我可能会使用EEM并编写自定义解决方案的脚本。您应该能够在故障转移和故障恢复速度方面击败 STP。

也许使用IP 设备跟踪来检测主链路上的交换机对等点,并在检测到故障时管理备份链路。也许您可以通过在到 CAM 表的远程备份链接的 MAC 地址中编写脚本来启动帧的重新路由?

我没有实验室所以... ...只是一个想法。