朋友们是否经历过客户网络设备替换割接,如果被替换的设备和新设备不是一个厂商,往往在割接准备过程中会暴露出很多棘手的问题。例如,设备厂商往往有大量的私有协议从而导致了在不同厂商设备之间无法正常互联互通。如果碰到这种情况你会怎么做?

我想无外乎以下两种种可能性:

  1. 修改新设备网络设计方案,针对目前旧设备做出妥协,从而避免私有协议带来的网络故障问题。

  2. 寻找一个共通的标准协议,并把老设备的协议逐步替换成业界标准协议。完成以后再准备替换工作。

 

但是两个方案都不是最优方案

方案一虽然实施起来相对容易,缩短工期。但是由于否决最优化组网设计并替换成其他兼容性设计对客户的网络会造成深远的影响。同时也大大增加了后期网络故障排错的困难。

方案二长期来说是最好的,但是实施起来费时费力,无形之间增加了项目的人力成本和时间成本。

那么,在某些特定情况下能否找到第三个方案,通过仔细研究私有协议特性,从而让两个厂商的私有协议互联互通,最终达到和谐相处呢?

答案是肯定的,下面我将以一个实际网络替换案例,给大家演示如何从发现问题,研究分析问题,到最终解决问题的一套整体思路。希望朋友们能够从中有所收获并能举一反三应用到日常工作中。

 

网络割接场景:

 

某客户有大量Cisco 二层交换机分布在各个部门楼层,同时也有2台核心Cisco三层交换机用于路由各个部门楼层之间的三层流量数据。因为年代久远,容量跟不上现代网络的发展。因此客户决定全网替换为Juniper 设备。

根据客户的要求,我们需要平滑迁移所有业务,尽可能的降低断网时间。并要求不要对网络做巨大改动,完成硬件替换就行。这就意味着,新的Juniper设备需要继承目前Cisco设备的二层三层设计模型。

 

困难与故障:

由于之前网络设计原因,两台Cisco核心三层交换机是维护着全网的VLAN 信息,并通过VLAN interface路由三层流量。同时全网的管理网段全放在了 Native VLAN 1里面。所有交换机之间运行Cisco默认的PVST+生成树协议。

 

 

而新安装的Juniper的EX和QFX系列交换机默认运行RSTP 协议,如果贸然接入Juniper交换机,两个不同厂商的交换机使用不同的沟通语言,势必会造成生成树状态不一致,从而导致对同一个VLAN而言Cisco交换机阻塞的的端口和Juniper 阻塞的端口不同。另外一个问题是Cisco为每一个VLAN维护一个STP实例,而Juniper由于RSTP为所有VLAN统一维护一个STP实例,这种情况同样会造成端口阻塞不一致,从而导致网络迁移中出现故障。


如下图所示:在某些情况下,因为运行不同的协议,导致Cisco的spanning-tree生成树计算结果与Juniper的计算结果不一致,Cisco切断了左边端口,而Juniper切断了右边的端口。从而在平滑迁移过程中,Cisco和Juniper互联的临时线路被Spanning-tree完全阻断。

 

问题分析:

乍看之下,觉得两个完全不同的厂商协议,肯定没法互联互通。但是如果光凭感觉考虑问题,事情往往最后都会走到死胡同里。反之,我们应该通过认真的思考并理清思路来考虑如何处理此问题。

 

仔细考虑后,我个人分析思路如下:

 

有了总体的思维流程图,那我们就按部就班的来处理问题。

因为本场景客户使用的为PVST+生成树模式,所以我们暂不考虑Cisco的其他MSTP和R-PVST+,只有等到PVST+方案的确走不通的情况下,我们再考虑迁移生成树协议的问题。

 

剖析PVST+

它是Cisco的私有协议,在原IEEE-802.1D标准的基础上加上特定扩展属性修改而来。它也是所有Cisco Catalyst交换机系列的默认生成树协议。相比标准的RSTP或MSTP,其优势是为每一个VLAN维护了一个独立的拓扑结构,并作单独计算。这样的话,针对冗余链路我们可以通过调整不同VLAN的生成树优先级从而实现二层帧上的负载均衡。

但是其优势反过来讲却是弱势,更多的计算量就意味着更多的CPU资源。同时如上述所说,它是Cisco的私有协议,不具有兼容性。

那么,光了解上面的信息就够了么?肯定不够。我们需要再深入,在开始下面内容之前,大家回想下,还记得PVST+的数据包格式吗?它都用什么机制互相沟通的?

 

我们知道,在运行PVST+的交换机之间,他们使用BPDU(全名Bridge Protocol Data Unit)数据包来互相沟通,把PVST+看做一个人的话,BPDU就类似他们之间发的email邮件。

那发邮件总得有个xx@xx.com的地址吧,同样的BPDU之间沟通也需要一个地址。为了发掘这个地址,让我们在实验室来做一个简单的抓包测试。

 

#知识学习-实验室抓包测试环境#

如上图,我们现在有两台Cisco Catalyst 交换机,两台交换机配置如下:

VLAN 1 (Native)

VLAN 10 (TaggedVLAN)

VLAN20 (TaggedVLAN)

 

STP模式:PVST+

 

以下为设备详细信息:

 

####接口配置###

SW13#show run inte0/0 interfaceEthernet0/0  switchport trunk encapsulation dot1q  switchport mode trunk end

 

###VLAN 配置###

SW13#show vlan brief VLAN Name                             Status    Ports ------------------------------------ --------- ------------------------------- 1    default                          active    Et0/1, Et0/2, Et0/3 10   VLAN0010                         active    20   VLAN0020                         active

 

###TRUNK配置###

SW13#show in trunk Port        Mode             Encapsulation  Status       Nativevlan Et0/0       on               802.1q         trunking      1 Port        Vlans allowed on trunk Et0/0       1-4094 Port        Vlans allowed and active in management domain Et0/0       1,10,20 Port        Vlans in spanning tree forwarding state and not pruned Et0/0       1,10,20 SW13#

 

###接口NativeVLAN信息###

SW13#show int e0/0 switchport | in Native Trunking Native Mode VLAN: 1 (default) Administrative Native VLAN tagging: enabled Administrative private-vlan trunk Native VLAN tagging: enabled SW13#

 

 

###生成树概况###

SW13# show spanning-tree summary   Switch is inpvstmode Root bridgefor: VLAN0001, VLAN0010, VLAN0020 Extended system ID                      is enabled PortfastDefault                        is disabled Portfast Edge BPDU Guard Default        is disabled Portfast Edge BPDU Filter Default       is disabled Loopguard Default                       is disabled PVST Simulation Default                 is enabled but inactive inpvstmode Bridge Assurance                        is enabled but inactive inpvstmode Ether Channel misconfig guard            is enabled Configured Pathcost method used is short Uplink Fast                              is disabled Backbone Fast                            is disabled   Name                   Blocking Listening Learning Forwarding STP Active ------------------------------ --------- -------- ---------- ---------- VLAN0001                     0         0        0          4         4 VLAN0010                     0         0        0          1          1 VLAN0020                     0         0        0          1          1 ------------------------------ --------- -------- ---------- ---------- 3 vlans                      0         0       0          6          6

#知识学习-Wireshark抓包分析#

 

抓包总览:

 

单包分析:

 

####带VLAN标签的VLAN (1)BPDU数据包###

 

####不带VLAN标签的VLAN1(1) BPDU数据包####

 

VLAN10 以及VLAN20的数据包:

 

####VLAN 10 BPDU数据包####

 

##VLAN 20 BPDU数据包###


 

通过上面抓包截图,让我们先分析VLAN10,VLAN20的BPDU包

这两个数据包为典型的Cisco PVST+ BPDU数据包。

首先两个数据包都打上了802.1Q的VLAN标签。标签ID就是VLAN ID。

目标MAC地址是01:00:0c:cc:cc:cd,为PVST+ Cisco私有MAC地址。

STP包内容是标准的BPDUConfiguration包。

 

接着我们回过头来看看VLAN1的BPDU包,VLAN1的包就有点意思了

大家有没有注意到,VLAN 1按道理是Native VLAN,那就意味着VLAN 1是肯定不打VLAN 标签的。但是为什么发送的BPDU包却带了一个VLAN 1的标签。更神奇的是,VLAN1还同时发送了一个不带VLAN标签的BPDU包。

 

让我们继续分析VLAN1这两BPDU的区别:

 

带VLAN标签的BPDU目标MAC为01:00:0c:cc:cc:cd

而不带VLAN标签的BPDU目标MAC却是01:80:c2:00:00:00。这个MAC地址可是标准的IEEE802.1d 的MAC地址。

 

说到这里,我们是否可以发散下思维,做个猜想:既然是标准的IEEE格式MAC地址,那是否VLAN1 可以和其他非Cisco厂商通讯呢? 先把疑问放这里,我们继续往下走。


#知识学习-实验室抓包测试结束#

 

 

通过上面的简单测试,总结如下:

对于Cisco交换机而言。在802.1Q Trunk接口下,STP生成树的BPDU 目标MAC分为两种情况:

  1. 对于VLAN ID不等于1的情况下,其目标MAC地址为Cisco 私有的PVST+  MAC 01:00:0c:cc:cc:cd

  2. 如果VLAN ID为VLAN 1,则会发送两个版本的BPDU:

  3. 1.一个为带上802.1Q的VLAN ID=1的BPDU包,其目标MAC地址为PVST+  MAC 01:00:0c:cc:cc:cd

  4. 2.另外一个为不带VLAN标签的数据包目标MAC是01:80:c2:00:00:00,其为标准的IEEE 802.1D格式。

 

 

 

Juniper设备STP协议分析

完成Cisco的剖析以后,让我们来看看Juniper都支持什么STP生成树协议,看看有什么协议工具能够供我们使用的。

 

MSTP多生成树:

无论Cisco或者Juniper,两者都是基于IEEE 802.1s协议开发。MSTP通过在不同区域维护不同的生成树实例,并映射相应的VLAN到对应的实例。其目标MAC地址为:01:80:c2:00:00:00。

 

RSTP快速生成树:

增强版的STP生成树,RSTP大大加速了网络收敛时间,从原来的STP 50秒到6秒左右。RSTP里面定义了大量新的端口角色。其目标MAC地址为:01:80:c2:00:00:00。

 

VSTP VLAN生成树:

Juniper私有的生成树协议。顾名思义,VSTP的能为每一个VLAN单独维护一个STP网络拓扑,并单独计算。 通过查询文档,发现其更重要的一个特性:其目标MAC地址为:01:00:0c:cc:cc:cd

 

通过以上的理论分析,大家是否已经看出一些端倪。

没错,这里很容易联想到:Juniper的VSTP也许能够和Cisco的PVST+和谐共处。

 

纠结的Native VLAN 1

 

在撸起袖子干之前,还有一个疑问:VLAN 1怎么处理? 

对Cisco而言,PVST+在Native VLAN 1上发送两个版本的BPDU,一个是不带VLAN标签的IEEE802.1d MAC 01:80:c2:00:00:00的BPDU,而Cisco 私有的01:00:0c:cc:cc:cd MAC地址格式的BPDU却是带上了VLAN ID= 1的802.1Q的标签。

 

同时为了让Cisco 上Native VLAN 1的用户正常数据流量能够畅通无阻的进入Juniper网络,Juniper对接接口上也得配置Native VLAN 1。

 

但是带来的副作用就是,如果我们启用Juniper的VSTP来对接Cisco的PVST+,VSTP在VLAN 1上会发送不带标签的BPDU数据包,而此BPDU数据包MAC地址为01:00:0c:cc:cc:cd。这就与Cisco的PVST+在NativeVLAN的行为不吻合了。

 

为了解决以上问题,让我们回到Juniper的RSTP协议。通过之前的介绍,RSTP全局维护了一个STP生成树实例,而且使用IEEE802.1d 的BPDU MAC 01:80:c2:00:00:00地址格式。那我们是否可以利用RSTP这个特性,让其与Cisco的PVST+ NativeVLAN 1 对接?

 

理论分析总结:

 

完成理论分析以后,我们得出如下实施方案:

针对Cisco的PVST+ Native VLAN 1,我们用Juniper的RSTP与其对接。

而其余Cisco的PVST+ VLAN, 我们则用Juniper的VSTP与其对接。

 

实践出真知

 

为了证明我们的理论推理的正确性,正如马克思主义认识论的那句话实践不仅是检验真理的标准,而且是唯一的标准。让我们来搭建一个实验环境测试并验证此推论。

 

测试环境如下:

 

 

配置介绍:

Juniper:

两个QFX-RE20 &QFX-RE21 xe-0/0/2接口均为Trunk,Native VLAN 1。

VLAN 列表为:VLAN 1, VLAN10,VLAN20。

VLAN 1 开启了RSTP,VLAN10-20 开启了VSTP。

 

Cisco:

两个Cisco CoreSW16 &CoreSW17 e0/2 接口为Trunk,Native VLAN1。

VLAN 列表为:VLAN 1, VLAN10,VLAN20。

所有VLAN默认开启PVST+。

 

 

具体配置:

###QFX-RE20###

root@vQFX-RE20>show configuration interfaces xe-0/0/2 | display set set interfaces xe-0/0/2 native-vlan-id 1 set interfaces xe-0/0/2 unit 0 family ethernet-switching interface-mode trunk set interfaces xe-0/0/2 unit 0 family ethernet-switching vlan members all   root@vQFX-RE20>show configuration protocols | display set set protocols rstp interface all set protocols vstp interface all set protocols vstp vlan10 set protocols vstp vlan20   root@vQFX-RE20>show configuration vlans | display set set vlans VLAN10 vlan-id10 set vlans VLAN10 l3-interface irb.10 set vlans VLAN20 vlan-id20 set vlans VLAN20 l3-interface irb.20 set vlans default vlan-id 1 set vlans defaul tl3-interface irb.1   root@vQFX-RE20>show configuration interfacesirb| display set set interfaces irb unit 1 family inet address 10.0.0.20/24 set interfaces irb unit 10 family inet address 10.1.1.20/24 set interfaces irb unit 20 family inet address 10.2.2.20/24



###QFX-RE21###


root@vQFX-RE21>show configuration interfaces xe-0/0/2 | display set set interfaces xe-0/0/2 native-vlan-id 1 set interfaces xe-0/0/2 unit 0 family ethernet-switching interface-mode trunk set interfaces xe-0/0/2 unit 0 family ethernet-switchingvlanmembers all   root@vQFX-RE21>show configuration protocols | display set set protocols rstp interface all set protocols vstp interface all set protocols vstp vlan10 set protocols vstp vlan20   root@vQFX-RE21>show configuration vlans | display set set vlans VLAN10 vlan-id 10 set vlans VLAN10 l3-interface irb.10 set vlans VLAN20 vlan-id 20 set vlans VLAN20 l3-interface irb.20 set vlans default vlan-id 1 set vlans default l3-interface irb.1   root@vQFX-RE21>show configuration interfaces irb | display set set interfaces irb unit 1 family inet address 10.0.0.21/24 set interfaces irb unit 10 family inet address 10.1.1.21/24 set interfaces irb unit 20 family inet address 10.2.2.21/24

 

###CISCO Core SW16###

 

CISCO_SWC16#show run int e0/2

interfaceEthernet0/2  switchport trunk encapsulation dot1q  switchport mode trunk

 

CISCO_SWC16#show run | in spann

spanning-tree mode pvst spanning-tree extend system-id

 

CISCO_SWC16#show vlan brief

VLAN Name                             Status    Ports ------------------------------------ --------- ------------------------------- 1    default                          active    Et0/3 10   VLAN0010                         active 20   VLAN0020                         active   CISCO_SWC16#show int trunk Port        Mode             Encapsulation  Status       Nativevlan Et0/0       on               802.1q         trunking      1 Et0/1       on               802.1q         trunking      1 Et0/2       on               802.1q         trunking     1   Port        Vlans allowed on trunk Et0/0       1-4094 Et0/1       1-4094 Et0/2       1-4094   Port        Vlans allowed and active in management domain Et0/0       1,10,20 Et0/1       1,10,20 Et0/2       1,10,20   Port        Vlans in spanning tree forwarding state and not pruned Et0/0       1,10,20 Et0/1       1,10,20 Et0/2       1,10,20

 

###CISCO Core SW17###

 

Cisco_SW17#show run int e0/2

interfaceEthernet0/2  switchporttrunk encapsulation dot1q  switchportmode trunk

 

Cisco_SW17#show run  | in spann

spanning-tree modepvst spanning-tree extend system-id

 

Cisco_SW17#show vlan brief

VLAN Name                             Status    Ports ------------------------------------ --------- ------------------------------- 1    default                          active    Et0/3 10   VLAN0010                         active 20   VLAN0020                         active   Cisco_SW17#show int trunk Port        Mode             Encapsulation  Status       Nativevlan Et0/0       auto             n-802.1q       trunking      1 Et0/1       auto             n-802.1q       trunking      1 Et0/2       on               802.1q         trunking      1   Port        Vlans allowed on trunk Et0/0       1-4094 Et0/1       1-4094 Et0/2       1-4094   Port        Vlans allowed and active in management domain Et0/0       1,10,20 Et0/1       1,10,20 Et0/2       1,10,20   Port        Vlans in spanning tree forwarding state and not pruned Et0/0       1,10,20 Et0/1       1,10,20 Et0/2       1,10,20

 

验证效果

 

让我们先查看Cisco的STP生成树状态:

 

###CISCO_SW16###

 CISCO_SWC16#show spanning-tree

 

VLAN0001

  Spanning tree enabled protocolieee   Root ID   Priority    32768             Address    0205.8671.a802             Cost        100             Port        3 (Ethernet0/2)              Hello Time   2 sec Max Age 20 sec  Forward Delay 15sec     Bridge ID Priority    32769  (priority 32768 sys-id-ext 1)             Address    aabb.cc00.9000              Hello Time   2 sec Max Age 20 sec  Forward Delay 15sec             Aging Time  15  sec   Interface          Role Sts Cost      Prio.Nbr Type ----------------------- --- --------- -------- -------------------------------- Et0/0              Desg FWD 100       128.1    Shr Et0/1              Desg FWD 100       128.2    Shr Et0/2              Root FWD 100       128.3    Shr Et0/3              Desg FWD 100       128.4    Shr

 

VLAN0010

 

Spanning tree enabled protocolieee   Root ID   Priority    32778             Address    0205.8671.a802             Cost        100             Port        3 (Ethernet0/2)              Hello Time   2 sec Max Age 20 sec  Forward Delay 15sec     Bridge ID Priority    32778  (priority 32768 sys-id-ext 10)             Address     aabb.cc00.9000              Hello Time   2 sec Max Age 20 sec  Forward Delay 15sec             Aging Time  15  sec   Interface          Role Sts Cost      Prio.Nbr Type ----------------------- --- --------- -------- -------------------------------- Et0/0               Desg FWD 100       128.1   Shr Et0/1              Desg FWD 100       128.2    Shr Et0/2              Root FWD 100       128.3    Shr

 

VLAN0020

  Spanning tree enabled protocolieee   Root ID   Priority    32788             Address     0205.8671.a802             Cost        100             Port        3 (Ethernet0/2)              Hello Time   2 sec Max Age 20 sec  Forward Delay 15sec     Bridge ID Priority    32788  (priority 32768 sys-id-ext 20)             Address    aabb.cc00.9000              Hello Time   2 sec Max Age 20 sec  Forward Delay 15sec             Aging Time  15  sec   Interface          Role Sts Cost      Prio.Nbr Type ----------------------- --- --------- -------- -------------------------------- Et0/0              Desg FWD 100       128.1   Shr Et0/1              Desg FWD 100       128.2    Shr Et0/2              Root FWD 100       128.3    Shr

 

 

###CISCO_SW17###

 Cisco_SW17#show spanning-tree

 

VLAN0001

 

Spanning tree enabled protocolieee   Root ID   Priority    32768              Address     0205.8671.a802              Cost        200              Port        2 (Ethernet0/1)              Hello Time   2 sec Max Age 20 sec  Forward Delay 15sec     Bridge ID Priority    32769  (priority 32768 sys-id-ext 1)              Address     aabb.cc00.a000              Hello Time   2 sec Max Age 20 sec  Forward Delay 15sec              Aging Time  300 sec   Interface           Role Sts Cost      Prio.Nbr Type ----------------------- --- --------- -------- -------------------------------- Et0/0               Desg FWD 100       128.1   Shr Et0/1               Root FWD 100       128.2   Shr Et0/2               Desg FWD 100       128.3   Shr Et0/3               Desg FWD 100       128.4   Shr

 

VLAN0010

  Spanning tree enabled protocolieee   Root ID   Priority    32778              Address     0205.8671.a802              Cost        200              Port        2 (Ethernet0/1)              Hello Time   2 sec Max Age 20 sec  Forward Delay 15sec     Bridge ID Priority    32778 (priority 32768 sys-id-ext 10)             Address     aabb.cc00.a000              Hello Time   2 sec Max Age 20 sec  Forward Delay 15sec              Aging Time  300 sec   Interface           Role Sts Cost      Prio.Nbr Type ----------------------- --- --------- -------- -------------------------------- Et0/0               Desg FWD 100       128.1   Shr Et0/1               Root FWD 100       128.2   Shr Et0/2               Desg FWD 100       128.3   Shr

 

VLAN0020

 

Spanning tree enabled protocolieee   Root ID   Priority    32788             Address     0205.8671.a802              Cost        200              Port        2 (Ethernet0/1)              Hello Time   2 sec Max Age 20 sec  Forward Delay 15sec     Bridge ID Priority    32788  (priority 32768 sys-id-ext 20)             Address     aabb.cc00.a000              Hello Time   2 sec Max Age 20 sec  Forward Delay 15sec              Aging Time  300 sec   Interface           Role Sts Cost      Prio.Nbr Type ----------------------- --- --------- -------- -------------------------------- Et0/0               Desg FWD 100       128.1   Shr Et0/1               Root FWD 100       128.2   Shr Et0/2               Desg FWD 100       128.3   Shr

 

大家是否已经发现,Cisco 的核心交换机已经把STP生成树的根桥改为0205.8671.a802,而非Cisco设备自身,同时在Cisco_SW16上根端口为e0/2,指向Juniper核心交换机设备。那这0205.8671.a802是谁呢,让我们继续往下看Juniper的STP生成树信息。

 

###JunipervQFX_RE20###

root@vQFX-RE20> show spanning-tree bridge

STP bridgeparameters Routing instancename               : GLOBAL Context ID                          : 0 Enabledprotocol                    : RSTP   Root ID                           : 32768.02:05:86:71:a8:02   Hello time                        : 2 seconds   Maximum age                       : 20 seconds   Forward delay                     : 15 seconds   Message age                       : 0   Number of topology changes        : 7   Time since last topology change   : 339 seconds   Local parameters     Bridge ID                       : 32768.02:05:86:71:a8:02     Extended system ID              : 0

 

STP bridge parameters for VLAN 10

 

Root ID                           : 32778.02:05:86:71:a8:02   Hello time                        : 2 seconds   Maximum age                       : 20 seconds   Forward delay                     : 15 seconds   Message age                       : 0   Number of topology changes        : 6   Time since last topology change   : 339 seconds   Local parameters     Bridge ID                       :32778.02:05:86:71:a8:02     Extended system ID              : 10

 

STP bridge parameters for VLAN 20

  Root ID                           : 32788.02:05:86:71:a8:02   Hello time                        : 2 seconds   Maximum age                       : 20 seconds   Forward delay                     : 15 seconds   Message age                       : 0   Number of topology changes        : 3   Time since last topology change   : 339 seconds   Local parameters     Bridge ID                       :32788.02:05:86:71:a8:02     Extended system ID              : 20

 

 

root@vQFX-RE20> show spanning-tree interface  <<根交换机,所有接口都是指定端口角色。

Spanning tree interface parameters for instance0

Interface                  Port ID    Designated         Designated         Port   State  Role                                        port ID           bridge ID          Cost xe-0/0/0                   128:490      128:490 32768.02058671a802         2000    FWD   DESG xe-0/0/1                   128:491      128:491 32768.02058671a802         2000    FWD   DESG xe-0/0/2                   128:492      128:492 32768.02058671a802        2000    FWD    DESG

 

Spanning tree interface parameters for VLAN 10

 

Interface                  Port ID    Designated         Designated         Port   State  Role                                        port ID           bridge ID          Cost xe-0/0/0                   128:490      128:490 32778.02058671a802         2000    FWD   DESG xe-0/0/1                   128:491      128:491 32778.02058671a802         2000    FWD   DESG xe-0/0/2                   128:492      128:492 32778.02058671a802        2000    FWD    DESG

Spanning tree interface parameters for VLAN 20

 

Interface                  Port ID    Designated         Designated         Port   State  Role                                        port ID           bridge ID          Cost xe-0/0/0                   128:490      128:490 32788.02058671a802         2000    FWD   DESG xe-0/0/1                   128:491      128:491 32788.02058671a802         2000    FWD   DESG xe-0/0/2                   128:492      128:492 32788.02058671a802        2000    FWD    DESG

 

###JunipervQFX_RE21###

 

root@vQFX-RE21> show spanning-tree bridge

STP bridge parameters Routing instancename               :GLOBAL Context ID                          : 0 Enabledprotocol                    :RSTP   RootID                           : 32768.02:05:86:71:a8:02   Rootcost                         : 2000   Rootport                         : xe-0/0/1   Hellotime                        : 2 seconds   Maximumage                       : 20 seconds   Forwarddelay                     : 15 seconds   Messageage                       : 1   Number of topology changes        : 7   Time since last topology change   : 420 seconds   Local parameters     BridgeID                       : 32768.02:05:86:71:ca:02     Extendedsystem ID              : 0

 

STP bridge parameters for VLAN 10

 

RootID                           :32778.02:05:86:71:a8:02   Rootcost                         : 2000   Rootport                         : xe-0/0/1   Hellotime                        : 2 seconds   Maximumage                       : 20 seconds   Forwarddelay                     : 15 seconds   Messageage                       : 1   Number of topology changes        : 1   Time since last topology change   : 4178 seconds   Local parameters     BridgeID                       :32778.02:05:86:71:ca:02     Extendedsystem ID              : 10

 

STP bridge parameters for VLAN 20

  RootID                           :32788.02:05:86:71:a8:02   Rootcost                         : 2000   Rootport                         : xe-0/0/1   Hellotime                        : 2 seconds   Maximumage                       : 20 seconds   Forwarddelay                     : 15 seconds   Messageage                       : 1   Number of topology changes        : 1   Time since last topology change   : 2104 seconds   Local parameters     BridgeID                       :32788.02:05:86:71:ca:02 Extended system ID              : 20

 

 

root@vQFX-RE21> show spanning-tree interface

Spanning tree interface parameters for instance 0 Interface                  Port ID    Designated         Designated         Port   State  Role                                        portID           bridge ID          Cost xe-0/0/0                   128:490      128:490 32768.02058671ca02        2000    FWD    DESG xe-0/0/1                   128:491      128:491 32768.02058671a802         2000    FWD   ROOT xe-0/0/2                   128:492        128:3 32769.aabbcc00a000         2000    BLK   ALT

 

Spanning tree interface parameters for VLAN 10

 

Interface                  Port ID    Designated         Designated         Port   State  Role                                        portID           bridge ID          Cost xe-0/0/0                   128:490      128:490 32778.02058671ca02        2000    FWD    DESG xe-0/0/1                   128:491      128:491 32778.02058671a802         2000    FWD   ROOT xe-0/0/2                   128:492        128:3 32778.aabbcc00a000         2000    BLK   ALT

 

STP bridge parameters for VLAN 10

 

Interface                  Port ID    Designated         Designated         Port   State  Role                                        portID           bridge ID          Cost xe-0/0/0                   128:490      128:490 32788.02058671ca02        2000    FWD    DESG xe-0/0/1                   128:491      128:491 32788.02058671a802         2000    FWD   ROOT xe-0/0/2                   128:492        128:3 32788.aabbcc00a000         2000   BLK    ALT

 

通过以上STP生成树命令行输出,可以看出目前设备的根桥是在Juniper的vQFX_RE20。

同时需要注意的是,在Juniper上,没有VLAN 1的VSTP实例,而是RSTP实例。而在VLAN 10 以及VLAN 20上,运行的为VSTP。

 

通过实验室验证,我们现在确定上文的理论推理是正确的,通过和客户沟通协商后,就可以在生产环境实施了。

大功告成!

 

文章总结:

 

这篇文章,我们认真分析了不同厂商私有STP生成树协议对接的问题,以及各种可能的解决方法,并最终通过实验验证了其可行性并付诸于实践。

 

实践过程中,我们需要在Juniper的EX或QFX系列交换机上开启RSTP与VSTP。并做如下对接:

 

Cisco PVST+ NativeVLAN 1 <-> Juniper RSTP

Cisco PVST+ VLAN X <-> Juniper VSTP

同时需要在Juniper与Cisco对接的接口上开启native-vlan-id 1 的功能。

 

当然日常工作中大家可能还会遇到其他私有协议之间的兼容性问题。但是万变不离其宗,只要掌握了正确的思维方法,总会找到解决方案。

 

最后,给大家留一个问题:猜猜在交换机的Access接口下,Native VLAN和其他VLAN的BPDU MAC目标地址会是什么?

选项:(1)标准的IEEE 802.1d MAC  (2)Cisco 私有的PVST+ MAC。