配置 RSTP 协议
了解 RSTP
瞻博网络产品默认在设备网络端使用快速生成树协议 (RSTP),以提供比基本生成树协议 (STP) 更快的融合时间。RSTP 将某些链路标识为点对点。当点对点链路发生故障时,备用链路可以过渡到转发状态,从而加速融合。
使用 RSTP 的优势
使用原始 STP 的一些好处包括:
RSTP 比 STP 更快。
与 STP 相比,使用 RSTP 的语音和视频效果更好。
RSTP 支持的端口数量超过 MSTP 或 VSTP。
RSTP 向后兼容 STP;因此,交换机并非全部都必须运行 RSTP。
在 MX 和 ACX 路由器上,您可以将 RSTP、MSTP 和 VSTP 实例接口配置为边缘端口。
为什么 RSTP 是默认生成树协议?
RSTP 从原始 STP IEEE 802.1D 协议演进为交换机端口、交换机或 LAN 故障后提供更快的生成树再融合。STP 最多需要 50 秒时间来响应拓扑更改,则 RSTP 在三个 hello BPDU(桥接协议数据单元)或 6 秒内对更改做出响应。这是 RSTP 是默认生成树配置的主要原因。
配置用于 STP 的 EX 系列交换机实际运行 RSTP force 版本 0,该版本与 STP 兼容。
配置快速生成树协议
您可以在以下层次结构级别下配置快速生成树协议 (RSTP):
[编辑逻辑系统logical-system-name 协议]
[编辑逻辑系统logical-system-name 路由实例 routing-instance-name 协议]
[编辑协议]
[编辑路由实例routing-instance-name 协议]
路由实例类型可以是 虚拟交换机 ,也可以是 第 2 层控制。
要配置快速生成树协议:
在 EX 系列交换机上配置 RSTP(CLI 过程)
EX 系列交换机的默认生成树协议是快速生成树协议 (RSTP)。与原始生成树协议 (STP) 相比,RSTP 的融合时间更快。由于 RSTP 默认配置,因此您只需要使用此过程 如果配置了另一个生成树协议。在这种情况下,您可以重新配置 RSTP。
要启用 RSTP:
示例:使用 RSTP 在 ELS 交换机上配置更快的融合速度和网络稳定性
此示例使用支持增强型第 2 层软件 (ELS) 配置样式的 EX 系列交换机的 Junos OS。如果您的交换机运行的软件不支持 ELS,请参阅 示例:在 EX 系列交换机上使用 RSTP 加快融合速度并提高网络稳定性。有关 ELS 详细信息,请参阅 使用增强型第 2 层软件 CLI。
EX 系列交换机默认使用快速生成树协议 (RSTP) 提供无环路拓扑。
支持冗余路由引擎的交换机使用 RSTP 时,务必在两个路由引擎上保持 RSTP 同步,以便在路由引擎切换后不会出现服务丢失。不间断桥接协议保持路由引擎同步。
此示例介绍如何在四台 EX 系列交换机上配置 RSTP 和 NSB:
- 要求
- 概述和拓扑
- 在交换机 1 上配置 RSTP 和不间断桥接
- 在交换机上配置 RSTP 和不间断桥接 2
- 在交换机上配置 RSTP 和不间断桥接 3
- 在交换机上配置 RSTP 和不间断桥接 4
- 验证
要求
此示例使用以下软件和硬件组件:
EX 系列交换机的 Junos OS 15.1 或更高版本
四台 EX 系列交换机
在为 RSTP 配置交换机之前,请确保您已:
安装并连接了四台交换机。请参阅交换机的硬件文档。
在所有交换机上执行初始软件配置。请参阅 连接和配置 EX 系列交换机(CLI 过程)。
概述和拓扑
RSTP 的工作原理是将某些链路识别为点对点链路并阻止其他可能的路径。当其中一个点对点链路发生故障时,指定的备用链路将转换到转发状态并接管。在带有冗余路由引擎的交换机上配置不间断桥接 (NSB),使 RSTP 在两个路由引擎上保持同步。这样,RSTP 在切换后立即保持活动状态,因为它已同步到备份路由引擎。启用 NSB 时,RSTP 无需在路由引擎切换后重新混合,因为邻接设备未检测到交换机上的 RSTP 更改。在此示例中,四个 EX 系列交换机在 图 1 显示的拓扑中连接,以创建一个将 NSB 应用于具有双路由引擎的交换机的无环路拓扑。
表 1 显示了此示例的拓扑组件。
只能在物理接口上配置 RSTP,而不能在逻辑接口上配置 RSTP。
财产 |
设置 |
---|---|
交换机 1 |
交换机 1 上的以下接口以这种方式连接:
|
交换机 2 |
交换机 2 上的以下接口以这种方式连接:
|
交换机 3 |
交换机 3 上的以下接口以这种方式连接:
|
交换机 4 |
交换机 4 上的以下接口以这种方式连接:
|
VLAN 名称和标记 ID |
语音 vlan, 标记 10 员工 vlan, 标记 20 访客 vlan, 标记 30 摄像头 vlan, 标记 40 |
此配置示例在使用 RSTP 的四台 EX 系列交换机之间创建无环路拓扑。
RSTP 拓扑包含具有特定角色的端口:
root 端口负责将数据转发至根桥。
备用端口是根端口的备用端口。当 root 端口关闭时,备用端口将成为活动根端口。
指定端口将数据转发至下游网段或设备。
备份端口是指定端口的备份端口。当指定端口停机时,备份端口将成为活动指定端口,并开始转发数据。
您还可以使用冗余中继链路在聚合层和分布层之间创建无环路拓扑。有关配置冗余中继链路的详细信息,请参阅 示例:配置冗余中继链路,以便在支持 ELS 的设备上更快地恢复。
拓扑
在交换机 1 上配置 RSTP 和不间断桥接
程序
CLI 快速配置
要在交换机 1 上快速配置 RSTP 和不间断桥接,请复制以下命令并将其粘贴到交换机终端窗口中:
[edit] set vlans voice-vlan description “Voice VLAN” set vlans voice-vlan vlan-id 10 set vlans employee-vlan description “Employee VLAN” set vlans employee-vlan vlan-id 20 set vlans guest-vlan description “Guest VLAN” set vlans guest-vlan vlan-id 30 set vlans camera-vlan description “Camera VLAN” set vlans camera-vlan vlan-id 40 set interfaces ge-0/0/13 unit 0 family ethernet-switching vlan members [10 20 30 40] set interfaces ge-0/0/9 unit 0 family ethernet-switching vlan members [10 20 30 40] set interfaces ge-0/0/11 unit 0 family ethernet-switching vlan members [10 20 30 40] set interfaces ge-0/0/13 unit 0 family ethernet-switching interface-mode trunk set interfaces ge-0/0/9 unit 0 family ethernet-switching interface-mode trunk set interfaces ge-0/0/11 unit 0 family ethernet-switching interface-mode trunk set protocols rstp bridge-priority 16k set protocols rstp interface all cost 1000 set protocols rstp interface all mode point-to-point
如果交换机 1 包含双路由引擎,则配置 NSB。要在交换机 1 上快速配置不间断桥接,请复制以下命令并将其粘贴到交换机终端窗口中:
set chassis redundancy graceful-switchover set system commit synchronize set protocols layer2-control nonstop-bridging
NFX150 设备仅支持单个路由引擎。
逐步过程
要在交换机上配置 RSTP 和不间断桥接 1:
配置 VLAN 语音 vlan、 员工 vlan、 访客 vlan 和 摄像头 vlan:
[edit vlans] user@switch1# set voice-vlan description “Voice VLAN” user@switch1# set voice-vlan vlan-id 10 user@switch1# set employee-vlan description “Employee VLAN” user@switch1# set employee-vlan vlan-id 20 user@switch1# set guest-vlan description “Guest VLAN” user@switch1# set guest-vlan vlan-id 30 user@switch1# set camera-vlan description “Camera VLAN” user@switch1# set camera-vlan vlan-id 40
在接口上配置 VLAN,包括对以太网交换协议的支持:
[edit interfaces] user@switch1# set ge-0/0/13 unit 0 family ethernet-switching vlan members [10 20 30 40] user@switch1# set ge-0/0/9 unit 0 family ethernet-switching vlan members [10 20 30 40] user@switch1# set ge-0/0/11 unit 0 family ethernet-switching vlan members [10 20 30 40]
为接口配置端口模式:
[edit interfaces] user@switch1# set ge-0/0/13 unit 0 family ethernet-switching interface-mode trunk user@switch1# set ge-0/0/9 unit 0 family ethernet-switching interface-mode trunk user@switch1# set ge-0/0/11 unit 0 family ethernet-switching interface-mode trunk
在交换机上配置 RSTP:
[edit protocols] user@switch1# rstp bridge-priority 16k user@switch1# rstp interface all cost 1000 user@switch1# rstp interface all mode point-to-point
逐步过程
如果交换机 1 包含双路由引擎,则配置不间断桥接。要在交换机 1 上配置 NSB:
启用平滑路由引擎切换 (GRES):
[edit chassis redundancy] user@switch1# set graceful-switchover
配置交换机以始终同步路由引擎之间的配置更改:
[edit system] user@switch1# set commit synchronize
如果尝试提交未配置不间断桥接但未配置配置更改同步的配置,则不会提交配置。
支持不间断桥接:
[edit protocols layer2-control] user@switch1# set nonstop-bridging
注意:此进程支持交换机上所有 NSB 支持的第 2 层协议(包括 RSTP)的 NSB。
结果
检查配置结果:
user@switch1> show configuration interfaces { ge-0/0/13 { unit 0 { family ethernet-switching { interface-mode trunk; vlan { members [10 20 30 40]; } } } } ge-0/0/9 { unit 0 { family ethernet-switching { interface-mode trunk; vlan { members [10 20 30 40]; } } } } ge-0/0/11 { unit 0 { family ethernet-switching { interface-mode trunk; vlan { members [10 20 30 40]; } } } } } protocols { layer2-control { nonstop-bridging; } rstp { bridge-priority 16k; interface ge-0/0/13 { cost 1000; mode point-to-point; } interface ge-0/0/9 { cost 1000; mode point-to-point; } interface ge-0/0/11 { cost 1000; mode point-to-point; } } } } vlans { voice-vlan { vlan-id 10; } employee-vlan { vlan-id 20; } guest-vlan { vlan-id 30; } camera-vlan { vlan-id 40; } } system { commit synchronize; } chassis { redundancy { graceful-switchover; }
在交换机上配置 RSTP 和不间断桥接 2
程序
CLI 快速配置
要在交换机 2 上快速配置 RSTP 和不间断桥接,请复制以下命令并将其粘贴到交换机终端窗口中:
[edit] set vlans voice-vlan description “Voice VLAN” set vlans voice-vlan vlan-id 10 set vlans employee-vlan description “Employee VLAN” set vlans employee-vlan vlan-id 20 set vlans guest-vlan description “Guest VLAN” set vlans guest-vlan vlan-id 30 set vlans camera-vlan description “Camera VLAN” set vlans camera-vlan vlan-id 40 set interfaces ge-0/0/14 unit 0 family ethernet-switching vlan members [10 20 30 40] set interfaces ge-0/0/18 unit 0 family ethernet-switching vlan members [10 20 30 40] set interfaces ge-0/0/14 unit 0 family ethernet-switching interface-mode trunk set interfaces ge-0/0/18 unit 0 family ethernet-switching interface-mode trunk set protocols rstp bridge-priority 32k set protocols rstp interface ge-0/0/14 cost 1000 set protocols rstp interface ge-0/0/14 mode point-to-point set protocols rstp interface ge-0/0/18 cost 1000 set protocols rstp interface ge-0/0/18 mode point-to-point
从支持增强型第 2 层软件 (ELS) 配置样式的 EX 系列和 QFX 系列交换机的 Junos OS 15.1 版开始,您可以在所有生成树接口上全局配置生成树参数。有关附加信息,请参阅 在 EX 系列交换机上配置 RSTP(CLI 过程) 。
如果交换机 2 包含双路由引擎,则配置 NSB。要在交换机 2 上快速配置不间断桥接,请复制以下命令并将其粘贴到交换机终端窗口中:
set chassis redundancy graceful-switchover set system commit synchronize set protocols layer2-control nonstop-bridging
逐步过程
要在交换机上配置 RSTP 和不间断桥接 2:
配置 VLAN 语音 vlan、 员工 vlan、 访客 vlan 和 摄像头 vlan:
[edit vlans] user@switch2# set voice-vlan description “Voice VLAN” user@switch2# set voice-vlan vlan-id 10 user@switch2# set employee-vlan description “Employee VLAN” user@switch2# set employee-vlan vlan-id 20 user@switch2# set guest-vlan description “Guest VLAN” user@switch2# set guest-vlan vlan-id 30 user@switch2# set camera-vlan vlan-description “Camera VLAN” user@switch2# set camera-vlan vlan-id 40
在接口上配置 VLAN,包括对以太网交换协议的支持:
[edit interfaces] user@switch2# set ge-0/0/14 unit 0 family ethernet-switching vlan members [10 20 30 40] user@switch2# set ge-0/0/18 unit 0 family ethernet-switching vlan members [10 20 30 40]
为接口配置端口模式:
[edit interfaces] user@switch2# set ge-0/0/14 unit 0 family ethernet-switching interface-mode trunk user@switch2# set ge-0/0/18 unit 0 family ethernet-switching interface-mode trunk
在交换机上配置 RSTP:
[edit protocols] user@switch2# rstp bridge-priority 32k user@switch2# rstp interface ge-0/0/14 cost 1000 user@switch2# rstp interface ge-0/0/14 mode point-to-point user@switch2# rstp interface ge-0/0/18 cost 1000 user@switch2# rstp interface ge-0/0/18 mode point-to-point
逐步过程
如果交换机 2 包含双路由引擎,则配置不间断桥接。要在交换机 2 上配置 NSB:
启用平滑路由引擎切换 (GRES):
[edit chassis redundancy] user@switch2# set graceful-switchover
配置交换机以始终同步路由引擎之间的配置更改:
[edit system] user@switch2# set commit synchronize
如果尝试提交未配置不间断桥接但未配置配置更改同步的配置,则不会提交配置。
支持不间断桥接:
[edit protocols layer2-control] user@switch2# set nonstop-bridging
注意:此进程支持交换机上所有 NSB 支持的第 2 层协议(包括 RSTP)的 NSB。
结果
检查配置结果:
user@switch2> show configuration interfaces { ge-0/0/14 { unit 0 { family ethernet-switching { interface-mode trunk; vlan { members [10 20 30 40]; } } } } ge-0/0/18 { unit 0 { family ethernet-switching { interface-mode trunk; vlan { members [10 20 30 40]; } } } } } protocols { layer2-control { nonstop-bridging; } rstp { bridge-priority 32k; interface ge-0/0/14 { cost 1000; mode point-to-point; } interface ge-0/0/18 { cost 1000; mode point-to-point; } } } } vlans { voice-vlan { vlan-id 10; } employee-vlan { vlan-id 20; } guest-vlan { vlan-id 30; } camera-vlan { vlan-id 40; } } system { commit synchronize; } chassis { redundancy { graceful-switchover; }
在交换机上配置 RSTP 和不间断桥接 3
程序
CLI 快速配置
要在交换机 3 上快速配置 RSTP 和不间断桥接,请复制以下命令并将其粘贴到交换机终端窗口中:
[edit] set vlans voice-vlan description “Voice VLAN” set vlans voice-vlan vlan-id 10 set vlans employee-vlan description “Employee VLAN” set vlans employee-vlan vlan-id 20 set vlans guest-vlan description “Guest VLAN” set vlans guest-vlan vlan-id 30 set vlans camera-vlan description “Camera VLAN” set vlans camera-vlan vlan-id 40 set interfaces ge-0/0/26 unit 0 family ethernet-switching vlan members [10 20 30 40] set interfaces ge-0/0/28 unit 0 family ethernet-switching vlan members [10 20 30 40] set interfaces ge-0/0/24 unit 0 family ethernet-switching vlan members [10 20 30 40] set interfaces ge-0/0/26 unit 0 family ethernet-switching interface-mode trunk set interfaces ge-0/0/28 unit 0 family ethernet-switching interface-mode trunk set interfaces ge-0/0/24 unit 0 family ethernet-switching interface-mode trunk set protocols rstp bridge-priority 8k set protocols rstp interface ge-0/0/26 cost 1000 set protocols rstp interface ge-0/0/26 mode point-to-point set protocols rstp interface ge-0/0/28 cost 1000 set protocols rstp interface ge-0/0/28 mode point-to-point set protocols rstp interface ge-0/0/24 cost 1000 set protocols rstp interface ge-0/0/24 mode point-to-point
如果交换机 3 包含双路由引擎,则配置 NSB。要在交换机 3 上快速配置不间断桥接,请复制以下命令并将其粘贴到交换机终端窗口中:
set chassis redundancy graceful-switchover set system commit synchronize set protocols layer2-control nonstop-bridging
逐步过程
要在交换机上配置 RSTP 和不间断桥接 3:
配置 VLAN 语音 vlan、 员工 vlan、 访客 vlan 和 摄像头 vlan:
[edit vlans] user@switch3# set voice-vlan description “Voice VLAN” user@switch3# set voice-vlan vlan-id 10 user@switch3# set employee-vlan description “Employee VLAN” user@switch3# set employee-vlan vlan-id 20 user@switch3# set guest-vlan description “Guest VLAN” user@switch3# set guest-vlan vlan-id 30 user@switch3# set camera-vlan description “Camera VLAN” user@switch3# set camera-vlan vlan-id 40
在接口上配置 VLAN,包括对以太网交换协议的支持:
[edit interfaces] user@switch3# set ge-0/0/26 unit 0 family ethernet-switching vlan members [10 20 30 40] user@switch3# set ge-0/0/28 unit 0 family ethernet-switching vlan members [10 20 30 40] user@switch3# set ge-0/0/24 unit 0 family ethernet-switching vlan members [10 20 30 40]
为接口配置端口模式:
[edit interfaces] user@switch3# set ge-0/0/26 unit 0 family ethernet-switching interface-mode trunk user@switch3# set ge-0/0/28 unit 0 family ethernet-switching interface-mode trunk user@switch3# set ge-0/0/24 unit 0 family ethernet-switching interface-mode trunk
在交换机上配置 RSTP:
[edit protocols] user@switch3# rstp bridge-priority 8k user@switch3# rstp interface ge-0/0/26 cost 1000 user@switch3# rstp interface ge-0/0/26 mode point-to-point user@switch3# rstp interface ge-0/0/28 cost 1000 user@switch3# rstp interface ge-0/0/28 mode point-to-point user@switch3# rstp interface ge-0/0/24 cost 1000 user@switch3# rstp interface ge-0/0/24 mode point-to-point
逐步过程
如果交换机 3 包含双路由引擎,则配置不间断桥接。要在交换机 3 上配置 NSB:
启用平滑路由引擎切换 (GRES):
[edit chassis redundancy] user@switch3# set graceful-switchover
配置交换机以始终同步路由引擎之间的配置更改:
[edit system] user@switch3# set commit synchronize
如果尝试提交未配置不间断桥接但未配置配置更改同步的配置,则不会提交配置。
支持不间断桥接:
[edit protocols layer2-control] user@switch3# set nonstop-bridging
注意:此进程支持交换机上所有 NSB 支持的第 2 层协议(包括 RSTP)的 NSB。
结果
检查配置结果:
user@switch3> show configuration interfaces { ge-0/0/26 { unit 0 { family ethernet-switching { interface-mode trunk; vlan { members [10 20 30 40]; } } } } ge-0/0/28 { unit 0 { family ethernet-switching { interface-mode trunk; vlan { members [10 20 30 40]; } } } } ge-0/0/24 { unit 0 { family ethernet-switching { interface-mode trunk; vlan { members [10 20 30 40]; } } } } } } protocols { layer2-control { nonstop-bridging; } rstp { bridge-priority 8k; interface ge-0/0/26 { cost 1000; mode point-to-point; } interface ge-0/0/28 { cost 1000; mode point-to-point; } interface ge-0/0/24 { cost 1000; mode point-to-point; } } bridge-priority 8k; } } } } vlans { voice-vlan { vlan-id 10; } employee-vlan { vlan-id 20; } guest-vlan { vlan-id 30; } camera-vlan { vlan-id 40; } } system { commit synchronize; } chassis { redundancy { graceful-switchover; }
在交换机上配置 RSTP 和不间断桥接 4
程序
CLI 快速配置
要在交换机 4 上快速配置 RSTP 和不间断桥接,请复制以下命令并将其粘贴到交换机终端窗口中:
[edit] set vlans voice-vlan description “Voice VLAN” set vlans voice-vlan vlan-id 10 set vlans employee-vlan description “Employee VLAN” set vlans employee-vlan vlan-id 20 set vlans guest-vlan description “Guest VLAN” set vlans guest-vlan vlan-id 30 set vlans camera-vlan description “Camera VLAN” set vlans camera-vlan vlan-id 40 set interfaces ge-0/0/23 unit 0 family ethernet-switching vlan members [10 20 30 40] set interfaces ge-0/0/19 unit 0 family ethernet-switching vlan members [10 20 30 40] set interfaces ge-0/0/23 unit 0 family ethernet-switching interface-mode trunk set interfaces ge-0/0/19 unit 0 family ethernet-switching interface-mode trunk set protocols rstp bridge-priority 16k set protocols rstp interface ge-0/0/23 cost 1000 set protocols rstp interface ge-0/0/23 mode point-to-point set protocols rstp interface ge-0/0/19 cost 1000 set protocols rstp interface ge-0/0/19 mode point-to-point
如果交换机 4 包含双路由引擎,则配置 NSB。要在交换机 4 上快速配置不间断桥接,请复制以下命令并将其粘贴到交换机终端窗口中:
set chassis redundancy graceful-switchover set system commit synchronize set protocols layer2-control nonstop-bridging
逐步过程
要在交换机上配置 RSTP 和不间断桥接 4:
配置 VLAN 语音 vlan、 员工 vlan、 访客 vlan 和 摄像头 vlan:
[edit vlans] user@switch4# set voice-vlan description “Voice VLAN” user@switch4# set voice-vlan vlan-id 10 user@switch4# set employee-vlan description “Employee VLAN” user@switch4# set employee-vlan vlan-id 20 user@switch4# set guest-vlan description “Guest VLAN” user@switch4# set guest-vlan vlan-id 30 user@switch4# set camera-vlan description “Camera VLAN” user@switch4# set camera-vlan vlan-id 40
在接口上配置 VLAN,包括对以太网交换协议的支持:
[edit interfaces] user@switch4# set ge-0/0/23 unit 0 family ethernet-switching vlan members [10 20 30 40] user@switch4# set ge-0/0/19 unit 0 family ethernet-switching vlan members [10 20 30 40]
为接口配置端口模式:
[edit interfaces] user@switch4# set ge-0/0/23 unit 0 family ethernet-switching interface-mode trunk user@switch4# set ge-0/0/19 unit 0 family ethernet-switching interface-mode trunk
在交换机上配置 RSTP:
[edit protocols] user@switch4# rstp bridge-priority 16k user@switch4# rstp interface ge-0/0/23 cost 1000 user@switch4# rstp interface ge-0/0/23 mode point-to-point user@switch4# rstp interface ge-0/0/19 cost 1000 user@switch4# rstp interface ge-0/0/19 mode point-to-point
逐步过程
如果交换机 4 包含双路由引擎,则配置不间断桥接。要在交换机 4 上配置 NSB:
启用平滑路由引擎切换 (GRES):
[edit chassis redundancy] user@switch4# set graceful-switchover
配置交换机以始终同步路由引擎之间的配置更改:
[edit system] user@switch4# set commit synchronize
如果尝试提交未配置不间断桥接但未配置配置更改同步的配置,则不会提交配置。
支持不间断桥接:
[edit protocols layer2-control] user@switch4# set nonstop-bridging
注意:此进程支持交换机上所有 NSB 支持的第 2 层协议(包括 RSTP)的 NSB。
结果
检查配置结果:
user@switch4> show configuration interfaces { ge-0/0/23 { unit 0 { family ethernet-switching { interface-mode trunk; vlan { members [10 20 30 40]; } } } } ge-0/0/19 { unit 0 { family ethernet-switching { interface-mode trunk; vlan { members [10 20 30 40]; } } } } } protocols { layer2-control { nonstop-bridging; } rstp { bridge-priority 16k; interface ge-0/0/23 { cost 1000; mode point-to-point; } interface ge-0/0/19 { cost 1000; mode point-to-point; } } } } vlans { voice-vlan { vlan-id 10; } employee-vlan { vlan-id 20; } guest-vlan { vlan-id 30; } camera-vlan { vlan-id 40; } } system { commit synchronize; } chassis { redundancy { graceful-switchover; }
验证
要确认配置工作正常,请在两个路由引擎上执行以下任务:
验证交换机 1 上的 RSTP 配置
目的
验证交换机 1 上的 RSTP 配置。
行动
使用操作模式命令:
user@switch1> show spanning-tree interface Spanning tree interface parameters for instance 0 Interface Port ID Designated Designated Port State Role port ID bridge ID Cost ge-0/0/13 128:526 128:526 16384.0019e25040e0 1000 BLK ALT ge-0/0/9 128:522 128:522 32768.0019e2503d20 1000 BLK ALT ge-0/0/11 128:524 128:524 8192.0019e25051e0 1000 FWD ROOT
意义
操作模式命令 show spanning-tree interface
显示 ge-0/0/13 处于转发状态。交换机 1 上的其他接口正在阻止。
验证交换机 2 上的 RSTP 配置
目的
使用此过程验证交换机 2 路由引擎上的 RSTP 配置。
行动
使用操作模式命令:
user@switch2> show spanning-tree interface Spanning tree interface parameters for instance 0 Interface Port ID Designated Designated Port State Role port ID bridge ID Cost ge-0/0/14 128:527 128:527 32768.0019e2503d20 1000 FWD DESG ge-0/0/18 128:529 128:529 8192.0019e25051e0 1000 FWD ROOT
意义
操作模式命令 show spanning-tree interface
显示 ge-0/0/18 处于转发状态,是根端口。
验证交换机 3 上的 RSTP 配置
目的
使用此过程验证交换机 3 路由引擎上的 RSTP 配置。
行动
使用操作模式命令:
user@switch3> show spanning-tree interface Spanning tree interface parameters for instance 0 Interface Port ID Designated Designated Port State Role port ID bridge ID Cost ge-0/0/26 128:539 128:539 8192.0019e25051e0 1000 FWD DESG ge-0/0/28 128:541 128:541 8192.0019e25051e0 1000 FWD DESG ge-0/0/24 128:537 128:537 8192.0019e25051e0 1000 FWD DESG
意义
操作模式命令 show spanning-tree interface
显示没有接口是 root 接口。
验证交换机 4 上的 RSTP 配置
目的
使用此过程验证交换机 4 路由引擎上的 RSTP 配置。
行动
使用操作模式命令:
user@switch4> show spanning-tree interface Spanning tree interface parameters for instance 0 Interface Port ID Designated Designated Port State Role port ID bridge ID Cost ge-0/0/23 128:536 128:536 8192.0019e25051e0 1000 FWD ROOT ge-0/0/19 128:532 128:532 16384.0019e25040e0 1000 FWD DESG
意义
操作模式命令 show spanning-tree interface
显示接口 ge-0/0/23 是 root 接口和转发。
示例:使用 EX 系列交换机上的 RSTP 加快融合速度并提高网络稳定性
EX 系列交换机默认使用快速生成树协议 (RSTP) 提供无环路拓扑。
支持冗余路由引擎的交换机使用 RSTP 时,务必在两个路由引擎上保持 RSTP 同步,以便在路由引擎切换后不会出现服务丢失。不间断桥接协议保持路由引擎同步。
此示例介绍如何在四台 EX 系列交换机上配置 RSTP 和 NSB:
- 要求
- 概述和拓扑
- 在交换机 1 上配置 RSTP 和不间断桥接
- 在交换机上配置 RSTP 和不间断桥接 2
- 在交换机上配置 RSTP 和不间断桥接 3
- 在交换机上配置 RSTP 和不间断桥接 4
- 验证
要求
此示例使用以下硬件和软件组件:
EX 系列交换机的 Junos OS 11.3 或更高版本
四台 EX 系列交换机
在为 RSTP 配置交换机之前,请确保您已:
安装四台交换机。请参阅 连接和配置 EX 系列交换机(J-Web 过程)。
在所有交换机上执行初始软件配置。请参阅 安装和连接 EX3200 交换机。
概述和拓扑
RSTP 的工作原理是将某些链路识别为点对点链路并阻止其他可能的路径。当其中一个点对点链路发生故障时,指定的备用链路将转换到转发状态并接管。在带有冗余路由引擎的交换机上配置不间断桥接 (NSB),使 RSTP 在两个路由引擎上保持同步。这样,RSTP 在切换后立即保持活动状态,因为它已同步到备份路由引擎。启用 NSB 时,RSTP 无需在路由引擎切换后重新混合,因为邻接设备未检测到交换机上的 RSTP 更改。在此示例中,四个 EX 系列交换机在 图 2 显示的拓扑中连接,以创建一个将 NSB 应用于具有双路由引擎的交换机的无环路拓扑。
表 2 显示了此示例的拓扑组件。
您可以在逻辑或物理接口上配置 RSTP。此示例显示在逻辑接口上配置的 RSTP。
财产 |
设置 |
---|---|
交换机 1 |
交换机 1 上的以下接口以这种方式连接:
|
交换机 2 |
交换机 2 上的以下接口以这种方式连接:
|
交换机 3 |
交换机 3 上的以下接口以这种方式连接:
|
交换机 4 |
交换机 4 上的以下接口以这种方式连接:
|
VLAN 名称和标记 ID |
语音 vlan, 标记 10 员工 vlan, 标记 20 访客 vlan, 标记 30 摄像头 vlan, 标记 40 |
此配置示例在使用 RSTP 的四台 EX 系列交换机之间创建无环路拓扑。
RSTP 拓扑包含具有特定角色的端口:
root 端口负责将数据转发至根桥。
备用端口是根端口的备用端口。当 root 端口关闭时,备用端口将成为活动根端口。
指定端口将数据转发至下游网段或设备。
备份端口是指定端口的备份端口。当指定端口停机时,备份端口将成为活动指定端口,并开始转发数据。
您还可以使用冗余中继链路在聚合层和分布层之间创建无环路拓扑。有关配置冗余中继链路的详细信息,请参阅 示例:配置冗余中继链路,以加快 EX 系列交换机上的恢复速度。
拓扑
在交换机 1 上配置 RSTP 和不间断桥接
程序
CLI 快速配置
要在交换机 1 上快速配置 RSTP 和不间断桥接,请复制以下命令并将其粘贴到交换机终端窗口中:
[edit] set vlans voice-vlan description “Voice VLAN” set vlans voice-vlan vlan-id 10 set vlans employee-vlan description “Employee VLAN” set vlans employee-vlan vlan-id 20 set vlans guest-vlan description “Guest VLAN” set vlans guest-vlan vlan-id 30 set vlans camera-vlan description “Camera VLAN” set vlans camera-vlan vlan-id 40 set interfaces ge-0/0/13 unit 0 family ethernet-switching vlan members [10 20 30 40] set interfaces ge–0/0/9 unit 0 family ethernet-switching vlan members [10 20 30 40] set interfaces ge–0/0/11 unit 0 family ethernet-switching vlan members [10 20 30 40] set interfaces ge–0/0/13 unit 0 family ethernet-switching port-mode trunk set interfaces ge-0/0/9 unit 0 family ethernet-switching port-mode trunk set interfaces ge-0/0/11 unit 0 family ethernet-switching port-mode trunk set protocols rstp bridge-priority 16k set protocols rstp interface ge-0/0/13.0 cost 1000 set protocols rstp interface ge-0/0/13.0 mode point-to-point set protocols rstp interface ge-0/0/9.0 cost 1000 set protocols rstp interface ge-0/0/9.0 mode point-to-point set protocols rstp interface ge-0/0/11.0 cost 1000 set protocols rstp interface ge-0/0/11.0 mode point-to-point
如果交换机 1 包含双路由引擎,则配置 NSB。要在交换机 1 上快速配置不间断桥接,请复制以下命令并将其粘贴到交换机终端窗口中:
set chassis redundancy graceful-switchover set system commit synchronize set ethernet-switching-options nonstop-bridging
逐步过程
要在交换机上配置 RSTP 和不间断桥接 1:
配置 VLAN 语音 vlan、 员工 vlan、 访客 vlan 和 摄像头 vlan:
[edit vlans] user@switch1# set voice-vlan description “Voice VLAN” user@switch1# set voice-vlan vlan-id 10 user@switch1# set employee-vlan description “Employee VLAN” user@switch1# set employee-vlan vlan-id 20 user@switch1# set guest-vlan description “Guest VLAN” user@switch1# set guest-vlan vlan-id 30 user@switch1# set camera-vlan description “Camera VLAN” user@switch1# set camera-vlan vlan-id 40
在接口上配置 VLAN,包括对以太网交换协议的支持:
[edit interfaces] user@switch1# set ge-0/0/13 unit 0 family ethernet-switching vlan members [10 20 30 40] user@switch1# set ge-0/0/9 unit 0 family ethernet-switching vlan members [10 20 30 40] user@switch1# set ge-0/0/11 unit 0 family ethernet-switching vlan members [10 20 30 40]
为接口配置端口模式:
[edit interfaces] user@switch1# set ge-0/0/13 unit 0 family ethernet-switching port-mode trunk user@switch1# set ge-0/0/9 unit 0 family ethernet-switching port-mode trunk user@switch1# set ge-0/0/11 unit 0 family ethernet-switching port-mode trunk
在交换机上配置 RSTP:
[edit protocols] user@switch1# rstp bridge-priority 16k user@switch1# rstp interface ge-0/0/13.0 cost 1000 user@switch1# rstp interface ge-0/0/13.0 mode point-to-point user@switch1# rstp interface ge-0/0/9.0 cost 1000 user@switch1# rstp interface ge-0/0/9.0 mode point-to-point user@switch1# rstp interface ge-0/0/11.0 cost 1000 user@switch1# rstp interface ge-0/0/11.0 mode point-to-point
逐步过程
如果交换机 1 包含双路由引擎,则配置不间断桥接。要在交换机 1 上配置 NSB:
启用平滑路由引擎切换 (GRES):
[edit chassis redundancy] user@switch1# set graceful-switchover
配置交换机以始终同步路由引擎之间的配置更改:
[edit system] user@switch1# set commit synchronize
如果尝试提交未配置不间断桥接但未配置配置更改同步的配置,则不会提交配置。
支持不间断桥接:
[edit ethernet-switching-options] user@switch1# set nonstop-bridging
注意:此进程支持交换机上所有 NSB 支持的第 2 层协议(包括 RSTP)的 NSB。
结果
检查配置结果:
user@switch1> show configuration interfaces { ge-0/0/13 { unit 0 { family ethernet-switching { port-mode trunk; vlan { members [10 20 30 40]; } } } } ge-0/0/9 { unit 0 { family ethernet-switching { port-mode trunk; vlan { members [10 20 30 40]; } } } } ge-0/0/11 { unit 0 { family ethernet-switching { port-mode trunk; vlan { members [10 20 30 40]; } } } } } protocols { rstp { bridge-priority 16k; interface ge-0/0/13.0 { cost 1000; mode point-to-point; } interface ge-0/0/9.0 { cost 1000; mode point-to-point; } interface ge-0/0/11.0 { cost 1000; mode point-to-point; } } } } vlans { voice-vlan { vlan-id 10; } employee-vlan { vlan-id 20; } guest-vlan { vlan-id 30; } camera-vlan { vlan-id 40; } } system { commit synchronize; } chassis { redundancy { graceful-switchover; } ethernet-switching-options { nonstop-bridging; }
在交换机上配置 RSTP 和不间断桥接 2
程序
CLI 快速配置
要在交换机 2 上快速配置 RSTP 和不间断桥接,请复制以下命令并将其粘贴到交换机终端窗口中:
[edit] set vlans voice-vlan description “Voice VLAN” set vlans voice-vlan vlan-id 10 set vlans employee-vlan description “Employee VLAN” set vlans employee-vlan vlan-id 20 set vlans guest-vlan description “Guest VLAN” set vlans guest-vlan vlan-id 30 set vlans camera-vlan description “Camera VLAN” set vlans camera-vlan vlan-id 40 set interfaces ge-0/0/14 unit 0 family ethernet-switching vlan members [10 20 30 40] set interfaces ge-0/0/18 unit 0 family ethernet-switching vlan members [10 20 30 40] set interfaces ge-0/0/14 unit 0 family ethernet-switching port-mode trunk set interfaces ge-0/0/18 unit 0 family ethernet-switching port-mode trunk set protocols rstp bridge-priority 32k set protocols rstp interface ge-0/0/14.0 cost 1000 set protocols rstp interface ge-0/0/14.0 mode point-to-point set protocols rstp interface ge-0/0/18.0 cost 1000 set protocols rstp interface ge-0/0/18.0 mode point-to-point
如果交换机 2 包含双路由引擎,则配置 NSB。要在交换机 2 上快速配置不间断桥接,请复制以下命令并将其粘贴到交换机终端窗口中:
set chassis redundancy graceful-switchover set system commit synchronize set ethernet-switching-options nonstop-bridging
逐步过程
要在交换机上配置 RSTP 和不间断桥接 2:
配置 VLAN 语音 vlan、 员工 vlan、 访客 vlan 和 摄像头 vlan:
[edit vlans] user@switch2# set voice-vlan description “Voice VLAN” user@switch2# set voice-vlan vlan-id 10 user@switch2# set employee-vlan description “Employee VLAN” user@switch2# set employee-vlan vlan-id 20 user@switch2# set guest-vlan description “Guest VLAN” user@switch2# set guest-vlan vlan-id 30 user@switch2# set camera-vlan vlan-description “Camera VLAN” user@switch2# set camera-vlan vlan-id 40
在接口上配置 VLAN,包括对以太网交换协议的支持:
[edit interfaces] user@switch2# set ge-0/0/14 unit 0 family ethernet-switching vlan members [10 20 30 40] user@switch2# set ge-0/0/18 unit 0 family ethernet-switching vlan members [10 20 30 40]
为接口配置端口模式:
[edit interfaces] user@switch2# set ge-0/0/14 unit 0 family ethernet-switching port-mode trunk user@switch2# set ge-0/0/18 unit 0 family ethernet-switching port-mode trunk
在交换机上配置 RSTP:
[edit protocols] user@switch2# rstp bridge-priority 32k user@switch2# rstp interface ge-0/0/14.0 cost 1000 user@switch2# rstp interface ge-0/0/14.0 mode point-to-point user@switch2# rstp interface ge-0/0/18.0 cost 1000 user@switch2# rstp interface ge-0/0/18.0 mode point-to-point
逐步过程
如果交换机 2 包含双路由引擎,则配置不间断桥接。要在交换机 2 上配置 NSB:
启用平滑路由引擎切换 (GRES):
[edit chassis redundancy] user@switch2# set graceful-switchover
配置交换机以始终同步路由引擎之间的配置更改:
[edit system] user@switch2# set commit synchronize
如果尝试提交未配置不间断桥接但未配置配置更改同步的配置,则不会提交配置。
支持不间断桥接:
[edit ethernet-switching-options] user@switch2# set nonstop-bridging
注意:此进程支持交换机上所有 NSB 支持的第 2 层协议(包括 RSTP)的 NSB。
结果
检查配置结果:
user@switch2> show configuration interfaces { ge-0/0/14 { unit 0 { family ethernet-switching { port-mode trunk; vlan { members [10 20 30 40]; } } } } ge-0/0/18 { unit 0 { family ethernet-switching { port-mode trunk; vlan { members [10 20 30 40]; } } } } } protocols { rstp { bridge-priority 32k; interface ge-0/0/14.0 { cost 1000; mode point-to-point; } interface ge-0/0/18.0 { cost 1000; mode point-to-point; } } } } vlans { voice-vlan { vlan-id 10; } employee-vlan { vlan-id 20; } guest-vlan { vlan-id 30; } camera-vlan { vlan-id 40; } } system { commit synchronize; } chassis { redundancy { graceful-switchover; } ethernet-switching-options { nonstop-bridging; }
在交换机上配置 RSTP 和不间断桥接 3
程序
CLI 快速配置
要在交换机 3 上快速配置 RSTP 和不间断桥接,请复制以下命令并将其粘贴到交换机终端窗口中:
[edit] set vlans voice-vlan description “Voice VLAN” set vlans voice-vlan vlan-id 10 set vlans employee-vlan description “Employee VLAN” set vlans employee-vlan vlan-id 20 set vlans guest-vlan description “Guest VLAN” set vlans guest-vlan vlan-id 30 set vlans camera-vlan description “Camera VLAN” set vlans camera-vlan vlan-id 40 set interfaces ge-0/0/26 unit 0 family ethernet-switching vlan members [10 20 30 40] set interfaces ge-0/0/28 unit 0 family ethernet-switching vlan members [10 20 30 40] set interfaces ge-0/0/24 unit 0 family ethernet-switching vlan members [10 20 30 40] set interfaces ge-0/0/26 unit 0 family ethernet-switching port-mode trunk set interfaces ge-0/0/28 unit 0 family ethernet-switching port-mode trunk set interfaces ge-0/0/24 unit 0 family ethernet-switching port-mode trunk set protocols rstp bridge-priority 8k set protocols rstp interface ge-0/0/26.0 cost 1000 set protocols rstp interface ge-0/0/26.0 mode point-to-point set protocols rstp interface ge-0/0/28.0 cost 1000 set protocols rstp interface ge-0/0/28.0 mode point-to-point set protocols rstp interface ge-0/0/24.0 cost 1000 set protocols rstp interface ge-0/0/24.0 mode point-to-point
如果交换机 3 包含双路由引擎,则配置 NSB。要在交换机 3 上快速配置不间断桥接,请复制以下命令并将其粘贴到交换机终端窗口中:
set chassis redundancy graceful-switchover set system commit synchronize set ethernet-switching-options nonstop-bridging
逐步过程
要在交换机上配置 RSTP 和不间断桥接 3:
配置 VLAN 语音 vlan、 员工 vlan、 访客 vlan 和 摄像头 vlan:
[edit vlans] user@switch3# set voice-vlan description “Voice VLAN” user@switch3# set voice-vlan vlan-id 10 user@switch3# set employee-vlan description “Employee VLAN” user@switch3# set employee-vlan vlan-id 20 user@switch3# set guest-vlan description “Guest VLAN” user@switch3# set guest-vlan vlan-id 30 user@switch3# set camera-vlan description “Camera VLAN” user@switch3# set camera-vlan vlan-id 40
在接口上配置 VLAN,包括对以太网交换协议的支持:
[edit interfaces] user@switch3# set ge-0/0/26 unit 0 family ethernet-switching vlan members [10 20 30 40] user@switch3# set ge-0/0/28 unit 0 family ethernet-switching vlan members [10 20 30 40] user@switch3# set ge-0/0/24 unit 0 family ethernet-switching vlan members [10 20 30 40]
为接口配置端口模式:
[edit interfaces] user@switch3# set ge-0/0/26 unit 0 family ethernet-switching port-mode trunk user@switch3# set ge-0/0/28 unit 0 family ethernet-switching port-mode trunk user@switch3# set ge-0/0/24 unit 0 family ethernet-switching port-mode trunk
在交换机上配置 RSTP:
[edit protocols] user@switch3# rstp bridge-priority 8k user@switch3# rstp interface ge-0/0/26.0 cost 1000 user@switch3# rstp interface ge-0/0/26.0 mode point-to-point user@switch3# rstp interface ge-0/0/28.0 cost 1000 user@switch3# rstp interface ge-0/0/28.0 mode point-to-point user@switch3# rstp interface ge-0/0/24.0 cost 1000 user@switch3# rstp interface ge-0/0/24.0 mode point-to-point
逐步过程
如果交换机 3 包含双路由引擎,则配置不间断桥接。要在交换机 3 上配置 NSB:
启用平滑路由引擎切换 (GRES):
[edit chassis redundancy] user@switch3# set graceful-switchover
配置交换机以始终同步路由引擎之间的配置更改:
[edit system] user@switch3# set commit synchronize
如果尝试提交未配置不间断桥接但未配置配置更改同步的配置,则不会提交配置。
支持不间断桥接:
[edit ethernet-switching-options] user@switch3# set nonstop-bridging
注意:此进程支持交换机上所有 NSB 支持的第 2 层协议(包括 RSTP)的 NSB。
结果
检查配置结果:
user@switch3> show configuration interfaces { ge-0/0/26 { unit 0 { family ethernet-switching { port-mode trunk; vlan { members [10 20 30 40]; } } } } ge-0/0/28 { unit 0 { family ethernet-switching { port-mode trunk; vlan { members [10 20 30 40]; } } } } ge-0/0/24 { unit 0 { family ethernet-switching { port-mode trunk; vlan { members [10 20 30 40]; } } } } } } protocols { rstp { bridge-priority 8k; interface ge-0/0/26.0 { cost 1000; mode point-to-point; } interface ge-0/0/28.0 { cost 1000; mode point-to-point; } interface ge-0/0/24.0 { cost 1000; mode point-to-point; } } bridge-priority 8k; } } } } vlans { voice-vlan { vlan-id 10; } employee-vlan { vlan-id 20; } guest-vlan { vlan-id 30; } camera-vlan { vlan-id 40; } } system { commit synchronize; } chassis { redundancy { graceful-switchover; } ethernet-switching-options { nonstop-bridging; }
在交换机上配置 RSTP 和不间断桥接 4
程序
CLI 快速配置
要在交换机 4 上快速配置 RSTP 和不间断桥接,请复制以下命令并将其粘贴到交换机终端窗口中:
[edit] set vlans voice-vlan description “Voice VLAN” set vlans voice-vlan vlan–id 10 set vlans employee-vlan description “Employee VLAN” set vlans employee-vlan vlan-id 20 set vlans guest-vlan description “Guest VLAN” set vlans guest-vlan vlan-id 30 set vlans camera-vlan description “Camera VLAN” set vlans camera-vlan vlan-id 40 set interfaces ge-0/0/23 unit 0 family ethernet-switching vlan members [10 20 30 40] set interfaces ge-0/0/19 unit 0 family ethernet-switching vlan members [10 20 30 40] set interfaces ge-0/0/23 unit 0 family ethernet-switching port-mode trunk set interfaces ge-0/0/19 unit 0 family ethernet-switching port-mode trunk set protocols rstp bridge-priority 16k set protocols rstp interface ge-0/0/23.0 cost 1000 set protocols rstp interface ge-0/0/23.0 mode point-to-point set protocols rstp interface ge-0/0/19.0 cost 1000 set protocols rstp interface ge-0/0/19.0 mode point-to-point
如果交换机 4 包含双路由引擎,则配置 NSB。要在交换机 4 上快速配置不间断桥接,请复制以下命令并将其粘贴到交换机终端窗口中:
set chassis redundancy graceful-switchover set system commit synchronize set ethernet-switching-options nonstop-bridging
逐步过程
要在交换机上配置 RSTP 和不间断桥接 4:
配置 VLAN 语音 vlan、 员工 vlan、 访客 vlan 和 摄像头 vlan:
[edit vlans] user@switch4# set voice-vlan description “Voice VLAN” user@switch4# set voice-vlan vlan-id 10 user@switch4# set employee-vlan description “Employee VLAN” user@switch4# set employee-vlan vlan-id 20 user@switch4# set guest-vlan description “Guest VLAN” user@switch4# set guest-vlan vlan-id 30 user@switch4# set camera-vlan description “Camera VLAN” user@switch4# set camera-vlan vlan-id 40
在接口上配置 VLAN,包括对以太网交换协议的支持:
[edit interfaces] user@switch4# set ge-0/0/23 unit 0 family ethernet-switching vlan members [10 20 30 40] user@switch4# set ge-0/0/19 unit 0 family ethernet-switching vlan members [10 20 30 40]
为接口配置端口模式:
[edit interfaces] user@switch4# set ge-0/0/23 unit 0 family ethernet-switching port-mode trunk user@switch4# set ge-0/0/19 unit 0 family ethernet-switching port-mode trunk
在交换机上配置 RSTP:
[edit protocols] user@switch4# rstp bridge-priority 16k user@switch4# rstp interface all cost 1000 user@switch4# rstp interface ge-0/0/23.0 cost 1000 user@switch4# rstp interface ge-0/0/23.0 mode point-to-point user@switch4# rstp interface ge-0/0/19.0 cost 1000 user@switch4# rstp interface ge-0/0/19.0 mode point-to-point
逐步过程
如果交换机 4 包含双路由引擎,则配置不间断桥接。要在交换机 4 上配置 NSB:
启用平滑路由引擎切换 (GRES):
[edit chassis redundancy] user@switch4# set graceful-switchover
配置交换机以始终同步路由引擎之间的配置更改:
[edit system] user@switch4# set commit synchronize
如果尝试提交未配置不间断桥接但未配置配置更改同步的配置,则不会提交配置。
支持不间断桥接:
[edit ethernet-switching-options] user@switch4# set nonstop-bridging
注意:此进程支持交换机上所有 NSB 支持的第 2 层协议(包括 RSTP)的 NSB。
结果
检查配置结果:
user@switch4> show configuration interfaces { ge-0/0/23 { unit 0 { family ethernet-switching { port-mode trunk; vlan { members [10 20 30 40]; } } } } ge-0/0/19 { unit 0 { family ethernet-switching { port-mode trunk; vlan { members [10 20 30 40]; } } } } } protocols { rstp { bridge-priority 16k; interface ge-0/0/23.0 { cost 1000; mode point-to-point; } interface ge-0/0/19.0 { cost 1000; mode point-to-point; } } } } vlans { voice-vlan { vlan-id 10; } employee-vlan { vlan-id 20; } guest-vlan { vlan-id 30; } camera-vlan { vlan-id 40; } } system { commit synchronize; } chassis { redundancy { graceful-switchover; } ethernet-switching-options { nonstop-bridging; }
验证
要确认配置工作正常,请在两个路由引擎上执行以下任务:
验证交换机 1 上的 RSTP 配置
目的
验证交换机 1 上的 RSTP 配置。
行动
使用操作模式命令:
user@switch1> show spanning-tree interface Spanning tree interface parameters for instance 0 Interface Port ID Designated Designated Port State Role port ID bridge ID Cost ge-0/0/13.0 128:526 128:526 16384.0019e25040e0 1000 BLK ALT ge-0/0/9.0 128:522 128:522 32768.0019e2503d20 1000 BLK ALT ge-0/0/11.0 128:524 128:524 8192.0019e25051e0 1000 FWD ROOT
意义
操作模式命令 show spanning-tree interface
显示 ge-0/0/13.0 处于转发状态。交换机 1 上的其他接口正在阻止。
验证交换机 2 上的 RSTP 配置
目的
使用此过程验证交换机 2 路由引擎上的 RSTP 配置。
行动
使用操作模式命令:
user@switch2> show spanning-tree interface Spanning tree interface parameters for instance 0 Interface Port ID Designated Designated Port State Role port ID bridge ID Cost ge-0/0/14.0 128:527 128:527 32768.0019e2503d20 1000 FWD DESG ge-0/0/18.0 128:529 128:529 8192.0019e25051e0 1000 FWD ROOT
意义
操作模式命令 show spanning-tree interface
显示 ge-0/0/18.0 处于转发状态,是根端口。
验证交换机 3 上的 RSTP 配置
目的
使用此过程验证交换机 3 路由引擎上的 RSTP 配置。
行动
使用操作模式命令:
user@switch3> show spanning-tree interface Spanning tree interface parameters for instance 0 Interface Port ID Designated Designated Port State Role port ID bridge ID Cost ge-0/0/26.0 128:539 128:539 8192.0019e25051e0 1000 FWD DESG ge-0/0/28.0 128:541 128:541 8192.0019e25051e0 1000 FWD DESG ge-0/0/24.0 128:537 128:537 8192.0019e25051e0 1000 FWD DESG
意义
操作模式命令 show spanning-tree interface
显示没有接口是 root 接口。
验证交换机 4 上的 RSTP 配置
目的
使用此过程验证交换机 4 路由引擎上的 RSTP 配置。
行动
使用操作模式命令:
user@switch4> show spanning-tree interface Spanning tree interface parameters for instance 0 Interface Port ID Designated Designated Port State Role port ID bridge ID Cost ge-0/0/23.0 128:536 128:536 8192.0019e25051e0 1000 FWD ROOT ge-0/0/19.0 128:532 128:532 16384.0019e25040e0 1000 FWD DESG
意义
操作模式命令 show spanning-tree interface
显示,接口 ge-0/0/23.0 是根接口和转发。
强制 RSTP 或 VSTP 以 IEEE 802.1D STP 运行(CLI 过程)
此过程使用支持增强型第 2 层软件 (ELS) 配置样式的 EX 系列交换机的 Junos OS。有关 ELS 详细信息,请参阅 使用增强型第 2 层软件 CLI。
在运行快速生成树协议 (RSTP)(默认)或 VLAN 生成树协议 (VSTP) 的 EX 系列交换机上,您可以强制原始 IEEE 802.1D 生成树协议 (STP) 版本以代替 RSTP 或 VSTP 运行。配置语句以 force-version stp 实现与不支持 RSTP 或 VSTP 的旧桥接的兼容性。
要强制生成树协议版本成为原始 IEEE 802.1D STP:
[edit protocols] user@switch# set (rstp | vstp) force-version stp
使用 语 force-version 句以全局启用 xSTP 之后,将语 force-version 句应用于特定第 2 层端口。