cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2753
Views
12
Helpful
3
Replies

NSO DataCenter Example - Connection Refused Error

manuel.coral
Level 1
Level 1

Hi, in trying to make NSO work on the datacenter example that comes in the package... I was able to handle several issues along the process, however; I did hit the wall with the connection refused error below.

 

admin@ncs> request devices device catalyst3 sync-from
result false
info Failed to connect to device catalyst3: connection refused: Key exchange was not finished, connection is closed

 

I am having the same error when I try to sync from all the devices...does anyone have any clue or have faced the same issue? and more important, any suggestion to fix this issue?

 

admin@ncs> request devices sync-from
sync-result {
device asr0
result false
info Failed to connect to device asr0: connection refused: Key exchange was not finished, connection is closed.
}
sync-result {
device asr1
result false
info Failed to connect to device asr1: connection refused: Key exchange was not finished, connection is closed.
}
sync-result {
device asr2
result false
info Failed to connect to device asr2: connection refused: Key exchange was not finished, connection is closed.
}
sync-result {
device asr3
result false
info Failed to connect to device asr3: connection refused: Key exchange was not finished, connection is closed.
}
sync-result {
device catalyst0
result false
info Failed to connect to device catalyst0: connection refused: Key exchange was not finished, connection is closed.
}
sync-result {
device catalyst1
result false
info Failed to connect to device catalyst1: connection refused: Key exchange was not finished, connection is closed.
}
sync-result {
device catalyst2
result false
info Failed to connect to device catalyst2: connection refused: Key exchange was not finished, connection is closed.
}
sync-result {
device catalyst3
result false
info Failed to connect to device catalyst3: connection refused: Key exchange was not finished, connection is closed.
}
sync-result {
device catalyst4
result false
info Failed to connect to device catalyst4: connection refused: Key exchange was not finished, connection is closed.
}
sync-result {
device catalyst5
result false
info Failed to connect to device catalyst5: connection refused: Key exchange was not finished, connection is closed.
}
sync-result {
device dell0
result false
info Failed to connect to device dell0: connection refused: Key exchange was not finished, connection is closed.
}
sync-result {
device dell1
result false
info Failed to connect to device dell1: connection refused: Key exchange was not finished, connection is closed.
}
sync-result {
device nexus0
result false
info Failed to connect to device nexus0: connection refused: Key exchange was not finished, connection is closed.
}
sync-result {
device nexus1
result false
info Failed to connect to device nexus1: connection refused: Key exchange was not finished, connection is closed.
}
sync-result {
device nexus2
result false
info Failed to connect to device nexus2: connection refused: Key exchange was not finished, connection is closed.
}
sync-result {
device nexus3
result false
info Failed to connect to device nexus3: connection refused: Key exchange was not finished, connection is closed.
}
[ok][2019-02-20 13:49:35]

3 Replies 3

joepak
Cisco Employee
Cisco Employee
Hi,

1) Generate a NEW SSH key
a. ssh-keygen -t rsa -m PEM -f ${NCS_DIR}/etc/ncs/ssh/ssh_host_rsa_key -N ''
2) From $NCS_RUN (or where your ./netsim directory was created)
a. find netsim/ -type d -name ssh -exec cp ${NCS_DIR}/etc/ncs/ssh/ssh_host_rsa_key* {} \;
3) manually ensure the SSH Keys from ${NCS_DIR}/etc/ncs/ssh/ were successfully copied to EACH netsim (device) ‘ssh’ directory
4) Once copy is complete and verified
a. Login to NSO
b. Perform a ‘fetch-host-keys’ command for each device

i. devices device <devicename> ssh fetch-host-keys
c. devices sync-from

i. expected to ‘sync’ all devices
5) If fails, see Step #3 …

See if this helps.

 

3) manually ensure the SSH Keys from ${NCS_DIR}/etc/ncs/ssh/ were successfully copied to EACH netsim (device) ‘ssh’ directory

 

This is the location where you copy them to:

 

cp ssh_host_rsa_key ~/nso-4.7/examples.ncs/getting-started/using-ncs/1-simulated-cisco-ios/netsim/c/c0/ssh
cp ssh_host_rsa_key.pub ~/nso-4.7/examples.ncs/getting-started/using-ncs/1-simulated-cisco-ios/netsim/c/c0/ssh

ron.whitt
Level 1
Level 1

Good stuff, this got me out of the ditch.

you can also fetch keys for all the devices at one time with this command: admin@ncs# devices fetch-ssh-host-keys

then do admin@ncs# devices sync-from

Great help, thanks @joepak