将 PT 和 EtherChannel 与 STP 一起使用

网络工程 思科 生成树 数据包跟踪器 以太通道
2022-02-17 21:41:15

我对这一切都很陌生,但我正在尝试创建一个网络拓扑作为实践,它在三个交换机上使用三个以太通道,然后依靠 STP 阻止一个。到目前为止,它运作良好。但是,当我查看生成树时,我看到虽然以太通道说它正在阻塞,但我正在使用的端口(据我所知不应该显示在生成树中)正在显示并说他们正在转发。这是什么问题,因为我花了几个小时在谷歌上搜索,但找不到解决方案。

另外我不明白为什么我显示 VLAN 0020 和 VLAN 0001 如果是这种情况,我确实有一个计划 20 设置,但你也可以解释一下吗?任何帮助都将成为救命稻草。

P01 应该包含 G0/1 & G0/2

p02 应该包含 Fa0/23 & fa0/24

    Switch#show spanning-tree 
VLAN0001
  Spanning tree enabled protocol ieee
  Root ID    Priority    32769
             Address     0000.0C7D.2383
             Cost        3
             Port        27(Port-channel1)
             Hello Time  2 sec  Max Age 20 sec  Forward Delay 15 sec

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

Interface        Role Sts Cost      Prio.Nbr Type
---------------- ---- --- --------- -------- --------------------------------
Fa0/2            Desg FWD 19        128.2    P2p
Po2              Altn BLK 9         128.28   Shr
Po1              Root FWD 3         128.27   Shr
Fa0/1            Desg FWD 19        128.1    P2p

VLAN0020
  Spanning tree enabled protocol ieee
  Root ID    Priority    32788
             Address     0000.0C7D.2383
             Cost        3
             Port        27(Port-channel1)
             Hello Time  2 sec  Max Age 20 sec  Forward Delay 15 sec

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

Interface        Role Sts Cost      Prio.Nbr Type
---------------- ---- --- --------- -------- --------------------------------
Fa0/3            Desg FWD 19        128.3    P2p
Po2              Altn BLK 9         128.28   Shr
Po1              Root FWD 3         128.27   Shr

Switch#
Switch#
Switch#show eth
Switch#show etherchannel su
Switch#show etherchannel summary 
Flags:  D - down        P - 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
        u - unsuitable for bundling
        w - waiting to be aggregated
        d - default port


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

Group  Port-channel  Protocol    Ports
------+-------------+-----------+----------------------------------------------

1      Po1(SU)           LACP   Gig0/1(P) Gig0/2(P) 
2      Po2(SU)           LACP   Fa0/23(P) Fa0/24(P) 
Switch#

我的交换机配置如下

开关 0:

Switch#show running-config 
Building configuration...

Current configuration : 1413 bytes
!
version 15.0
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname Switch
!
!
!
!
!
!
spanning-tree mode pvst
spanning-tree extend system-id
!
interface Port-channel1
 switchport mode trunk
!
interface Port-channel2
 switchport mode trunk
!
interface FastEthernet0/1
!
interface FastEthernet0/2
!
interface FastEthernet0/3
 switchport access vlan 20
!
interface FastEthernet0/4
!
interface FastEthernet0/5
!
interface FastEthernet0/6
!
interface FastEthernet0/7
!
interface FastEthernet0/8
!
interface FastEthernet0/9
!
interface FastEthernet0/10
!
interface FastEthernet0/11
!
interface FastEthernet0/12
!
interface FastEthernet0/13
!
interface FastEthernet0/14
!
interface FastEthernet0/15
!
interface FastEthernet0/16
!
interface FastEthernet0/17
!
interface FastEthernet0/18
!
interface FastEthernet0/19
!
interface FastEthernet0/20
!
interface FastEthernet0/21
!
interface FastEthernet0/22
!
interface FastEthernet0/23
 switchport mode trunk
 channel-group 2 mode active
!
interface FastEthernet0/24
 switchport mode trunk
 channel-group 2 mode active
!
interface GigabitEthernet0/1
 switchport mode trunk
 channel-group 1 mode active
!
interface GigabitEthernet0/2
 switchport mode trunk
 channel-group 1 mode active
!
interface Vlan1
 no ip address
 shutdown
!
!
!
!
line con 0
!
line vty 0 4
 login
line vty 5 15
 login
!
!
!
!
end

开关 1:

Switch#show running-config 
Building configuration...

Current configuration : 1413 bytes
!
version 15.0
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname Switch
!
!
!
!
!
!
spanning-tree mode pvst
spanning-tree extend system-id
!
interface Port-channel2
 switchport mode trunk
!
interface Port-channel3
 switchport mode trunk
!
interface FastEthernet0/1
!
interface FastEthernet0/2
!
interface FastEthernet0/3
 switchport access vlan 20
!
interface FastEthernet0/4
!
interface FastEthernet0/5
!
interface FastEthernet0/6
!
interface FastEthernet0/7
!
interface FastEthernet0/8
!
interface FastEthernet0/9
!
interface FastEthernet0/10
!
interface FastEthernet0/11
!
interface FastEthernet0/12
!
interface FastEthernet0/13
!
interface FastEthernet0/14
!
interface FastEthernet0/15
!
interface FastEthernet0/16
!
interface FastEthernet0/17
!
interface FastEthernet0/18
!
interface FastEthernet0/19
!
interface FastEthernet0/20
!
interface FastEthernet0/21
!
interface FastEthernet0/22
!
interface FastEthernet0/23
 switchport mode trunk
 channel-group 2 mode active
!
interface FastEthernet0/24
 switchport mode trunk
 channel-group 2 mode active
!
interface GigabitEthernet0/1
 switchport mode trunk
 channel-group 3 mode active
!
interface GigabitEthernet0/2
 switchport mode trunk
 channel-group 3 mode active
!
interface Vlan1
 no ip address
 shutdown
!
!
!
!
line con 0
!
line vty 0 4
 login
line vty 5 15
 login
!
!
!
!
end

开关 2:

Switch#show running-config 
Building configuration...

Current configuration : 929 bytes
!
version 12.1
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname Switch
!
!
!
!
!
!
spanning-tree mode pvst
spanning-tree extend system-id
!
interface Port-channel1
 switchport mode trunk
!
interface Port-channel3
 switchport mode trunk
!
interface FastEthernet0/1
!
interface FastEthernet1/1
!
interface FastEthernet2/1
!
interface FastEthernet3/1
!
interface FastEthernet4/1
!
interface FastEthernet5/1
!
interface GigabitEthernet6/1
 switchport mode trunk
 channel-group 1 mode active
!
interface GigabitEthernet7/1
 switchport mode trunk
 channel-group 1 mode active
!
interface GigabitEthernet8/1
 switchport mode trunk
 channel-group 3 mode active
!
interface GigabitEthernet9/1
 switchport mode trunk
 channel-group 3 mode active
!
interface Vlan1
 no ip address
 shutdown
!
!
!
!
line con 0
!
line vty 0 4
 login
line vty 5 15
 login
!
!
!
!
end


Switch#
Switch#

我的网络拓扑如下所示

在此处输入图像描述

1个回答

当我查看生成树时,我看到虽然以太通道说它正在阻塞,但我正在使用的端口(据我所知不应该显示在生成树中)正在出现并说它们是转发。

这是完全正常的。在生成树中,所有物理链路保持链接。他们需要这样做,因为仍然需要发送 BPDU(在指定端口上)和接收 BPDU。阻塞的端口(或通道组)根本不转发正常帧。

与 EtherChannel 或 LAG 聚合的接口的转发状态无关。频道组的状态是。

为什么我显示 VLAN 0020 和 VLAN 0001

您已将 VLAN 20 配置为在两台交换机上进行访问。由于您只是在使用switchport mode trunk,因此所有 VLAN 都经过中继。

您应该始终使用VLAN x甚至更好地显式创建 VLAN VLAN x name whatevermakessense,否则它们可能不会在某些设备上自动创建。

请注意,spanning-tree mode pvst将协议设置为 RPVST+ 模式,为每个 VLAN 创建一个独立的生成树。该模式是思科专有的,只有少数其他供应商支持。

标准的 IEEE 协议是 RSTP 和 MSTP。虽然 RSTP 完全与 VLAN 无关(并且可能会破坏 VLAN 分布不完整的网络),但 MSTP 允许您将 VLAN 分组为多个 ST 实例,每个实例具有独立的生成树。