# Unable to connect to Cisco IOS devices using network\_cli - socket is closed error

**URL:** <https://forum.ansible.com/t/unable-to-connect-to-cisco-ios-devices-using-network-cli-socket-is-closed-error/28335>\
**Category:** Ansible Project\
**Tags:** rhel\
**Created:** [August 15, 2018, 3:12pm UTC](https://forum.ansible.com/t/unable-to-connect-to-cisco-ios-devices-using-network-cli-socket-is-closed-error/28335 "2018-08-15T15:12:00Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Caleb\_Guerrero](https://avatars.discourse-cdn.com/v4/letter/c/ea666f/32.png) [@Caleb\_Guerrero](https://forum.ansible.com/u/Caleb_Guerrero)\
**Post date:** [August 15, 2018, 3:12pm UTC](https://forum.ansible.com/t/unable-to-connect-to-cisco-ios-devices-using-network-cli-socket-is-closed-error/28335/1 "2018-08-15T15:12:00Z")

</div>

Hello,  
I have been attempting to connect to various Cisco IOS devices in our dev environment with no luck using the network\_cli connection method. I can communicate with all devices when running _‘ansible ios -m ping’_ and setting the connection method to _‘ansible\_connection: local’;_ however I cannot ping them when using the _‘ansible\_connection: network\_cli.’_ When using the network\_cli connection method I get a socket error stating “socket is closed.” I can ssh manually to all of my cisco ios devices also. More information on release and ansible.cfg can be seen below:

Ansible version - 2.5.2  
RHEL release - 7.5

ansible.cfg:  
[defaults]  
inventory = inventory/dev/

host\_key\_checking = False  
roles\_path = ~/.ansible/roles:roles/  
log\_path = /home/cjguerrero/ansible/Ansible-NIS/ansible.log

[paramiko conneciton]

[ssh connection]

[persistent connection]  
connect\_timeout = 60  
command\_timeout = 30

One thing that is interesting in the debug logs is that I can see the login banner for the cisco device; however it never retrieves the config and ultimately ends with an error… Any guidance would be greatly appreciated!

Thanks,

Caleb
