配置TCP测试示例
操作步骤
- 按图7-25配置各接口的IP地址并配置Router之间路由可达
<Huawei> system-view
[Huawei] sysname RouterA
[RouterA] interface gigabitethernet 1/0/0
[RouterA-GigabitEthernet1/0/0] ip address 10.1.1.1 24
[RouterA-GigabitEthernet1/0/0] quit
[RouterA] ip route-static 10.2.1.0 255.255.255.0 10.1.1.2
RouterB和RouterC的配置请参考配置文件。
- 在RouterC上配置NQA服务器
# 配置NQA服务器TCP连接侦听的IP地址和端口号。
<RouterC> system-view
[RouterC] nqa-server tcpconnect 10.2.1.2 9000
- 在RouterA配置NQA客户端
# 使能NQA客户端,配置TCP类型的测试例。
[RouterA] nqa test-instance admin tcp
[RouterA-nqa-admin-tcp] test-type tcp
[RouterA-nqa-admin-tcp] destination-address ipv4 10.2.1.2
[RouterA-nqa-admin-tcp] destination-port 9000
- 启动测试
[RouterA-nqa-admin-tcp] start now
- 验证配置结果
# 在RouterA上查看NQA测试结果。
[RouterA-nqa-admin-tcp] display nqa results test-instance admin tcp
NQA entry(admin, tcp) :testflag is inactive ,testtype is tcp 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 Status errors number:0 Destination ip address:10.2.1.2 Min/Max/Average Completion Time: 46/63/52 Sum/Square-Sum Completion Time: 156/8294 Last Good Probe Time: 2012-7-25 16:23:49.1 Lost packet ratio: 0 %
配置文件
RouterA的配置文件
# sysname RouterA # interface GigabitEthernet1/0/0 ip address 10.1.1.1 255.255.255.0 # ip route-static 10.2.1.0 255.255.255.0 10.1.1.2 # nqa test-instance admin tcp test-type tcp destination-address ipv4 10.2.1.2 destination-port 9000 # return
RouterB的配置文件
# sysname RouterB # interface GigabitEthernet1/0/0 ip address 10.1.1.2 255.255.255.0 # interface GigabitEthernet2/0/0 ip address 10.2.1.1 255.255.255.0 # return
RouterC的配置文件
# sysname RouterC # interface GigabitEthernet1/0/0 ip address 10.2.1.2 255.255.255.0 # nqa-server tcpconnect 10.2.1.2 9000 # ip route-static 10.1.1.0 255.255.255.0 10.2.1.1 # return