> ## Documentation Index
> Fetch the complete documentation index at: https://doc.lwops.cn/llms.txt
> Use this file to discover all available pages before exploring further.

# 11.4 华为NOA配置及链路监控

## **1**.**1配置ICMP测试举例**

设备作为NQA客户端，测试到对端设备是否可达。

### **1.1.1组网需求**

FW作为NQA客户端，测试NQA Server是否可达。

### **1**.1.2参数详解

可选：根据需要，配置ICMP测试其他参数。

|项目 |命令 |说明 | |:--| |配置测试例描述 |**description** *description-information* |- | |配置所测试的VPN实例 |**vpn-instance** *vpn-instance-name* |- | |配置发送测试报文的出接口 |**source-interface** \[ *interface-type interface-number* ] |缺省情况下，FW通过查找路由表来确认报文的出接口。<br />到测试的目的地址存在多条路径时，可以通过指定源接口，让测试报文从指定路径转发。 | |配置测试报文的源地址 |**source-address ipv4** *ip-address* |缺省情况下，未配置测试报文的源IP地址，以报文发送接口的主IP地址作为测试报文的源IP地址。<br />指定的源IP地址必须是FW上接口的IP地址，且接口为up状态，否则测试会失败。 | |配置测试报文载荷的大小 |**datasize** *size* |缺省情况下，载荷大小为20字节。<br />当 **datasize** 小于20时，FW依然按照20字节来构造报文的载荷；当 **datasize** 大于20时，FW按照 **datasize** 的配置来构造报文的载荷。 | |配置测试报文载荷的填充字符 |**datafill** *string* |缺省情况下，FW用固定字段填充载荷。<br />**datafill** 配置的字符串是从载荷的第29个字节开始循环填充。也就是说，当 **datasize** 大于28时， **datafill** 的配置才会生效。 | |配置测试报文的TTL值 |**ttl** *value* |缺省情况下，TTL值为30。 | |配置测试报文的ToS值 |**tos** *value* |缺省情况下，ToS值为0。 | |配置测试报文的发送间隔 |**interval** \{ **seconds** *interval* | **milliseconds** *interval* } |缺省情况下，ICMP测试的报文发送间隔为4s。 | |配置单次测试的发包个数 |**probe-count** *number* |缺省情况下，ICMP测试的单次测试发包个数为3。 | |配置测试的时间间隔 |**frequency** *interval* |缺省情况下，未配置测试时间间隔，即只进行一次测试。 | |配置测试的失败百分比 |**fail-percent** *percent* |缺省情况下，测试失败百分比为100%，即只有全部探测失败，才认为本次测试失败。 | |配置单次探测的超时时间 |**timeout** *time* |缺省情况下，ICMP测试的单次探测超时时间为3s。 | |配置最大历史记录数目 |**records** **history** *number* |缺省情况下，最大历史记录数目是50。 | |配置最大测试结果记录数目 |**records** **result** *number* |缺省情况下，最大测试结果记录数目是5。 | |配置测试例的老化时间 |**agetime** *hh* : *mm* : *ss* |缺省情况下，测试例老化时间为0，即永不老化。 | |配置头节点强制走IP转发 |**ip-forwarding** |缺省情况下，MPLS网络中的报文通过MPLS进行转发。 | |配置测试报文的下一跳地址 |**nexthop** **ipv4** *ip-address* |缺省情况下，FW查找路由表获取下一跳地址。 | |配置不查找路由表发送测试报文 |**sendpacket passroute** |缺省情况下，FW查找路由表转发测试报文。 |

### **2**.1.3操作步骤

配置ICMP类型的NQA测试例。

```plain theme={null}
[FW] nqa test-instance admin icmp
[FW-nqa-admin-icmp] test-type icmp
[FW-nqa-admin-icmp] destination-address ipv4 2.2.2.2
[FW-nqa-admin-icmp] source-address ipv4 2.2.2.1
[FW-nqa-admin-icmp] frequency 60
```

立即启动测试。

```plain theme={null}
[FW-nqa-admin-icmp] start now
```

### **2**.1.4结果验证

执行 display nqa results 命令查看测试结果。

```plain theme={null}
 display nqa results
NQA entry(admin, icmp) :testFlag is inactive ,testtype is icmp
1 . Test 1 result   The test is finished
Send operation times: 3               Receive response times: 3
Completion:success                    RTD OverThresholds number: 0
Attempts number:1                     Drop operation number:0
Disconnect operation number:0         Operation timeout number:0
System busy operation number:0        Connection fail number:0
Operation sequence errors number:0    RTT Stats errors number:0
Destination ip address:2.2.2.2
Min/Max/Average Completion Time: 31/46/36
Sum/Square-Sum  Completion Time: 108/4038
Last Good Probe Time: 2015-8-2 10:7:11.4
Last Packet Loss 0 %
```

执行 display nqa history 命令查看多次历史结果。

```plain theme={null}
 display nqa history
NQA entry(666, 6) history:
Index T/H/P       Response Status       Address         Time
1    1/1/1           40ms success      192.168.1.102   2008-02-07 17:21:37.150
2    1/1/2          140ms success      192.168.1.102   2008-02-07 17:21:40.660
3    1/1/3          460ms success      192.168.1.102   2008-02-07 17:21:45.020
4    2/1/1           30ms success      192.168.1.102   2008-02-07 17:22:36.750
5    2/1/2          180ms success      192.168.1.102   2008-02-07 17:22:40.900
6    2/1/3           50ms success      192.168.1.102   2008-02-07 17:22:44.780
7    3/1/1           70ms success      192.168.1.102   2008-02-07 17:23:36.910
8    3/1/2           70ms success      192.168.1.102   2008-02-07 17:23:40.870
9    3/1/3          100ms success      192.168.1.102   2008-02-07 17:23:44.930
10   4/1/1         3000ms timeout      192.168.1.102   2008-02-07 17:24:40.080
11   4/1/2         3000ms timeout      192.168.1.102   2008-02-07 17:24:44.070
12   4/1/3          250ms success      192.168.1.102   2008-02-07 17:24:45.370
13   5/1/1          130ms success      192.168.1.102   2008-02-07 17:25:37.300
14   5/1/2           90ms success      192.168.1.102   2008-02-07 17:25:41.260
15   5/1/3          130ms success      192.168.1.102   2008-02-07 17:25:45.330
```

### **2**.1.5配置脚本

```plain theme={null}
nqa test-instance admin icmp
test-type icmp
destination-address ipv4 2.2.2.2
source-address ipv4 2.2.2.1
frequency 60

start now /*该命令为一次性操作，不保存在配置文件中*/
```
