cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1017
Views
5
Helpful
1
Replies

connect to IOS XR Always-On Sandbox using ncclient

EvanC
Level 1
Level 1

I am testing the connection to IOS XR Always-On Sandbox using ncclient.

 

The code should be quite straight forward

from ncclient import manager

with manager.connect(
host='sandbox-iosxr-1.cisco.com', # IP address of device
port=830, # Port to connect to
username='admin', # SSH Username
password='C1sco12345', # SSH Password
hostkey_verify=False, # Allow unknown hostkeys not in local store
device_params={'name':'iosxr'} # Device connection parameters
) as m: # Context manager reference, i.e. instance of connected manager
# Print out the NETCONF XML capabilities as reported by the device
print(m.server_capabilities)

Unfortunately, I'v got AnthenticationError again

ncclient.transport.errors.AuthenticationError: AuthenticationException('Authentication timeout.')

Any idea?

1 Reply 1

EvanC
Level 1
Level 1

Ok, I fix this issue by adding a few more parameters in manager.connect()

Here is the modified code:

with manager.connect(
host=router["host"],
port=router["netconf_port"],
username=router["username"],
password=router["password"],
hostkey_verify=False,
device_params={'name':'iosxr'},
look_for_keys=False,
allow_agent=False
) as m:

 

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: