Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HUAWEI VRP (R) software does not support diffie-hellman-group16-sha512 #2443

Open
yufengshizhe opened this issue Aug 12, 2021 · 8 comments
Open
Labels

Comments

@yufengshizhe
Copy link

netmiko not support HUAWEI VRP (R) software, Version 5.170 (S5720 V200R019C10SPC500)

@ktbyers
Copy link
Owner

ktbyers commented Aug 12, 2021

@yufengshizhe
There is a: huawei_vrpv8

Does that work?

https://github.com/ktbyers/netmiko/blob/develop/netmiko/ssh_dispatcher.py#L192

Otherwise, you would probably need to create a driver for the platform (if you want support for it). Process for creating a driver is here:

https://github.com/ktbyers/netmiko/blob/develop/VENDOR.md

@ktbyers ktbyers closed this as completed Aug 12, 2021
@yufengshizhe
Copy link
Author

Use VRP8 is still the same, NetmikoTimeoutException
I tried to modify the conn_timeout, auth_timeout, session_timeout parameters, but it still doesn’t work

@ktbyers
Copy link
Owner

ktbyers commented Aug 18, 2021

What is the actual exception / issue that you run into?

@yufengshizhe
Copy link
Author

user netmiko to login huawei switch timeout

@ktbyers
Copy link
Owner

ktbyers commented Aug 19, 2021

I would need to see a simplified version of the code (i.e. a simple base case that illustrates the problem) and the full exception stack trace.

Regards, Kirk

@yufengshizhe
Copy link
Author

yufengshizhe commented Aug 20, 2021

import os
import netmiko
from netmiko import ConnectHandler,NetmikoTimeoutException,NetmikoAuthenticationException #引入netmiko连接模块、报错模块
import getpass
import time 
date = time.strftime('%Y%m%d', time.localtime()) #赋予date变量


swlist=open("ip.txt","r",encoding='utf8')
for ip in swlist.readlines(): 
    
    huawei = {
    'device_type':"huawei", #定义设备类型
    'ip':ip, 
    'port':'22',
    'username':'xxxxxx', 
    'password':'xxxxxxx',
    #'secret' : 'admin' #enable密码
    }
    try:
        huawei_connect = ConnectHandler(**huawei) #传入设备字典与设备建立SSH连接。
        print ("Sucessfully Login to",ip)
        print ("Building configuration...")
        cmd1=("dis ver")
        out1=huawei_connect.send_command(cmd1)
        print(out1)

        
        print(ip,'Was finished!\n',"-"*100)
    except NetmikoAuthenticationException : #认证失败报错记录
        e1 = open(f'{date}.txt','a')
        print(date,ip,'[Error 1] Authentication failed.\n',file = e1)
        e1.close
    except NetmikoTimeoutException : #登录超时报错记录
        e2 = open(f'{date}.txt','a')
        print(date,ip,'[Error 2] Connection timed out.\n',file = e2)
        e2.close
    except : #未知报错记录
        e3 = open(f'{date}.txt','a')
        print(date,ip,'[Error 3] Unknown error.\n',file = e3)
        e3.close
        huawei_connect.disconnect() #断开SSH连接
swlist.close()

@yufengshizhe
Copy link
Author

Snipaste_2021-08-20_09-38-03

@yufengshizhe
Copy link
Author

I would need to see a simplified version of the code (i.e. a simple base case that illustrates the problem) and the full exception stack trace.

Regards, Kirk

hi,
i use is to remove diffie-hellman-group16-sha512 from the list of kex algos in paramiko.now,Problem has been solved
from paramiko import transport transport.Transport._preferred_kex = ( 'ecdh-sha2-nistp256', 'ecdh-sha2-nistp384', 'ecdh-sha2-nistp521', # 'diffie-hellman-group16-sha512', # disable 'diffie-hellman-group-exchange-sha256', 'diffie-hellman-group14-sha256', 'diffie-hellman-group-exchange-sha1', 'diffie-hellman-group14-sha1', 'diffie-hellman-group1-sha1',

@ktbyers ktbyers reopened this Sep 18, 2021
@ktbyers ktbyers added the bug label Sep 18, 2021
@ktbyers ktbyers changed the title netmiko not support HUAWEI VRP (R) software, Version 5.170 (S5720 V200R019C10SPC500) HUAWEI VRP (R) software does not support diffie-hellman-group16-sha512 Sep 18, 2021
@ktbyers ktbyers closed this as completed Sep 16, 2022
@ktbyers ktbyers reopened this Sep 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants