示例:在 EX 系列交换机上配置以太网环网保护交换机
您可以在连接的 EX 系列或 QFX 系列交换机上配置以太网环网保护交换 (ERPS),以防止致命环路中断网络。(平台支持取决于安装中的 Junos OS 版本。ERPS 类似于生成树协议,但 ERPS 效率更高,因为它是针对环形拓扑定制的。必须至少配置三个交换机才能形成一个环。
此示例说明如何在环形拓扑中的专用链路上相互连接的四台交换机上配置以太网环形保护交换。
此任务对 EX 系列交换机使用 Junos OS,不支持增强型第 2 层软件 (ELS) 配置样式。但是,ERPS 环可以包含不同类型的交换机,支持或不支持 ELS。如果要配置的 ERPS 环网还包括运行支持 ELS 的软件的 QFX 系列或 EX 系列交换机,请参阅 示例:在支持 ELS 的 QFX 系列和 EX 系列交换机上配置以太网环网保护交换,以获取这些交换机上的等效示例配置步骤。有关 ELS 的详细信息,请参阅使用增强型第 2 层软件 CLI。
要求
此示例使用以下硬件和软件组件:
四台连接的 EX 系列交换机,将用作环形拓扑中的节点。
注:由于 Junos 在 EX2300 和 EX3400 交换机上使用 ERPV2 状态机支持 ERPV1,因此在这两台交换机上运行 ERP 在以下方面与 ERPV1 ITU 标准存在偏差:
EX2300 和 EX3400 交换机上的等待恢复 (WTR) 配置值必须为 5-12 分钟。
等待块计时器 (WTB) 在 EX2300 和 EX3400 交换机上始终处于禁用状态,因为 ERPSv1 不支持该计时器。对 WTB 设置所做的任何配置均无效。CLI 命令“显示保护组以太网环节点状态详细信息”的输出列出了 WTB 设置,但该设置不起作用。
在 EX2300 和 EX3400 交换机上进行初始状态机初始化期间,两个 ERPV1 环形端口在非 RPL 节点上均将变为丢弃状态。
在 EX2300 和 EX3400 交换机上进行 ERPV1 初始状态机初始化期间,自动保护切换 (APS) 状态在非 RPL 交换机上将变为空闲状态
Junos OS 12.1 或更高版本,不支持增强型第 2 层软件 (ELS) 配置样式。
开始之前,确保您具备以下条件:
在四台交换机中的每一台交换机上配置了两个中继接口。有关此示例中使用的接口名称的列表,请参阅 表 1 。
在所有四台交换机上配置了 ID 为 100 的相同 VLAN (
erp-control-vlan-1
),并将每台交换机的两个网络接口与 VLAN 关联。请参阅 为 EX 系列交换机配置 VLAN。有关此示例中使用的接口名称的列表,请参阅 表 1 。在所有四台交换机上配置了两个 ID 分别为 101 和 102 的 VLAN(
erp-data-1
和erp-data-2
),并将每台交换机erp-data-1
上的东西接口与 和erp-data-2
关联。有关此示例中使用的接口名称的列表,请参阅 表 1 。注:当 EX2300 和 EX3400 ERPS 交换机的 VLAN-ID 在接口层次结构下配置了名称时,会发生提交错误。当 VLAN-ID 位于交换机中配置了 ERPS 的接口层次结构下时,请使用数字配置 VLAN-ID,为避免这种情况。
概述和拓扑
ERPS 在所有交换机之间使用专用物理链路(包括用于中继端口的控制 VLAN)来保护活动链路。ERPS VLAN 全部位于此链路上,默认情况下也会被阻止。当交换机之间的流量顺畅流动时,活动链路将处理所有流量。仅当其中一个数据链路上发生错误时,ERPS 控制通道才会接管并开始转发流量。
交换机上的中继端口使用 VLAN 为 ERPS 创建单独的控制通道。为一个环配置多个 ERPS 实例时,ERPS 链路上有多组环形保护链路 (RPL) 和 RPL 所有者,并且为每个实例阻止不同的通道。非中继端口使用物理链路,因为控制通道和协议数据单元 (PDU) 未标记,数据包中没有 VLAN 信息。
此示例在通过中继端口连接在一个环中的四台交换机上创建一个名为 erp1 的保护环(称为节点环),如 所示 图 1。由于链路是中继端口,因此名为 erp-control-vlan-1 的 VLAN 用于 erp1 流量。每台交换机的东接口与相邻交换机的西接口连接。Cobia 是 RPL 所有者,接口 ge-0/0/0 配置为 RPL 端接口。Jas5-esc 的接口 ge-0/0/0 配置为 RPL 邻居接口。在空闲状态下,RPL 端会阻止此特定 ERP 实例的控制 VLAN 和数据通道 VLAN — Cobia 上被阻止的端口在 中 图 1标有星号。

在此示例中,我们使用 和 表 1中指示的图 1接口配置四台交换机。
接口 |
军曹鱼 |
Jas5-ESC |
Jas6-ESC |
带鱼 |
---|---|---|---|---|
东 |
ge-0/0/0 |
ge-0/0/10 |
ge-0/0/30 |
ge-0/0/20 |
西 |
ge-0/0/20 |
ge-0/0/0 |
ge-0/0/20 |
ge-0/0/10 |
第三 |
ge-0/0/10 |
ge-0/0/20 |
ge-0/0/0 |
ge-0/0/0 |
配置
在 RPL 所有者节点 Cobia 上配置 ERPS
CLI 快速配置
要快速配置 Cobia,请复制以下命令,将其粘贴到文本文件中,删除所有换行符,更改任何必要的详细信息以匹配您的网络配置,然后将命令复制并粘贴到层次结构级别的 CLI [edit]
中。
生成树协议和 ERP 不能同时配置在环形端口上。由于 RSTP 是在默认交换机配置中启用的生成树协议,因此此示例显示了在配置 ERPS 之前在每个环形端口上禁用 RSTP。如果启用了另一个生成树协议,则必须先禁用该协议。
set protocols rstp interface ge-0/0/0 disable set protocols rstp interface ge-0/0/20 disable set protocols protection-group ethernet-ring erp1 set protocols protection-group ethernet-ring erp1 ring-protection-link-owner set protocols protection-group ethernet-ring erp1 data-channel erp-data-1 set protocols protection-group ethernet-ring erp1 data-channel erp-data-2 set protocols protection-group ethernet-ring erp1 control-vlan erp-control-vlan-1 set protocols protection-group ethernet-ring erp1 east-interface control-channel ge-0/0/0.0 set protocols protection-group ethernet-ring erp1 east-interface ring-protection-link-end set protocols protection-group ethernet-ring erp1 west-interface control-channel ge-0/0/20.0
分步过程
要在军曹鱼上配置 ERPS:
禁用 ERPS 接口上配置的任何生成树协议。STP、RSTP、VSTP 和 MSTP 都可用于生成树协议。RSTP 在默认配置中处于启用状态,因此此示例显示如何禁用 RSTP:
[edit protocols] user@switch# set rstp interface ge-0/0/0 disable user@switch# set rstp interface ge-0/0/20 disable
创建名为 erp1 的节点环:
[edit protocols] user@switch# set protection-group ethernet-ring erp1
将 Cobia 指定为 RPL 所有者节点:
[edit protocols protection-group ethernet-ring erp1] user@switch# set ring-protection-link-owner
将 VLAN erp-data-1 和 erp-data-2 配置为数据通道:
[edit protocols protection-group ethernet-ring erp1] user@switch# set data-channel erp-data-1 user@switch# set data-channel erp-data-2
在中继接口上为此 ERP 实例配置控制 VLAN erp-control-vlan-1:
[edit protocols protection-group ethernet-ring erp1] user@switch# set control-vlan erp-control-vlan-1
使用控制通道 ge-0/0/0.0 配置节点环网 erp1 的东接口,并指示此特定环形保护链路到此结束:
[edit protocols protection-group ethernet-ring erp1] user@switch# set east-interface control-channel ge-0/0/0.0 user@switch# set east-interface ring-protection-link-end
使用控制通道 ge-0/0/20.0 配置节点环 erp1 的西部接口:
[edit protocols protection-group ethernet-ring erp1] user@switch# set west-interface control-channel ge-0/0/20.0
结果
在配置模式下,通过输入 show protocols
命令检查您的 ERPS 配置。如果输出未显示预期的配置,请重复此示例中的配置说明,以便进行更正。
[edit] user@switch# show protocols rstp { interface ge-0/0/20.0 { disable; } interface ge-0/0/0.0 { disable; } } protection-group { ethernet-ring erp1 { ring-protection-link-owner; east-interface { control-channel { ge-0/0/0.0; } ring-protection-link-end; } west-interface { control-channel { ge-0/0/20.0; } } control-vlan erp-control-vlan-1; data-channel { vlan [ 101-102 ]; } } }
在配置模式下,输入命令检查 show vlans
您的 VLAN 配置。如果输出未显示预期的配置,请重复此示例中的配置说明,以便进行更正。
[edit] user@switch# show vlans erp-control-vlan-1 { vlan-id 100; interface { ge-0/0/0.0; ge-0/0/20.0; } } erp-data-1 { vlan-id 101; interface { ge-0/0/10.0; ge-0/0/0.0; ge-0/0/20.0; } } erp-data-2 { vlan-id 102; interface { ge-0/0/10.0; ge-0/0/0.0; ge-0/0/20.0; } }
在配置模式下,输入命令检查 show interfaces
接口配置。如果输出未显示预期的配置,请重复此示例中的配置说明,以便进行更正。
[edit] user@switch# show interfaces ge-0/0/0 { unit 0 { family ethernet-switching { port-mode trunk; } } } ge-0/0/10 { unit 0 { family ethernet-switching { port-mode trunk; } } } ge-0/0/20 { unit 0 { family ethernet-switching { port-mode trunk; } } }
如果完成设备配置, commit
请输入配置模式。
在 Jas5-esc 上配置 ERPS
CLI 快速配置
要快速配置 Jas5-esc,请复制以下命令,将其粘贴到文本文件中,删除所有换行符,更改任何必要的详细信息以匹配您的网络配置,然后将命令复制并粘贴到层次结构级别的 CLI [edit]
中。
set protocols rstp interface ge-0/0/10 disable set protocols rstp interface ge-0/0/0 disable set protocols protection-group ethernet-ring erp1 set protocols protection-group ethernet-ring erp1 data-channel erp-data-1 set protocols protection-group ethernet-ring erp1 data-channel erp-data-2 set protocols protection-group ethernet-ring erp1 control-vlan erp-control-vlan-1 set protocols protection-group ethernet-ring erp1 east-interface control-channel ge-0/0/10.0 set protocols protection-group ethernet-ring erp1 west-interface control-channel ge-0/0/0.0
分步过程
要在 Jas5-esc 上配置 ERPS,请执行以下操作:
禁用 ERPS 接口上配置的任何生成树协议。RSTP 在默认配置中处于启用状态,因此此示例显示如何禁用 RSTP:
[edit protocols] user@switch# set rstp interface ge-0/0/10 disable user@switch# set rstp interface ge-0/0/0 disable
创建名为 erp1 的节点环:
[edit protocols] user@switch# set protection-group ethernet-ring erp1
为节点环 erp1 配置名为 erp-control-vlan-1 的控制 VLAN:
[edit protocols protection-group ethernet-ring erp1] user@switch# set control-vlan erp-control-vlan-1
配置名为 erp-data-1 和 erp-data-2 的两个数据通道,以定义一组属于环形实例的 VLAN ID。
[edit protocols protection-group ethernet-ring erp1] user@switch# set data-channel erp-data-1 user@switch# set data-channel erp-data-2
使用控制通道 ge-0/0/10.0 配置节点环 erp1 的东部接口:
[edit protocols protection-group ethernet-ring erp1] user@switch# set east-interface control-channel ge-0/0/10.0
使用控制通道 ge-0/0/0.0 配置节点环 erp1 的西部接口:
[edit protocols protection-group ethernet-ring erp1] user@switch# set west-interface control-channel ge-0/0/0.0
结果
在配置模式下,通过输入 show protocols
命令检查您的 ERPS 配置。如果输出未显示预期的配置,请重复此示例中的配置说明,以便进行更正。
[edit] user@switch# show protocols rstp { interface ge-0/0/10.0 { disable; } interface ge-0/0/0.0 { disable; } } protection-group { ethernet-ring erp1 { east-interface { control-channel { ge-0/0/10.0; } } west-interface { control-channel { ge-0/0/0.0; } } control-vlan erp-control-vlan-1; data-channel { vlan [ 101-102 ]; } } }
在配置模式下,输入命令检查 show vlans
您的 VLAN 配置。如果输出未显示预期的配置,请重复此示例中的配置说明,以便进行更正。
[edit] user@switch# show vlans erp-control-vlan-1 { vlan-id 100; interface { ge-0/0/10.0; ge-0/0/0.0; } } erp-data-1 { vlan-id 101; interface { ge-0/0/20.0; ge-0/0/10.0; ge-0/0/0.0; } } erp-data-2 { vlan-id 102; interface { ge-0/0/20.0; ge-0/0/10.0; ge-0/0/0.0; } }
在配置模式下,输入命令检查 show interfaces
接口配置。如果输出未显示预期的配置,请重复此示例中的配置说明,以便进行更正。
[edit] user@switch# show interfaces ge-0/0/0 { unit 0 { family ethernet-switching { port-mode trunk; } } } ge-0/0/10 { unit 0 { family ethernet-switching { port-mode trunk; } } } ge-0/0/20 { unit 0 { family ethernet-switching { port-mode trunk; } } }
如果完成设备配置, commit
请输入配置模式。
在发尾上配置 ERPS
CLI 快速配置
要快速配置 Hairtail,请复制以下命令,将其粘贴到文本文件中,删除所有换行符,更改任何必要的详细信息以匹配您的网络配置,然后将命令复制并粘贴到层次结构级别的 CLI [edit]
中。
set protocols rstp interface ge-0/0/10 disable set protocols rstp interface ge-0/0/20 disable set protocols protection-group ethernet-ring erp1 set protocols protection-group ethernet-ring erp1 data-channel erp-data-1 set protocols protection-group ethernet-ring erp1 data-channel erp-data-2 set protocols protection-group ethernet-ring erp1 control-vlan erp-control-vlan-1 set protocols protection-group ethernet-ring erp1 east-interface control-channel ge-0/0/20.0 set protocols protection-group ethernet-ring erp1 west-interface control-channel ge-0/0/10.0
分步过程
要在 Hairtail 上配置 ERPS:
禁用 ERPS 接口上配置的任何生成树协议。RSTP 在默认配置中处于启用状态,因此此示例显示如何禁用 RSTP:
[edit protocols] user@switch# set rstp interface ge-0/0/10 disable user@switch# set rstp interface ge-0/0/20 disable
创建名为 erp1 的节点环:
[edit protocols] user@switch# set protection-group ethernet-ring erp1
为节点环 erp1 配置控制 VLAN erp-control-vlan-1:
[edit protocols protection-group ethernet-ring erp1] user@switch# set control-vlan erp-control-vlan-1
配置名为 erp-data-1 和 erp-data-2 的两个数据通道,以定义一组属于环形实例的 VLAN ID:
[edit protocols protection-group ethernet-ring erp1] user@switch# set data-channel erp-data-1 user@switch# set data-channel erp-data-2
使用控制通道 ge-0/0/20.0 配置节点环网 erp1 的东接口,并指示其连接到环网保护链路:
[edit protocols protection-group ethernet-ring erp1] user@switch# set east-interface control-channel ge-0/0/20.0
使用控制通道 ge-0/0/10.0 配置节点环网 erp1 的西部接口,并指示它连接到环形保护链路:
[edit protocols protection-group ethernet-ring erp1] user@switch# set west-interface control-channel ge-0/0/10.0
结果
在配置模式下,通过输入 show protocols
命令检查您的 ERPS 配置。如果输出未显示预期的配置,请重复此示例中的配置说明,以便进行更正。
[edit] user@switch# show protocols rstp { interface ge-0/0/10.0 { disable; } interface ge-0/0/20.0 { disable; } } protection-group { ethernet-ring erp1 { east-interface { control-channel { ge-0/0/20.0; } } west-interface { control-channel { ge-0/0/10.0; } } control-vlan erp-control-vlan-1; data-channel { vlan [ 101-102 ]; } } }
在配置模式下,输入命令检查 show vlans
您的 VLAN 配置。如果输出未显示预期的配置,请重复此示例中的配置说明,以便进行更正。
[edit] user@switch# show vlans erp-control-vlan-1 { vlan-id 100; interface { ge-0/0/20.0; ge-0/0/10.0; } } erp-data-1 { vlan-id 101; interface { ge-0/0/0.0; ge-0/0/20.0; ge-0/0/10.0; } } erp-data-2 { vlan-id 102; interface { ge-0/0/0.0; ge-0/0/20.0; ge-0/0/10.0; } }
在配置模式下,输入命令检查 show interfaces
接口配置。如果输出未显示预期的配置,请重复此示例中的配置说明,以便进行更正。
[edit] user@switch# show interfaces ge-0/0/0 { unit 0 { family ethernet-switching { port-mode trunk; } } } ge-0/0/10 { unit 0 { family ethernet-switching { port-mode trunk; } ge-0/0/20 { unit 0 { family ethernet-switching { port-mode trunk; } }
如果完成设备配置, commit
请输入配置模式。
在 Jas6-esc 上配置 ERPS
CLI 快速配置
要快速配置 Jas6-esc,请复制以下命令,将其粘贴到文本文件中,删除所有换行符,更改任何必要的详细信息以匹配您的网络配置,然后将命令复制并粘贴到层次结构级别的 CLI [edit]
中。
set protocols rstp interface ge-0/0/30 disable set protocols rstp interface ge-0/0/20 disable set protocols protection-group ethernet-ring erp1 set protocols protection-group ethernet-ring erp1 data-channel erp-data-1 set protocols protection-group ethernet-ring erp1 data-channel erp-data-2 set protocols protection-group ethernet-ring erp1 control-vlan erp-control-vlan-1 set protocols protection-group ethernet-ring erp1 east-interface control-channel ge-0/0/30.0 set protocols protection-group ethernet-ring erp1 west-interface control-channel ge-0/0/20.0
分步过程
要在 Jas6-esc 上配置 ERPS,请执行以下操作:
禁用 ERPS 接口上配置的任何生成树协议。RSTP 在默认配置中处于启用状态,因此此示例显示如何禁用 RSTP:
[edit protocols] user@switch# set rstp interface ge-0/0/30 disable user@switch# set rstp interface ge-0/0/20 disable
创建名为 erp1 的节点环:
[edit protocols] user@switch# set protection-group ethernet-ring erp1
为节点环 erp1 配置控制 VLAN erp-control-vlan-1:
[edit protocols protection-group ethernet-ring erp1] user@switch# set control-vlan erp-control-vlan-1
配置名为 erp-data-1 和 erp-data-2 的两个数据通道,以定义一组属于环形实例的 VLAN ID。
[edit protocols protection-group ethernet-ring erp1] user@switch# set data-channel erp-data-1 user@switch# set data-channel erp-data-2
使用控制通道 ge-0/0/30.0 配置节点环 erp1 的东接口:
[edit protocols protection-group ethernet-ring erp1] user@switch# set east-interface control-channel ge-0/0/30.0
使用控制通道 ge-0/0/20.0 配置节点环 erp1 的西部接口:
[edit protocols protection-group ethernet-ring erp1] user@switch# set west-interface control-channel ge-0/0/20.0
结果
在配置模式下,通过输入 show protocols
命令检查您的 ERPS 配置。如果输出未显示预期的配置,请重复此示例中的配置说明,以便进行更正。
[edit] user@switch# show protocols rstp { interface ge-0/0/20.0 { disable; } interface ge-0/0/30.0 { disable; } } protection-group { ethernet-ring erp1 { east-interface { control-channel { ge-0/0/30.0; } } west-interface { control-channel { ge-0/0/20.0; } } control-vlan erp-control-vlan-1; data-channel { vlan [ 101-102 ]; } } }
在配置模式下,输入命令检查 show vlans
您的 VLAN 配置。如果输出未显示预期的配置,请重复此示例中的配置说明,以便进行更正。
[edit] user@switch# show vlans erp-control-vlan-1 { vlan-id 100; interface { ge-0/0/30.0; ge-0/0/20.0; } } erp-data-1 { vlan-id 101; interface { ge-0/0/0.0; ge-0/0/30.0; ge-0/0/20.0; } } erp-data-2 { vlan-id 102; interface { ge-0/0/0.0; ge-0/0/30.0; ge-0/0/20.0; } }
在配置模式下,输入命令检查 show interfaces
接口配置。如果输出未显示预期的配置,请重复此示例中的配置说明,以便进行更正。
[edit] user@switch# show interfaces ge-0/0/0 { unit 0 { family ethernet-switching { port-mode trunk; } } } ge-0/0/20 { unit 0 { family ethernet-switching { port-mode trunk; } } } ge-0/0/30 { unit 0 { family ethernet-switching { port-mode trunk; } } }
验证
验证 ERP 是否正常工作。
验证 ERP 是否正常工作
目的
验证 ERPS 是否在充当环形拓扑中节点的四台 EX 交换机上工作。
操作
检查命令输出 show protection-group ethernet-ring interface
中环形链路的状态。当环已配置但未被使用(数据链路上不存在错误)时,一个 ERP 接口正在转发流量,另一个接口正在丢弃流量。丢弃会阻止环。
user@switch> show protection-group ethernet-ring interface
Ethernet ring port parameters for protection group erp1
Interface Forward State RPL End Signal Failure Admin State
ge-0/0/2.0 discarding yes clear ready
ge-0/0/0.0 forwarding no clear ready
要了解自上次重新启动以来发生的情况,请检查环形阻塞事件的 RPS 统计信息。 NR
是无请求环形块,这意味着交换机未阻塞两个 ERP 接口中的任何一个。 NR-RB
是“无请求环被阻止”事件,这意味着交换机正在阻止其其中一个 ERP 接口,并发送数据包以通知其他交换机。
user@switch> show protection-group ethernet-ring statistics
Ring Name Local SF Remote SF NR Event NR-RB Event
erp1 2 1 2 3
意义
show protection-group ethernet-ring interface RPL 所有者节点的命令输出指示一个接口正在转发流量,另一个接口正在丢弃流量,这意味着 ERP 已准备就绪但未处于活动状态。如果环中至少有一个接口未转发,则该环将被阻塞,因此 ERP 正在工作。
show protection-group ethernet-ring statistics命令输出指示,自上次重新启动以来,本地和远程信号都发生了故障(Local SF
和 Remote SF
)。
计数 NR Event
为 2,表示 NR 状态已输入两次。 NR
代表 无请求。这意味着交换机要么发起 NR PDU,要么从另一台交换机接收 NR PDU,并停止阻塞接口以允许 ERP 运行。
这三个 NR-RB
事件表明,有三次,此交换机要么发出 NR-RB PDU,要么从另一台交换机接收 NR-RB PDU。当网络问题得到解决并且交换机再次阻止一端的 ERP 链路时,会发生这种情况。