示例:在 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 使用 ERPV2 状态机来支持 ERPV1 ,因此在这两台交换机上运行 ERPS 会在以下方面偏离 ERPV1 ITU 标准:
-
等待恢复 (WTR) 配置值必须为 5-12 分钟。
-
等待阻止计时器 (WTB) 始终处于禁用状态,因为它在 ERPSv1 中不受支持。对 WTB 设置所做的任何配置均无效。CLI 命令“show protection-group ethernet-ring node-state detail”的输出列出了 WTB 设置,但该设置不起作用。
-
在初始状态机初始化期间,两个 ERPV1 环形端口都会在非 RPL 节点上移至丢弃状态。
-
在 ERPV1 初始状态机初始化期间,非 RPL 交换机上的自动保护切换 (APS) 状态将变为空闲状态
-
开始之前,确保您具备以下条件:
在四台交换机上的每台交换机上配置了两个中继接口。有关此示例中使用的接口名称的列表,请参阅 表 1 。
在所有四台交换机上配置 ID 为 100 的相同 VLAN (
erp-control-vlan-1),并将四台交换机中每台交换机的两个网络接口与 VLAN 相关联。请参阅 为 EX 系列交换机配置 VLAN。有关此示例中使用的接口名称的列表,请参阅 表 1 。在所有四台交换机上配置了两个 VLAN (
erp-data-1和erp-data-2),其 ID 分别为 101 和 102,并将每个交换机上的东西接口都与 和erp-data-2相erp-data-1关联。有关此示例中使用的接口名称的列表,请参阅表 1。注意:当设备的 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,请复制以下命令,将其粘贴到文本文件中,删除所有换行符,更改详细信息,以便与网络配置匹配,然后将命令复制并粘贴到层次结构级别的 [edit] CLI 中。
生成树协议和 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,请复制以下命令,将其粘贴到文本文件中,删除所有换行符,更改任何必要的详细信息以匹配您的网络配置,然后将命令复制并粘贴到层次结构级别的 [edit] CLI 中。
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 配置模式。
在 Hairtail 上配置 ERPS
CLI 快速配置
要快速配置 Hairtail,请复制以下命令,将其粘贴到文本文件中,删除所有换行符,更改任何必要的详细信息以匹配您的网络配置,然后将命令复制并粘贴到层次结构级别的 [edit] CLI 中。
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,请复制以下命令,将其粘贴到文本文件中,删除所有换行符,更改任何必要的详细信息以匹配您的网络配置,然后将命令复制并粘贴到层次结构级别的 [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 接口正在转发流量,另一个 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
要了解自上次重启以来发生的情况,请检查冗余电源系统统计信息中是否有环阻塞事件。 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 链路时,就会发生这种情况。