question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Telnet (cisco_ios_telnet) via SOCKS5 proxy timing out

See original GitHub issue

Trying to Telnet to a Cisco switch via a SOCKS5 proxy, the connection always times out.

Code used to connect:

sock_proxy_telnet = socks.socksocket()
sock_proxy_telnet.set_proxy(
	proxy_type=socks.SOCKS5,
	addr="192.160.1.50",
	port=1080
)
sock_proxy_telnet.connect(('192.168.140.10', 23))
net_connect = ConnectHandler(
	host='192.168.140.10',
	device_type="cisco_ios_telnet",  # Use Telnet instead.
	username='my_username',
	password='my_password',
	fast_cli=False,
	sock=sock_proxy_telnet
)
show_version = net_connect.send_command('sh ver')

It sits on the ConnectHandler and times out, error:

[WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond

I’ve confirmed that the socket is connecting via sock_proxy_telnet.recv(1000) (shows the login banner).

The above code works fine if I use port 22 on the .connect and cisco_ios on the device type. I tried to debug it, but the global logging method doesn’t generate any logs.

I can use PuTTy to connect via the SOCKS5 proxy and Telnet, so I think this is specific to how Netmiko handles the socket and Telnet.

Any help would be greatly appreciated.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
krzysztoflawpplcommented, Dec 31, 2021

Hi Kirk, It worked like a charm! Great stuff! Best regards and Happy New Year!

Krzysztof

0reactions
ktbyerscommented, Aug 20, 2022

Probably not going to fix this. So I am closing this issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

C# Telnet Proxy - Stack Overflow
I am working on developing an extensible MUD/ORPG game server framework in C#. As part of the package, I would like to include...
Read more >
Client SOCKS support - IBM
The following figure shows a common firewall arrangement with an HTTP proxy, a telnet proxy, and a SOCKS proxy on the firewall. Notice...
Read more >
How to telnet via proxy authentication? - Unix Stack Exchange
You could do what the browser does, i.e. connect to the proxy, $ telnet proxy-server 3128. and talk to it. If there was...
Read more >
Cisco IOS Telnet Server and Client - NetworkLessons.com
This lesson explains how to configure the Telnet server on your Cisco IOS router or switch and how to use the telnet client...
Read more >
Telnet over ipv4 proxy to ipv6 host - Server Fault
I have a dante socks server which is configured to listen in an ipv4 IP and to have an ipv6 external IP. I...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found