示例:在 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,因此在这两台交换机上进行 ERPS 的操作会通过以下方式偏离 ERPV1 ITU 标准:
EX2300 和 EX3400 交换机上的等待还原 (WTR) 配置值必须为 5-12 分钟。
由于 ERPSv1 不支持,因此始终在 EX2300 和 EX3400 交换机上禁用等待阻止计时器 (WTB)。对 WTB 设置进行的任何配置都无效。CLI 命令的输出“显示保护组以太网环节点状态详细信息”列出了一个 WTB 设置,但该设置无效。
在 EX2300 和 EX3400 交换机上初始状态机初始化期间,两个 ERPV1 环端口均会移至非 RPL 节点上的丢弃状态。
在 EX2300 和 EX3400 交换机上的 ERPV1 初始状态机初始化期间,自动保护交换 (APS) 状态将移至非 RPL 交换机上的空闲状态
不支持增强型第 2 层软件 (ELS) 配置样式的 Junos OS 12.1 或更高版本。
开始之前,确保您已经:
在四台交换机上分别配置了两个中继接口。有关此示例中使用的接口名称列表,请参阅 表 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 时,将发生提交错误。通过在交换机中配置的 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/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]
。
不能在环形端口上配置生成树协议和 ERPS。由于 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
逐步过程
要配置 Cobia 上的 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
逐步过程
要配置“发尾”上的 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,请复制以下命令,将其粘贴到文本文件中,删除所有换行符,更改详细信息,以便与网络配置匹配,然后将命令复制并粘贴到层级的 [edit]
CLI 中。
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; } } }
验证
验证 ERPS 是否正常运行。
验证 ERPS 是否正常运行
目的
验证 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 链路时,就会发生这种情况。