.. _cisco.iosxr.iosxr_ping_module: ********************** cisco.iosxr.iosxr_ping ********************** **Tests reachability using ping from IOSXR switch.** .. contents:: :local: :depth: 1 Synopsis -------- - Tests reachability using ping from switch to a remote destination. - For a general purpose network module, see the `net_ping `_ module. - For Windows targets, use the `win_ping `_ module instead. - For targets running Python, use the `ping `_ module instead. Parameters ---------- .. raw:: html
Parameter Choices/Defaults Comments
afi
string
    Choices:
  • ipv4 ←
  • ipv6
Define echo type ipv4 or ipv6.
count
integer
Repeat count the number of packets to send.
dest
string / required
The IP Address or hostname (resolvable by switch) of the remote node.
df_bit
boolean
    Choices:
  • no ←
  • yes
Set the DF bit in IP-header.
size
integer
Datagram size the size of packets to send.
source
string
Source address or source interface.
state
string
    Choices:
  • absent
  • present ←
Determines if the expected result is success or fail.
sweep
boolean
    Choices:
  • no ←
  • yes
Sweep ping.
validate
boolean
    Choices:
  • no ←
  • yes
Validate return packet.
vrf
string
The VRF to use for forwarding.

Notes ----- .. note:: - Tested against IOSXR 7.2.2. - This module works with connection ``network_cli``. - For a general purpose network module, see the `net_ping `_ module. - For Windows targets, use the `win_ping `_ module instead. - For targets running Python, use the `ping `_ module instead. Examples -------- .. code-block:: yaml - name: Test reachability to 198.51.100.251 using default vrf cisco.iosxr.iosxr_ping: dest: 198.51.100.251 - name: Test reachability to 198.51.100.252 using prod vrf cisco.iosxr.iosxr_ping: dest: 198.51.100.252 vrf: prod afi: ipv4 - name: Test unreachability to 198.51.100.253 using default vrf cisco.iosxr.iosxr_ping: dest: 198.51.100.253 state: absent - name: Test reachability to 198.51.100.250 using prod vrf and setting count and source cisco.iosxr.iosxr_ping: dest: 198.51.100.250 source: loopback0 vrf: prod count: 20 - name: Test reachability to 198.51.100.249 using df-bit and size cisco.iosxr.iosxr_ping: dest: 198.51.100.249 df_bit: true size: 1400 - name: Test reachability to ipv6 address cisco.iosxr.iosxr_ping: dest: 2001:db8:ffff:ffff:ffff:ffff:ffff:ffff afi: ipv6 Return Values ------------- Common return values are documented `here `_, the following are the fields unique to this module: .. raw:: html
Key Returned Description
commands
list
always
Show the command sent.

Sample:
['ping vrf prod 198.51.100.251 count 20 source loopback0']
packet_loss
string
always
Percentage of packets lost.

Sample:
0%
packets_rx
integer
always
Packets successfully received.

Sample:
20
packets_tx
integer
always
Packets successfully transmitted.

Sample:
20
rtt
dictionary
always
Show RTT stats.

Sample:
{'avg': 2, 'max': 8, 'min': 1}


Status ------ Authors ~~~~~~~ - Sagar Paul (@KB-perByte)