cisco.ios.ios_ping (8.0.0) — module

Tests reachability using ping from IOS switch.

| "added in version" 1.0.0 of cisco.ios"

Authors: Jacob McGill (@jmcgill298), Sagar Paul (@KB-perByte)

Install collection

Install with ansible-galaxy collection install cisco.ios:==8.0.0


Add to requirements.yml

  collections:
    - name: cisco.ios
      version: 8.0.0

Description

Tests reachability using ping from switch to a remote destination.

For a general purpose network module, see the L(net_ping,https://docs.ansible.com/ansible/latest/collections/ansible/netcommon/net_ping_module.html) module.

For Windows targets, use the L(win_ping,https://docs.ansible.com/ansible/latest/collections/ansible/windows/win_ping_module.html) module instead.

For targets running Python, use the L(ping,https://docs.ansible.com/ansible/latest/collections/ansible/builtin/ping_module.html) module instead.

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Test reachability to 198.51.100.251 using default vrf
  cisco.ios.ios_ping:
    dest: 198.51.100.251
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Test reachability to 198.51.100.252 using prod vrf
  cisco.ios.ios_ping:
    dest: 198.51.100.252
    vrf: prod
    afi: ip
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Test un reachability to 198.51.100.253 using default vrf
  cisco.ios.ios_ping:
    dest: 198.51.100.253
    state: absent
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Test reachability to 198.51.100.250 using prod vrf and setting count and source
  cisco.ios.ios_ping:
    dest: 198.51.100.250
    source: loopback0
    vrf: prod
    count: 20
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Test reachability to 198.51.100.249 using df-bit and size
  cisco.ios.ios_ping:
    dest: 198.51.100.249
    df_bit: true
    size: 1400
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Test reachability to ipv6 address
  cisco.ios.ios_ping:
    dest: 2001:db8:ffff:ffff:ffff:ffff:ffff:ffff
    afi: ipv6

Inputs

    
afi:
    choices:
    - ip
    - ipv6
    default: ip
    description:
    - Define echo type ip or ipv6.
    type: str

vrf:
    description:
    - The VRF to use for forwarding.
    type: str

dest:
    description:
    - The IP Address or hostname (resolvable by switch) of the remote node.
    required: true
    type: str

size:
    description:
    - Size of the packet to send.
    type: int

count:
    description:
    - Number of packets to send.
    type: int

state:
    choices:
    - absent
    - present
    default: present
    description:
    - Determines if the expected result is success or fail.
    type: str

df_bit:
    default: false
    description:
    - Set the DF bit.
    type: bool

egress:
    description:
    - Force egress interface bypassing routing.
    type: str

source:
    description:
    - The source IP Address.
    type: str

ingress:
    description:
    - LAN source interface for Ingress.
    type: str

timeout:
    description:
    - specify timeout interval.
    type: int

Outputs

commands:
  description: Show the command sent.
  returned: always
  sample:
  - ping vrf prod 198.51.100.251 count 20 source loopback0
  type: list
packet_loss:
  description: Percentage of packets lost.
  returned: always
  sample: 0%
  type: str
packets_rx:
  description: Packets successfully received.
  returned: always
  sample: 20
  type: int
packets_tx:
  description: Packets successfully transmitted.
  returned: always
  sample: 20
  type: int
rtt:
  description: Show RTT stats.
  returned: always
  sample:
    avg: 2
    max: 8
    min: 1
  type: dict