cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
239
Views
0
Helpful
3
Replies

Connection issues when using python to connect from linux to a switch

pravinraj66
Level 1
Level 1

My setup :

My windows laptop -> Linux (jump host) -> Cisco switch

I have the above setup and I'm trying to connect from my laptop to cisco switch using python, I have used redispatch function in netmiko, that has some real issues.

Do we have any other way to connect?

3 Replies 3

Ruben Cocheno
Spotlight
Spotlight

@pravinraj66 

You can use SSH Tunneling, check here

https://www.ssh.com/academy/ssh/tunneling-example

Tag me to follow up.
Please mark it as Helpful and/or Solution Accepted if that is the case. Thanks for making Engineering easy again.
Connect with me for more on Linkedin https://www.linkedin.com/in/rubencocheno/

pravinraj66
Level 1
Level 1

Hi @Ruben Cocheno , I'm trying to achieve this in Python, I'm unable to do so.

Torbjørn
Spotlight
Spotlight

You can port forward port 22 of your switch to your localhost through your jumphost:

    ssh -L 127.0.0.1:22:{your Cisco switch}:22 {your Jumphost}

Then you can connect with python to 127.0.0.1:22

Happy to help! Please mark as helpful/solution if applicable.
Get in touch: https://torbjorn.dev
Review Cisco Networking for a $25 gift card