帮助我们改善您的体验。

让我们了解您的想法。

您是否能抽出两分钟的时间完成一份问卷调查?

header-navigation
keyboard_arrow_up
close
keyboard_arrow_left
生成树协议用户指南
Table of Contents Expand all
list Table of Contents

机器翻译对您有帮助吗?

starstarstarstarstar
Go to English page
免责声明:

我们将使用第三方机器翻译软件翻译本页面。瞻博网络虽已做出相当大的努力提供高质量译文,但无法保证其准确性。如果对译文信息的准确性有任何疑问,请参阅英文版本. 可下载的 PDF 仅提供英文版.

配置 VSTP

date_range 16-Apr-24

虚拟生成树协议适用于需要设备兼容性的 VLAN。

了解 VSTP

使用 VSTP 时,我们建议您在可以接收 VSTP 桥接协议数据单元 (BPDU) 的所有 VLAN 上启用 VSTP。

VSTP 的优势

VSTP 具有以下优点:

  • 连接不属于网络的设备

  • VSTP 和 RSTP 是唯一可以在设备上并发配置的生成树协议。

VSTP 限制

VSTP 具有以下限制:

  • 运行第 2 层新一代 (L2NG) 软件的设备在 VSTP 上支持 510 个 VLAN。

  • SRX 系列防火墙仅支持 STP、RSTP 和 MSTP;不支持 VSTP。

  • 在不支持增强型第 2 层软件 (ELS) 的设备中,VSTP 最多可以支持 253 个 VLAN。

VSTP 的推荐用途

您可以将瞻博网络设备与 VSTP 配合使用,VSTP 为每个 VLAN 维护一个单独的生成树实例。每个 VLAN 一个生成树可实现精细的负载平衡,但随着 VLAN 数量的增加,需要更多的 BPDU CPU 处理。瞻博网络设备仅与 PVST+ 和 Rapid-PVST+ 互操作。有关详细信息,请参阅 EX 交换机的本机 VLAN 1 上的 VSTP 和 RPVST+ 融合

提示:

我们建议您在 EX 系列或 QFX 系列接口上同时启用 VSTP 和 RSTP。

VSTP 和 RSTP 是唯一可以在设备上并发配置的生成树协议。交换机上 VSTP 可支持的最大 VLAN 数取决于您使用的是支持增强型第 2 层软件 (ELS) 配置样式的 EX 系列和 QFX 系列交换机的 Junos OS,还是不支持 ELS 的 Junos OS。有关 ELS 的详细信息,请参阅 使用增强型第 2 层软件 CLI。对于其他 VLAN,请使用 RSTP。

交换机上 VSTP 支持的最大 VLAN 数取决于您使用的是支持增强型第 2 层软件 (ELS) 配置样式的 EX 系列和 QFX 系列交换机的 Junos OS,还是不支持 ELS 的 Junos OS。

交换机的全局和特定 VSTP 配置

瞻博网络设备通过生成树协议 (STP)、快速生成树协议 (RSTP)、多生成树协议 (MSTP) 和 VLAN 生成树协议 (VSTP) 提供第 2 层环路防护。支持 ELS 的设备的默认出厂配置使用 RSTP。本主题介绍用于在支持 ELS 的设备上配置 VSTP 的选项。

注意:

配置 VSTP 时,我们建议您在可以接收 VSTP 桥接协议数据单元 (BPDU) 的所有 VLAN 上启用 VSTP。

在哪里可以配置 VSTP?

可以在全局级别配置 VSTP:

  • 对于交换机上的所有接口

  • 适用于所有 VLAN 中的所有接口

  • 对于指定 VLAN 中的所有接口

  • 对于指定 VLAN 组中的所有接口

您可以为特定接口配置或禁用 VSTP:

  • 交换机上的特定接口

  • 适用于所有 VLAN 中的特定接口

  • 对于指定 VLAN 中的特定接口

  • 对于指定 VLAN 组中的特定接口

注意:
  • 如果在全局和特定 VLAN 级别的接口上配置 VSTP,则在特定 VLAN 级别定义的接口配置将覆盖在全局级别定义的接口配置。

  • 如果指定要在未配置为属于一个或多个 VLAN 的接口上配置 VSTP,则会显示一条错误消息。

  • 如果所有 VLAN 都需要 STP,并且系统中配置的 VLAN 大于 VSTP 允许的最大 VLAN,则必须使用 RSTP 而不是 VSTP。

用于配置所有接口的 VSTP 命令

在交换机上的单个接口上配置 VSTP 的命令:

content_copy zoom_out_map
[edit protocols vstp]
user@switch@ set interface interface-name

用于配置交换机上所有 VSTP 接口的命令:

content_copy zoom_out_map
[edit protocols vstp]
user@switch# set interface all

为所有 VLAN 配置所有 VSTP 接口的命令:

注意:

发出 set protocols vstp vlan all interface all 命令时,如果超过 5119 个 vport 的限制,可能不会收到错误消息。

content_copy zoom_out_map
[edit protocols vstp]
user@switch# set vlan all interface all

用于配置指定 VLAN 内所有 VSTP 接口的命令:

content_copy zoom_out_map
[edit protocols vstp]
user@switch# set vlan (vlan-id  |vlan-range |open-set-of-values)  interface all interface all
注意:

使用命令配置 set protocol vstp vlan vlan-id interface interface-name VSTP 时,将排除名为 default 的 VLAN。您必须使用名称 default 手动配置 VLAN 才能运行 VSTP。

用于配置指定 VLAN 组内所有 VSTP 接口的命令:

content_copy zoom_out_map
[edit protocols vstp]
user@switch# set vlan-group vlan-group-name vlan (vlan-id  |vlan-range |open-set-of-values)  interface all

用于配置特定接口的 VSTP 命令

在交换机上配置特定接口的命令:

content_copy zoom_out_map
[edit protocols vstp]
user@switch# set interface interface-name

在所有 VLAN 中配置特定接口的命令:

content_copy zoom_out_map
[edit protocols vstp]
user@switch# set vlan all interface interface-name
谨慎:

在将接口添加到 VSTP 配置之前,请确保该接口是所有 VLAN 的成员。如果接口不是所有 VLAN 的成员,则在您尝试提交时,此 VSTP 配置将失败。

在特定 VLAN 中配置特定接口的命令:

content_copy zoom_out_map
[edit protocols vstp]
user@switch# set vlan vlan-id-or-vlan-range interface interface-name

配置特定 VLAN 组中特定接口的命令:

content_copy zoom_out_map
[edit protocols vstp]
user@switch# set vlan-group vlan-group-name vlan (vlan-id  |vlan-range |open-set-of-values) interface interface-name

用于禁用接口的 VSTP 命令

在交换机上的单个接口上禁用 VSTP 的命令:

content_copy zoom_out_map
[edit protocols vstp]
user@switch@ set interface interface-name disable

用于在交换机上特定 VLAN 内的特定接口上禁用 VSTP 的命令:

content_copy zoom_out_map
[edit protocols vstp]
user@switch@ set vlan vlan-id  interface interface-name disable

在交换机上的所有 VLAN 上禁用一个特定 VSTP 接口的命令:

content_copy zoom_out_map
[edit protocols vstp]
user@switch@ set vlan all interface interface-name disable

用于禁用特定 VLAN 组中特定 VSTP 接口的命令:

content_copy zoom_out_map
[edit protocols vstp]
user@switch@ set vlan-group group group-name vlan (vlan-id  |vlan-range | open-set-of-values) interface interface-name disable
注意:

您无法禁用所有 VSTP 接口的 VSTP VLAN 参数。

示例:在具有标记流量的中继端口上配置 VSTP

在 802.1ad 提供商桥接网络(堆叠 VLAN)中,单标记接入端口和双标记中继端口可以在单个生成树上下文中共存。在此模式下,VLAN 生成树协议 (VSTP) 可以在千兆以太网 (ge)、10 千兆以太网 (xe) 和聚合以太网 (ae) 接口上发送和接收未标记的快速生成树协议 (RSTP) 桥接协议数据单元 (BPDU)。未标记的 RSTP BPDU 与通过双标记中继端口发送的标记的 VSTP BPDU 互操作。

双标记对互联网服务提供商非常有用,允许他们在内部使用 VLAN,同时混合来自已标记 VLAN 的客户端的流量。

此示例说明如何将 VSTP 配置为在接入中继上发送和接收标准未标记快速生成树协议 (RSTP) 桥接协议数据单元 (BPDU),这些中继与通过双标记中继端口发送的标记 VSTP BPDU 互操作。

要求

此示例使用以下硬件和软件组件:

  • 两台客户边缘设备(带 DPCE 或 MPC 卡的 MX 系列路由器)

  • 两个 PE 设备(带 DPCE 或 MPC 卡的 MX 系列路由器)

  • 在 PE 设备上运行的 Junos OS 12.3 或更高版本

概述

此示例说明如何在具有标记流量的中继端口上配置 VSTP。

拓扑学

图 1 显示了一个示例拓扑,其中两个客户边缘 (CE) 网桥双宿主到两个提供商边缘 (PE) 设备。所有 PE-CE 链路都是使用 C-VLAN 1-100 的单标记中继。设备 PE1 和 PE2 之间的核心链路是一个双标记中继,它使用 S-VLAN 100 和 200 来区分客户边缘流量,从而传输来自两个 CE 设备的流量。

在 PE 设备上创建两个 VSTP 实例,每个 S-VLAN 一个。CE 设备运行标准 RSTP。PE 设备在核心链路上运行 VSTP,同时向 CE 设备发送标准未标记的 RSTP BPDU。

图 1:在具有标记流量 Topology for VSTP Configured on a Trunk Port with Tagged Traffic的中继端口上配置的 VSTP 拓扑

配置

CLI 快速配置

要快速配置此示例,请复制以下命令,将其粘贴到文本文件中,删除所有换行符,更改与您的网络配置匹配所需的任何详细信息,然后将命令复制并粘贴到层次结构级别的 CLI [edit] 中。

设备 PE1

content_copy zoom_out_map
set interfaces ge-2/0/1 flexible-vlan-tagging
set interfaces ge-2/0/1 encapsulation flexible-ethernet-services
set interfaces ge-2/0/1 unit 1 vlan-id 100
set interfaces ge-2/0/1 unit 1 family bridge interface-mode trunk
set interfaces ge-2/0/1 unit 1 family bridge inner-vlan-id-list 1-100
set interfaces ge-2/0/1 unit 2 vlan-id 200
set interfaces ge-2/0/1 unit 2 family bridge interface-mode trunk
set interfaces ge-2/0/1 unit 2 family bridge inner-vlan-id-list 1-100
set interfaces ge-2/0/4 encapsulation ethernet-vpls
set interfaces ge-2/0/4 unit 0 description to_CE1 
set interfaces ge-2/0/4 unit 0 family bridge interface-mode trunk
set interfaces ge-2/0/4 unit 0 family bridge vlan-id-list 1-100
set interfaces ge-2/1/1 unit 0 description to_CE2
set interfaces ge-2/1/1 unit 0 family bridge interface-mode trunk
set interfaces ge-2/1/1 unit 0 family bridge vlan-id-list 1-100
set routing-instances vs1 instance-type virtual-switch
set routing-instances vs1 interface ge-2/0/1.1
set routing-instances vs1 interface ge-2/0/4.0
set routing-instances vs1 protocols vstp vlan 100 interface ge-2/0/1
set routing-instances vs1 protocols vstp vlan 100 interface ge-2/0/4 access-trunk
set routing-instances vs1 bridge-domains bd vlan-id-list 1-100
set routing-instances vs2 instance-type virtual-switch
set routing-instances vs2 interface ge-2/0/1.2
set routing-instances vs2 interface ge-2/1/1.0
set routing-instances vs2 protocols vstp vlan 200 interface ge-2/0/1
set routing-instances vs2 protocols vstp vlan 200 interface ge-2/1/1 access-trunk
set routing-instances vs2 bridge-domains bd vlan-id-list 1-100

设备 PE2

content_copy zoom_out_map
set interfaces ge-2/0/1 flexible-vlan-tagging
set interfaces ge-2/0/1 encapsulation flexible-ethernet-services
set interfaces ge-2/0/1 unit 1 vlan-id 100
set interfaces ge-2/0/1 unit 1 family bridge interface-mode trunk
set interfaces ge-2/0/1 unit 1 family bridge inner-vlan-id-list 1-100
set interfaces ge-2/0/1 unit 2 vlan-id 200
set interfaces ge-2/0/1 unit 2 family bridge interface-mode trunk
set interfaces ge-2/0/1 unit 2 family bridge inner-vlan-id-list 1-100
set interfaces ge-2/1/3 description to_CE1
set interfaces ge-2/1/3 unit 0 family bridge interface-mode trunk
set interfaces ge-2/1/3 unit 0 family bridge vlan-id-list 1-100
set interfaces ge-2/0/5 description to_CE2
set interfaces ge-2/0/5 unit 0 family bridge interface-mode trunk
set interfaces ge-2/0/5 unit 0 family bridge vlan-id-list 1-100
 set routing-instances vs1 instance-type virtual-switch
 set routing-instances vs1 interface ge-2/0/1.1
 set routing-instances vs1 interface ge-2/1/3.0
 set routing-instances vs1 protocols vstp vlan 100 interface ge-2/0/1
 set routing-instances vs1 protocols vstp vlan 100 interface ge-2/1/3 access-trunk
 set routing-instances vs1 bridge-domains bd vlan-id-list 1-100
set routing-instances vs2 instance-type virtual-switch
set routing-instances vs2 interface ge-2/0/1.2
set routing-instances vs2 interface ge-2/0/5.0
set routing-instances vs2 protocols vstp vlan 200 interface ge-2/0/1
set routing-instances vs2 protocols vstp vlan 200 interface ge-2/0/5 access-trunk
set routing-instances vs2 bridge-domains bd vlan-id-list 1-100

设备 CE1

content_copy zoom_out_map
set interfaces ge-2/0/7 unit 0 description to_PE1
set interfaces ge-2/0/7 unit 0 family bridge interface-mode trunk
set interfaces ge-2/0/7 unit 0 family bridge vlan-id-list 1-100
set interfaces ge-2/1/4 unit 0 description to_PE2
set interfaces ge-2/1/4 unit 0 family bridge interface-mode trunk
set interfaces ge-2/1/4 unit 0 family bridge vlan-id-list 1-100
set protocols rstp interface ge-2/0/7
set protocols rstp interface ge-2/1/4
set bridge-domains bd vlan-id-list 1-100

设备 CE2

content_copy zoom_out_map
set interfaces ge-2/0/8 unit 0 description to_PE2
set interfaces ge-2/0/8 unit 0 family bridge interface-mode trunk
set interfaces ge-2/0/8 unit 0 family bridge vlan-id-list 1-100
set interfaces ge-2/1/1 unit 0 description to_PE1
set interfaces ge-2/1/1 unit 0 family bridge interface-mode trunk
set interfaces ge-2/1/1 unit 0 family bridge vlan-id-list 1-100
set protocols rstp interface ge-2/0/8
set protocols rstp interface ge-2/1/1
set bridge-domains bd vlan-id-list 1-100

配置 PE1、PE2、CE1 和 CE2

分步过程

以下示例要求您在配置层次结构中导航各个级别。有关导航 CLI 的信息,请参阅 CLI 用户指南中的在配置模式下使用 CLI 编辑器

要配置设备 PE1:

  1. 配置网络接口。

    content_copy zoom_out_map
    [edit interfaces]
    user@PE1# set ge-2/0/1 flexible-vlan-tagging
    user@PE1# set ge-2/0/1 encapsulation flexible-ethernet-services
    user@PE1# set ge-2/0/1 unit 1 vlan-id 100
    user@PE1# set ge-2/0/1 unit 1 family bridge interface-mode trunk
    user@PE1# set ge-2/0/1 unit 1 family bridge inner-vlan-id-list 1-100
    user@PE1# set ge-2/0/1 unit 2 vlan-id 200
    user@PE1# set ge-2/0/1 unit 2 family bridge interface-mode trunk
    user@PE1# set ge-2/0/1 unit 2 family bridge inner-vlan-id-list 1-100
    user@PE1# set ge-2/0/4 encapsulation ethernet-vpls
    user@PE1#set ge-2/0/4 unit 0 description to_CE1 
    user@PE1# set ge-2/0/4 unit 0 family bridge interface-mode trunk
    user@PE1#set ge-2/0/4 unit 0 family bridge vlan-id-list 1-100
    user@PE1# set ge-2/1/1 unit 0 description to_CE2
    user@PE1# set ge-2/1/1 unit 0 family bridge interface-mode trunk
    user@PE1# set ge-2/1/1 unit 0 family bridge vlan-id-list 1-100
    
  2. 配置路由实例。

    content_copy zoom_out_map
    [edit routing-instances]
    user@PE1# set vs1 instance-type virtual-switch
    user@PE1# set vs1 interface ge-2/0/1.1
    user@PE1# set vs1 interface ge-2/0/4.0
    user@PE1# set vs1 protocols vstp vlan 100 interface ge-2/0/1
    user@PE1# set vs1 protocols vstp vlan 100 interface ge-2/0/4 access-trunk
    user@PE1# set vs1 bridge-domains bd vlan-id-list 1-100
    user@PE1# set vs2 instance-type virtual-switch
    user@PE1# set vs2 interface ge-2/0/1.2
    user@PE1# set vs2 interface ge-2/1/1.0
    user@PE1# set vs2 protocols vstp vlan 200 interface ge-2/0/1
    user@PE1# set vs2 protocols vstp vlan 200 interface ge-2/1/1 access-trunk
    user@PE1# set vs2 bridge-domains bd vlan-id-list 1-100
    
分步过程

要配置设备 PE2:

  1. 配置接口。

    content_copy zoom_out_map
    [edit interfaces]
    user@PE2# set ge-2/0/1 flexible-vlan-tagging
    user@PE2# set ge-2/0/1 encapsulation flexible-ethernet-services
    user@PE2# set ge-2/0/1 unit 1 vlan-id 100
    user@PE2# set ge-2/0/1 unit 1 family bridge interface-mode trunk
    user@PE2# set ge-2/0/1 unit 1 family bridge inner-vlan-id-list 1-100
    user@PE2# set ge-2/0/1 unit 2 vlan-id 200
    user@PE2# set ge-2/0/1 unit 2 family bridge interface-mode trunk
    user@PE2# set ge-2/0/1 unit 2 family bridge inner-vlan-id-list 1-100
    user@PE2# set ge-2/1/3 description to_CE1
    user@PE2# set ge-2/1/3 unit 0 family bridge interface-mode trunk
    user@PE2# set ge-2/1/3 unit 0 family bridge vlan-id-list 1-100
    user@PE2# set ge-2/0/5 description to_CE2
    user@PE2# set ge-2/0/5 unit 0 family bridge interface-mode trunk
    user@PE2# set ge-2/0/5 unit 0 family bridge vlan-id-list 1-100
    
  2. 配置路由实例。

    content_copy zoom_out_map
    [edit routing-instances]
    user@PE2# set vs1 instance-type virtual-switch
    user@PE2# set vs1 interface ge-2/0/1.1
    user@PE2# set vs1 interface ge-2/1/3.0
    user@PE2# set vs1 protocols vstp vlan 100 interface ge-2/0/1
    user@PE2# set vs1 protocols vstp vlan 100 interface ge-2/1/3 access-trunk
    user@PE2# set vs1 bridge-domains bd vlan-id-list 1-100
    user@PE2# set vs2 instance-type virtual-switch
    user@PE2# set vs2 interface ge-2/0/1.2
    user@PE2# set vs2 interface ge-2/0/5.0
    user@PE2# set vs2 protocols vstp vlan 200 interface ge-2/0/1
    user@PE2# set vs2 protocols vstp vlan 200 interface ge-2/0/5 access-trunk
    user@PE2# set vs2 bridge-domains bd vlan-id-list 1-100
    
分步过程

要配置 CE1:

  1. 配置接口。

    content_copy zoom_out_map
    [edit interfaces]
    user@CE1# set ge-2/0/7 unit 0 description to_PE1
    user@CE1# set ge-2/0/7 unit 0 family bridge interface-mode trunk
    user@CE1# set ge-2/0/7 unit 0 family bridge vlan-id-list 1-100
    user@CE1# set ge-2/1/4 unit 0 description to_PE2
    user@CE1# set ge-2/1/4 unit 0 family bridge interface-mode trunk
    user@CE1# set ge-2/1/4 unit 0 family bridge vlan-id-list 1-100
    
  2. 配置协议。

    content_copy zoom_out_map
    [edit protocols]
    user@CE1# set rstp interface ge-2/0/7
    user@CE1# set rstp interface ge-2/1/4
    
  3. 配置桥接域。

    content_copy zoom_out_map
    [edit bridge-domains]
    user@CE1# set bd vlan-id-list 1-100
    
分步过程

要配置 CE2:

  1. 配置接口。

    content_copy zoom_out_map
    [edit interfaces]
    user@CE2# set ge-2/0/8 unit 0 description to_PE2
    user@CE2# set ge-2/0/8 unit 0 family bridge interface-mode trunk
    user@CE2# set ge-2/0/8 unit 0 family bridge vlan-id-list 1-100
    user@CE2# set ge-2/1/1 unit 0 description to_PE1
    user@CE2# set ge-2/1/1 unit 0 family bridge interface-mode trunk
    user@CE2# set ge-2/1/1 unit 0 family bridge vlan-id-list 1-100
    
  2. 配置协议。

    content_copy zoom_out_map
    [edit protocols]
    user@CE2# set rstp interface ge-2/0/8
    user@CE2# set rstp interface ge-2/1/1
    
  3. 配置桥接域。

    content_copy zoom_out_map
    [edit bridge-domains]
    user@CE2# set bd vlan-id-list 1-100
    

结果

在配置模式下,输入 show interfacesshow routing-instancesshow protocolsshow bridge-domains 命令来确认您的配置。如果输出未显示预期的配置,请重复此示例中的说明以更正配置。

设备 PE1

content_copy zoom_out_map
user@PE1# show interfaces
ge-2/0/1 {
    flexible-vlan-tagging;
    encapsulation flexible-ethernet-services;
    unit 1 {
        vlan-id 100;
        family bridge {
            interface-mode trunk;
            inner-vlan-id-list 1-100;
        }
    }
    unit 2 {
        vlan-id 200;
        family bridge {
            interface-mode trunk;
            inner-vlan-id-list 1-100;
        }
    }
}
ge-2/0/4 {
    encapsulation ethernet-vpls;
    unit 0 {
        description to_CE1;
        family bridge {
            interface-mode trunk;
            vlan-id-list 1-100;
        }
    }
}
ge-2/1/1 {
    unit 0 {
        description to_CE2;
        family bridge {
            interface-mode trunk;
            vlan-id-list 1-100;
        }
    }
}
content_copy zoom_out_map
user@PE1# show routing-instances
vs1 {
    instance-type virtual-switch;
    interface ge-2/0/1.1;
    interface ge-2/0/4.0;
    protocols {
        vstp {
            vlan 100 {
                interface ge-2/0/1;
                interface ge-2/0/4 {
                    access-trunk;
                }
            }
        }
    }
    bridge-domains {
        bd {
            vlan-id-list 1-100;
        }
    }
}
vs2 {
    instance-type virtual-switch;
    interface ge-2/0/1.2;
    interface ge-2/0/1.0;
    protocols {
        vstp {
            vlan 200 {
                interface ge-2/0/1;
                interface ge-2/1/1 {
                    access-trunk;
                }
            }
        }
    }
    bridge-domains {
        bd {
            vlan-id-list 1-100;
        }
    }
}

设备 PE2

content_copy zoom_out_map
user@PE2# show interfaces
ge-2/0/1 {
    flexible-vlan-tagging;
    encapsulation flexible-ethernet-services;
    unit 1 {
        vlan-id 100;
        family bridge {
            interface-mode trunk;
            inner-vlan-id-list 1-100;
        }
    }
    unit 2 {
        vlan-id 200;
        family bridge {
            interface-mode trunk;
            inner-vlan-id-list 1-100;
        }
    }
}
ge-2/0/5 {
    description to_CE2;
    unit 0 {
        family bridge {
            interface-mode trunk;
            vlan-id-list 1-100;
        }
    }
}
ge-2/1/3 {
    description to_CE1;
    unit 0 {
        family bridge {
            interface-mode trunk;
            vlan-id-list 1-100;
        }
    }
}
content_copy zoom_out_map
user@PE2# show routing-instances
vs1 {
    instance-type virtual-switch;
    interface ge-2/0/1.1;
    interface ge-2/1/3.0;
    protocols {
        vstp {
            vlan 100 {
                interface ge-2/0/1;
                interface ge-2/1/3 {
                    access-trunk;
                }
            }
        }
    }
    bridge-domains {
        bd {
            vlan-id-list 1-100;
        }
    }
}
vs2 {
    instance-type virtual-switch;
    interface ge-2/0/1.2;
    interface ge-2/0/5.0;
    protocols {
        vstp {
            vlan 200 {
                interface ge-2/0/1;
                interface ge-2/0/5 {
                    access-trunk;
                }
            }
        }
    }
    bridge-domains {
        bd {
            vlan-id-list 1-100;
        }
    }
}

设备 CE1

content_copy zoom_out_map
user@CE1# show interfaces
ge-2/0/7 {
    unit 0 {
        description to_PE1;
        family bridge {
            interface-mode trunk;
            vlan-id-list 1-100;
        }
    }
}
ge-2/1/4 {
    unit 0 {
        description to_PE2;
        family bridge {
            interface-mode trunk;
            vlan-id-list 1-100;
        }
    }
}
content_copy zoom_out_map
user@CE1# show protocols
rstp {
    interface ge-2/0/7;
    interface ge-2/1/4;
}
content_copy zoom_out_map
user@CE1# show bridge-domains
bd {
    vlan-id-list 1-100;
}

设备 CE2

content_copy zoom_out_map
user@CE2 show interfaces
ge-2/0/8 {
    unit 0 {
        description to_PE2;
        family bridge {
            interface-mode trunk;
            vlan-id-list 1-100;
        }
    }
}
ge-2/1/1 {
    unit 0 {
        description to_PE1;
        family bridge {
            interface-mode trunk;
            vlan-id-list 1-100;
        }
    }
}
content_copy zoom_out_map
user@CE2# show protocols
rstp {
    interface ge-2/0/8;
    interface ge-2/1/1;
}
content_copy zoom_out_map
user@CE2# show bridge-domains
bd {
    vlan-id-list 1-100;
}

如果完成设备配置,请从配置模式输入 commit

验证

确认配置工作正常。

验证接口是否正常运行

目的

验证接口是否正常运行。

行动

在操作模式下,输入 show spanning-tree interface routing-instance 命令。

content_copy zoom_out_map
user@PE1> show spanning-tree interface routing-instance vs1
Spanning tree interface parameters for VLAN 100

Interface    Port ID    Designated      Designated         Port    State  Role
                         port ID        bridge ID          Cost
ge-2/0/1        128:82       128:82  32868.0021590f37d0     20000  FWD    DESG 
ge-2/0/4        128:85       128:85  32868.0021590f37d0     20000  FWD    DESG 
意义

输出显示为 VLAN 100 配置的接口的状态。

验证路由实例的 STP 网桥参数

目的

验证为路由实例配置的 STP 网桥参数。

行动

在操作模式下,输入 show spanning-tree bridge routing-instance 命令。

content_copy zoom_out_map
user@PE1> show spanning-tree bridge routing-instance vs1
STP bridge parameters 
Routing instance name               : vs1
Enabled protocol                    : RSTP

STP bridge parameters for VLAN 100
  Root ID                           : 32868.00:21:59:0f:37:d0
  Hello time                        : 2 seconds
  Maximum age                       : 20 seconds
  Forward delay                     : 15 seconds
  Message age                       : 0 
  Number of topology changes        : 2
  Time since last topology change   : 687 seconds
  Local parameters 
    Bridge ID                       : 32868.00:21:59:0f:37:d0
    Extended system ID              : 100
意义

输出显示路由实例 vs1 的 STP 网桥参数的状态。

显示已配置网桥的 STP 统计信息

目的

显示已配置网桥的生成树统计信息。

行动

在操作模式下,输入 show spanning-tree statistics bridge 命令。

content_copy zoom_out_map
user@PE1> show spanning-tree statistics bridge 
STP Context  : default
STP Instance : 0  
Number of Root Bridge Changes: 0         
Number of Root Port Changes:   0         

STP Context  : x/default
STP Instance : 0  
Number of Root Bridge Changes: 0         
Number of Root Port Changes:   0         

STP Context  : vs1
STP Instance : 0  
Number of Root Bridge Changes: 2            Last Changed: Thu Sep 20 15:12:18 2012  
Number of Root Port Changes:   1            Last Changed: Thu Sep 20 15:01:13 2012  
Recent TC  Received:  ge-2/0/1.1            Received    : Thu Sep 20 15:01:17 2012   

STP Context  : vs2
STP Instance : 0  
Number of Root Bridge Changes: 2            Last Changed: Thu Sep 20 15:10:25 2012  
Number of Root Port Changes:   2            Last Changed: Thu Sep 20 15:10:25 2012  
Recent TC  Received:  ge-2/1/1.0            Received    : Thu Sep 20 15:10:47 2012   

STP Context  : CE1/default
STP Instance : 0  
Number of Root Bridge Changes: 0         
Number of Root Port Changes:   0         
Recent TC  Received:  ge-2/1/4.0            Received    : Thu Sep 20 15:12:15 2012   
意义

命令输出显示已配置网桥的生成树统计信息。

从强制 IEEE 802.1D STP 恢复到 RSTP 或 VSTP

如果支持 ELS,且快速生成树协议 (RSTP) 或 VLAN 生成树协议 (VSTP) 已强制作为原始 IEEE 802.1D 生成树协议 (STP) 版本运行,则可以恢复为 RSTP 或 VSTP。

要从原始 IEEE 802.1D STP 版本的强制实例恢复到最初配置的 RSTP 或 VSTP 版本,请执行以下操作:

  1. 从以下 RSTP 或 VSTP 配置中删除该 force-version 语句:
    content_copy zoom_out_map
    user@host# delete protocols rstp force-version stp
    user@host# delete protocols vstp force-version stp
    

    在以下层次结构级别包含此语句:

    • [edit logical-systems routing-instance-name protocols rstp]

    • [edit protocols rstp]

    • [edit protocols vstp]

    • [edit routing-instances routing-instance-name protocols rstp]

    • [edit routing-instances routing-instance-name protocols vstp]

  2. 将强制的 IEEE 802.1D STP 恢复为作为配置的 RSTP 或 VSTP 运行:
    content_copy zoom_out_map
    user@host# clear spanning-tree protocol-migration <interface interface-name> <routing-instance routing-instance-name>
    

    要全局还原 STP 协议,请发出不带选项 ()clear spanning-tree protocol-migration 的语句。

    要仅恢复指定接口的 STP 协议,请指定 接口interface-name 选项。

    要仅恢复特定路由实例的 STP 协议,请指定 路由实例routing-instance-name 选项。

footer-navigation