Keep getting ConnectTimeoutError

456 views
Skip to first unread message

Jeroen Valcke

unread,
Jul 8, 2014, 10:34:48 AM7/8/14
to junos-p...@googlegroups.com
I keep getting ConnectTimeoutError
Logging in manually with the same username/password works fine.
I have netconf over ssh configured on this machine.

How can I best troubleshoot this?

Best regards,
-Jeroen-

>>> dev = Device(host='a.b.c.d', user='jeroen', password='password')
>>> dev.open()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/Cellar/python/2.7.6_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/jnpr/junos/device.py", line 414, in open
    raise EzErrors.ConnectTimeoutError(self)
jnpr.junos.exception.ConnectTimeoutError: ConnectTimeoutError(a.b.c.d)

Benjamin Sparks

unread,
Jul 9, 2014, 11:47:36 AM7/9/14
to junos-p...@googlegroups.com
Have you enabled netconf in the security zone host-inbound-traffic?

"set security zones security-zone XXXX interfaces ge-0/0/0.0 host-inbound-traffic system-services netconf"

Ben

Jeroen Valcke

unread,
Jul 11, 2014, 5:49:49 AM7/11/14
to junos-p...@googlegroups.com
Hi Ben,

Thanks for your feedback. It's not an SRX device, so I'm afraid that want help.

-Jeroen-

Jeroen Valcke

unread,
Jul 11, 2014, 6:05:21 AM7/11/14
to junos-p...@googlegroups.com
For anybody else with the same issue.
It was pointed out to me that forcing to connect over port 22 could solve the issue. And indeed it did.

>>> dev = Device(host='a.b.c.d', user='jeroen', password='password', port='22')
>>> dev.open()
Device(a.b.c.d)

-Jeroen-

Rick Sherman

unread,
Jul 11, 2014, 12:58:59 PM7/11/14
to junos-p...@googlegroups.com
Hi Jeroen,

I would still suspect there is still some sort of misconfiguration, as NETCONF by default should be listening on 830.


Using the standard ssh port is not wrong per se, just not standard practice.

-Rick

Mohit Mittal

unread,
May 4, 2017, 7:36:21 AM5/4/17
to Junos Python EZ
I am also getting same error in 2017 :)

and changing it to port 22 worked.

This is my standard script and netconf, ssh is enabled.

from jnpr.junos import Device
dev = Device(host='10.198.123.205',user='labs',password='labs1labs',port='22')
dev.open()
print dev.facts['version']
print dev.cli("show configuration system services")
dev.close()

Stacy Smith

unread,
May 4, 2017, 11:14:05 AM5/4/17
to Junos Python EZ


On Thursday, May 4, 2017 at 5:36:21 AM UTC-6, Mohit Mittal wrote:
and changing it to port 22 worked.

What Juniper platform and Junos version are you using?

Can you share your NETCONF service configuration?
show configuration system services netconf

Are you sure there are no network devices between the PyEZ client and Junos device which are blocking TCP port 830?

What's the result of executing "ssh -v -p830 -s <user>@<host> netconf" from the shell of the PyEZ host?


Reply all
Reply to author
Forward
0 new messages