1. 组网需求
· 通过在Device A和Device B上配置以太网OAM功能,实现二者之间链路连通性故障的自动检测;
· 通过观察Device A上收到错误帧的情况,来检测Device A与Device B之间的链路性能。
2. 组网图
图1 以太网OAM典型配置组网图
3. 配置步骤
(1) 配置Device A
# 在端口GigabitEthernet1/0/1上配置以太网OAM的连接模式为被动模式,并使能以太网OAM功能。
<DeviceA> system-view
[DeviceA] interface gigabitethernet 1/0/1
[DeviceA-GigabitEthernet1/0/1] oam mode passive
[DeviceA-GigabitEthernet1/0/1] oam enable
[DeviceA-GigabitEthernet1/0/1] quit
# 配置错误帧事件的检测周期为20秒,检测阈值为10。
[DeviceA] oam errored-frame period 20
[DeviceA] oam errored-frame threshold 10
(2) 配置Device B
# 在端口GigabitEthernet1/0/1上配置以太网OAM的连接模式为主动模式,并使能以太网OAM功能。
<DeviceB> system-view
[DeviceB] interface gigabitethernet 1/0/1
[DeviceA-GigabitEthernet1/0/1] oam mode active
[DeviceB-GigabitEthernet1/0/1] oam enable
[DeviceB-GigabitEthernet1/0/1] quit
(3) 检验配置效果
通过使用display oam configuration命令可以查看以太网OAM的配置信息,例如:
# 查看Device A上以太网OAM的配置信息。
[DeviceA] display oam configuration
Configuration of the link event window/threshold :
--------------------------------------------------------------------------
Errored-symbol Event period(in seconds) : 1
Errored-symbol Event threshold : 1
Errored-frame Event period(in seconds) : 20
Errored-frame Event threshold : 10
Errored-frame-period Event period(in ms) : 1000
Errored-frame-period Event threshold : 1
Errored-frame-seconds Event period(in seconds) : 60
Errored-frame-seconds Event threshold : 1
Configuration of the timer :
--------------------------------------------------------------------------
Hello timer(in ms) : 1000
Keepalive timer(in ms) : 5000
以上显示信息表明:除错误帧事件的检测周期为20秒、检测阈值为10以外,其余参数都为缺省值。
通过使用display oam critical-event命令可以查看以太网OAM的紧急链路事件统计信息,例如:
# 查看Device A所有端口上以太网OAM的紧急链路事件统计信息。
[DeviceA] display oam critical-event
Port : GigabitEthernet1/0/1
Link Status : Up
Event statistic :
-------------------------------------------------------------------------
Link Fault :0 Dying Gasp : 0 Critical Event : 0
以上显示信息表明:Device A与Device B之间的链路上尚未发生过任何紧急链路事件。
通过使用display oam link-event命令可以查看以太网OAM的一般链路事件统计信息,例如:
# 查看Device B所有端口上以太网OAM的一般链路事件的远端统计信息。
[DeviceB] display oam link-event remote
Port :GigabitEthernet1/0/1
Link Status :Up
OAMRemoteErrFrameEvent : (ms = milliseconds)
---------------------------------------------------------------------
Event Time Stamp : 5789 Errored Frame Window : 10(100ms)
Errored Frame Threshold : 1 Errored Frame : 3
Error Running Total : 35 Event Running Total : 17
以上显示信息表明:从Device A开始运行时起,总共发生了35次错误,其中错误帧事件有17次,链路性能并不稳定。