# Cant SSH / PING to Network Devices

**URL:** <https://forum.ansible.com/t/cant-ssh-ping-to-network-devices/31860>\
**Category:** Ansible Developer\
**Created:** [December 21, 2019, 2:51pm UTC](https://forum.ansible.com/t/cant-ssh-ping-to-network-devices/31860 "2019-12-21T14:51:57Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nirmal\_Gauda](https://avatars.discourse-cdn.com/v4/letter/n/bbce88/32.png) [@Nirmal\_Gauda](https://forum.ansible.com/u/Nirmal_Gauda)\
**Post date:** [December 21, 2019, 2:51pm UTC](https://forum.ansible.com/t/cant-ssh-ping-to-network-devices/31860/1 "2019-12-21T14:51:57Z")

</div>

I am Newbie to Ansible , writing my first playbook.

I can not SSH / PING to network Devices.

`leaf-1 | UNREACHABLE! => { "changed": false, "msg": "Authentication failure.", "unreachable": true } leaf-2 | UNREACHABLE! => { "changed": false, "msg": "Authentication failure.", "unreachable": true }`

i can PING / SSH to network devices from Ansible server but when i run th playbook , it fails.

No idea if i have to add something in playbook or ansible.cfg . Any Suggestion please ?

---

<div class="post-metadata">

**Author:** ![Pranav\_Aggarwal](https://avatars.discourse-cdn.com/v4/letter/p/ce7236/32.png) [@Pranav\_Aggarwal](https://forum.ansible.com/u/Pranav_Aggarwal)\
**Post date:** [December 21, 2019, 8:25pm UTC](https://forum.ansible.com/t/cant-ssh-ping-to-network-devices/31860/2 "2019-12-21T20:25:35Z")

</div>

You can try to debug the output

---

<div class="post-metadata">

**Author:** ![john.westcott.iv](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/john.westcott.iv/32/95_2.png) [@john.westcott.iv](https://forum.ansible.com/u/john.westcott.iv)\
**Post date:** [January 10, 2020, 1:40pm UTC](https://forum.ansible.com/t/cant-ssh-ping-to-network-devices/31860/3 "2020-01-10T13:40:00Z")

</div>

Based on the output it appears that Ansible is able to reach the device just not able to authenticate.

I say that because you get the line:

> > “msg”: “Authentication failure.”,

Where as if Ansible was unable to reach the device at all I would expect something like this:

**“msg”: “Failed to connect to the host via ssh: ssh: connect to host 10.0.1.45 port 22: Operation timed out”,**

Do you have all of your connection variables for the networking device properly set?

For details, see [https://docs.ansible.com/ansible/latest/network/user\_guide/network\_best\_practices\_2.5.html#common-inventory-variables](https://docs.ansible.com/ansible/latest/network/user_guide/network_best_practices_2.5.html#common-inventory-variables)

If you need further help please send more info about how your inventory is setup and the commands you are using.

-John
