# How can I configure a Cisco device through a console server?

**URL:** <https://forum.ansible.com/t/how-can-i-configure-a-cisco-device-through-a-console-server/43575>\
**Category:** Get Help\
**Created:** [June 26, 2025, 4:10pm UTC](https://forum.ansible.com/t/how-can-i-configure-a-cisco-device-through-a-console-server/43575 "2025-06-26T16:10:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dogscraw](https://avatars.discourse-cdn.com/v4/letter/d/f17d59/32.png) [@dogscraw](https://forum.ansible.com/u/dogscraw)\
**Post date:** [June 26, 2025, 4:10pm UTC](https://forum.ansible.com/t/how-can-i-configure-a-cisco-device-through-a-console-server/43575/1 "2025-06-26T16:10:00Z")

</div>

I have a console server, **console1** , and I can use that to ssh into any device connected to the console server using this command: `ssh console1 -p 300X`. So for example, if I want to connect to my Cisco router I would use `ssh console1 -p 3003`. Here are a few of the host configs I have tried for the router:

> [router]  
> rtr1 ansible\_user=user ansible\_password=pass
> 
> [router:vars]  
> ansible=console1  
> ansible\_port=3003  
> ansible\_network\_os=ios  
> ansible\_connection=network\_cli  
> ansible\_become=true  
> ansible\_become\_method=enable  
> ansible\_become\_password=pass
> 
> ############################## **OR** #############################
> 
> [router]  
> rtr1 ansible\_user=user ansible\_password=pass
> 
> [router:vars]  
> ansible\_network\_os=ios  
> ansible\_connection=network\_cli  
> ansible\_become=true  
> ansible\_become\_method=enable  
> ansible\_become\_password=pass  
> ansible\_ssh\_common\_args=‘-p 3003 -J console1’

What am I doing wrong with this config? I know the playbook works because I am able to successfully run and change things on the router when the interface on the Cisco router is setup correctly. However, I think this means Ansible is using console1 to ssh into the Cisco router instead of using the console server to connect to the Cisco router. I need it to be able to configure a Cisco router with default settings and the only connection interface being the console server. Any help would be appreciated!

---

<div class="post-metadata">

**Author:** ![sparky](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/sparky/32/7086_2.png) [@sparky](https://forum.ansible.com/u/sparky)\
**Post date:** [March 30, 2026, 5:43pm UTC](https://forum.ansible.com/t/how-can-i-configure-a-cisco-device-through-a-console-server/43575/2 "2026-03-30T17:43:09Z")

</div>

I was able to get this to work by modifying these variables:  
ansible\_terminal\_initial\_answer: " "  
ansible\_terminal\_initial\_prompt: “Console server prompt.\*”
