Unable to use jnpr.junos device library to open a device conection

33 views Asked by At

Hi I getting this type of errors,

File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/jnpr/junos/device.py", line 1374, in open
    self._conn = netconf_ssh.connect(
                 ^^^^^^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/ncclient/manager.py", line 187, in connect
    return connect_ssh(*args, **kwds)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/ncclient/manager.py", line 139, in connect_ssh
    session.connect(*args, **kwds)
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/ncclient/transport/ssh.py", line 288, in connect
    raise SSHError("Could not open socket to %s:%s" % (host, port))
ncclient.transport.errors.SSHError: Could not open socket to 10.233.146.10:830

My code is really simple anyone with a past experience,

typefrom pprint import pprint
from jnpr.junos import Device
from jnpr.junos.utils.config import Config 

print("Prueba de conexion a equipo")

dev = Device(host='10.233.146.10', user='user', password='password' )
dev.open()


print ("the router basic information is: ")

cu = Config(dev)

print (cu)

print("closing connection")    
dev.close()
 here

Just to open the netconf connection and close it,

0

There are 0 answers