SSH Mismatch while deploying Ansible #2759
Replies: 4 comments 2 replies
-
| 
         Ansible has its own Python interface to OpenSSH libraries and usually manages to work with the ancient Cisco IOS crypto algorithms without tweaks to netlab_ssh_args variable (which is also set by default to work with those ancient algorithms for quite a while). That module is installed automatically with netlab install ansible. So: 
  | 
  
Beta Was this translation helpful? Give feedback.
-
| 
         So, I set up a brand new Debian 13 VM (great fun because nobody builds Vagrant boxes anymore, I finally found "cloud-image/debian-13"), installed networklab as a system package, used netlab to install ubuntu, containerlab and ansible, and started a lab with an IOL container, and it all worked out of the box. I have no idea how your Debian setup differs from what the author of the Vagrant box claims to be the default Debian cloud image (https://portal.cloud.hashicorp.com/vagrant/discover/cloud-image/debian-13). You might try to do "ssh -Q kex" to see whether the Cisco's old algorithms are available on your machine. Here's what I got:  | 
  
Beta Was this translation helpful? Give feedback.
-
| 
         Sir, i really appreciate the time you've sent on this. I''ve found a fix changing the ansible ssh lib from libssh to paramiko (netlab) jjc@debian:~/netlab/test_lab$ export ANSIBLE_NETWORK_CLI_SSH_TYPE=paramiko TASK [ios_config: deploying initial from /home/jjc/netlab/lib/python3.13/site-packages/netsim/ansible/templates/initial/ios.j2] *** PLAY [Deploy module-specific configurations] ************************************************* PLAY [Deploy custom deployment templates] **************************************************** PLAY RECAP *********************************************************************************** [SUCCESS] Lab devices configured [WARNING] The following warnings were generated during the 'netlab up' processing DIST1#sh ip int brief DIST2#sh ip int brief DIST3#sh ip int brief  | 
  
Beta Was this translation helpful? Give feedback.
-
| 
        
ssh_type string | The python package that will be used by the network_cli connection plugin to create a SSH connection to remote host.libssh will use the ansible-pylibssh package, which needs to be installed in order to work.paramiko will instead use the paramiko package to manage the SSH connection.auto will use ansible-pylibssh if that package is installed, otherwise will fallback to paramiko.Choices:"libssh""paramiko""auto" ← (default)
-- | --
 Looks like presence of the ansible-pylibssh package triggers different behavior  | 
  
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello, i'm nuts about this error
TASK [Deploy initial configuration] **************************************************************************************************
included: /usr/local/lib/python3.13/dist-packages/netsim/ansible/tasks/deploy-config/ios.yml for DIST1, DIST2, DIST3
TASK [ios_config: deploying initial from /usr/local/lib/python3.13/dist-packages/netsim/ansible/templates/initial/ios.j2] ************
fatal: [DIST2]: FAILED! => changed=false
msg: 'ssh connection failed: ssh connect failed: kex error : no match for method kex algos: server [diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1], client [curve25519-sha256,[email protected],ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group18-sha512,diffie-hellman-group16-sha512,diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha256]'
I know is a mistach key exch method , i've tweaked the .netlab.yml changing this method but the error persist
jjc@debian:~/netlab/test_lab$ cat ~/.netlab.yml
devices.iosxr.clab.image: ios-xr/xrd-control-plane:25.1.1
devices.iosvl2.clab.image: asifsyd/cisco_viosl2:15.2
devices.iosv.clab.image: asifsyd/cisco_vios:15.9.3M6
devices.ioll2.clab.image: asifsyd/cisco_iol:l2-17.12.01
devices.iol.clab.image: asifsyd/cisco_iol:17.12.01
devices.iosv.group_vars.netlab_ssh_args: "-o KexAlgorithms=+diffie-hellman-group14-sha1 -o HostKeyAlgorithms=+ssh-rsa -o PubkeyAcceptedAlgorithms=+ssh-rsa"
Any clue ?
Beta Was this translation helpful? Give feedback.
All reactions