I'm trying to use Napalm to connect to Cisco routers using telnet from the python chevron and getting an error from netmiko.ssh.
Here is the snippet that I am using
from napalm import get_network_driver
driver = get_network_driver('ios')
with driver('ip_address', 'username', 'password', optional_args={'port': 23,'transport': telnet}) as device:
print(device.get_facts())
Here is the error message that I am receiving:
NAPALM didn't catch this exception. Please, fill a bugfix on https://github.com/napalm-automation/napalm/issues
Don't forget to include this traceback.
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Program Files\Python39\lib\site-packages\napalm\base\base.py", line 46, in __enter__
self.open()
File "C:\Program Files\Python39\lib\site-packages\napalm\ios\ios.py", line 169, in open
self.device = self._netmiko_open(
File "C:\Program Files\Python39\lib\site-packages\napalm\base\base.py", line 86, in _netmiko_open
self._netmiko_device = ConnectHandler(
File "C:\Program Files\Python39\lib\site-packages\netmiko\ssh_dispatcher.py", line 312, in ConnectHandler
return ConnectionClass(*args, **kwargs)
File "C:\Program Files\Python39\lib\site-packages\netmiko\cisco\cisco_ios.py", line 17, in __init__
return super().__init__(*args, **kwargs)
File "C:\Program Files\Python39\lib\site-packages\netmiko\base_connection.py", line 346, in __init__
self._open()
File "C:\Program Files\Python39\lib\site-packages\netmiko\base_connection.py", line 351, in _open
self.establish_connection()
File "C:\Program Files\Python39\lib\site-packages\netmiko\base_connection.py", line 910, in establish_connection
self.telnet_login()
File "C:\Program Files\Python39\lib\site-packages\netmiko\cisco_base_connection.py", line 171, in telnet_login
raise NetmikoAuthenticationException(msg)
netmiko.ssh_exception.NetmikoAuthenticationException: Login failed: ip_address
to be able to establish an SSH/Telnet-Session to an Cisco-IOS/XE-Device you need to
a) enable user-authentication at the "line"-level:
b) add a local user account with correct privilege level:
c) enable the correct protocol for incoming sessions:
telnet might be default, good idea to disable this and switch to ssh:
having done this, this works just fine: