This section describes how to run the ping command using the rpc method.
Operation |
XPATH |
---|---|
rpc |
|
Item |
Data |
Description |
---|---|---|
Instance name of the ping command |
test1 |
Set the instance name of the ping command to test1. |
Destination host |
192.168.10.1 |
Set the IPv4 address of the destination host to 192.168.10.1. |
Source IPv4 address of ICMP request packets |
192.168.50.1 |
Set the source IPv4 address of ICMP request packets to 192.168.50.1. |
Number of ICMP request packets to be sent |
30 |
Set the number of ICMP request packets to 30. |
Interval at which ICMP request packets are sent |
600 |
Set the interval at which ICMP request packets are sent to 600 milliseconds. |
Timeout interval for ICMP response packets |
1800 |
Set the timeout interval for ICMP response packets is 1800 milliseconds. |
Length of ICMP request packets excluding the IPv4 and ICMP headers |
100 |
Set the length of ICMP request packets to 100 bytes. |
TTL value of ICMP request packets |
200 |
Set the TTL value of ICMP request packets to 200. |
ToS value of ICMP request packets |
100 |
Set the ToS value of ICMP request packets to 100. |
Pad characters for ICMP request packets |
1122aaee |
Set the pad characters for ICMP request packets to 1122aaee. |
Whether fragmentation is allowed in packet sending |
true |
Do not allow fragmentation in packet sending. |
<?xml version="1.0" encoding="UTF-8"?> <rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="1"> <hw-ping:ping xmlns:hw-ping="urn:huawei:params:xml:ns:yang:huawei-ping"> <hw-ping:test-name>test1</hw-ping:test-name> <hw-ping:ipv4-ping> <hw-ping:destination>192.168.10.1</hw-ping:destination> <hw-ping:source-ip-address>192.168.50.1</hw-ping:source-ip-address> <hw-ping:count>30</hw-ping:count> <hw-ping:interval>600</hw-ping:interval> <hw-ping:timeout>1800</hw-ping:timeout> <hw-ping:packet-size>100</hw-ping:packet-size> <hw-ping:ttl>200</hw-ping:ttl> <hw-ping:tos>100</hw-ping:tos> <hw-ping:pattern>1122aaee</hw-ping:pattern> <hw-ping:do-not-frag>true</hw-ping:do-not-frag> </hw-ping:ipv4-ping> </hw-ping:ping> </rpc>
<?xml version='1.0' encoding='UTF-8'?> <rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="1"> <ok/> </rpc-reply>
<?xml version='1.0' encoding='UTF-8'?> <rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="1"> <error/> </rpc-reply>
# The switch reports the execution result of the ping command to the controller through a notification message.
<notification xmlns="urn:ietf:params:xml:ns:netconf:notification:1.0"> <eventTime>2017-06-09T16:48:24Z</eventTime> <ping-case-result xmlns="urn:huawei:params:xml:ns:yang:huawei-ping"> <test-name>test1</test-name> <destination>192.168.10.1</destination> <total-count>30</total-count> <success-count>0</success-count> <loss-rate>100.00</loss-rate> <replys> <sequence>1</sequence> <data-byte>0</data-byte> <ttl-or-hoplimit>0</ttl-or-hoplimit> <rtt>0</rtt> <result>timeout</result> </replys> <complete>false</complete> </ping-case-result> </notification>