Cisco IOS device fails to enter config mode properly
See original GitHub issueI’ve error when using send_config_set method in Netmiko with cisco_ios and but other methods are working normally, Thanks for your kind support . [Noted that : this is virtual LAB ]
`from netmiko import ConnectHandler from getpass import getpass
password = getpass()
cisco = { ‘device_type’: ‘cisco_ios’, ‘host’:‘192.168.100.10’, ‘username’:‘R1’, ‘password’:password,
}
net_connect = ConnectHandler(**cisco)
output = net_connect.send_command(‘show ip int brief’) print(output)
config_commands = [‘config t’, ‘int loop 1’, ‘ip address 1.1.1.1 255.255.255.255’] output = net_connect.send_config_set(config_commands=cisco) print (output)
cisco.disconnect()
===================================================================================================
C:\Users\engmo>python C:/Users/engmo/PycharmProjects/Netmiko/Netmiko.py Password:
Interface IP-Address OK? Method Status Protocol Ethernet0/0 unassigned YES NVRAM administratively down down Ethernet0/1 192.168.100.10 YES NVRAM up up Ethernet0/2 unassigned YES NVRAM administratively down down Ethernet0/3 unassigned YES NVRAM administratively down down Ethernet1/0 unassigned YES NVRAM administratively down down Ethernet1/1 unassigned YES NVRAM administratively down down Ethernet1/2 unassigned YES NVRAM administratively down down Ethernet1/3 unassigned YES NVRAM administratively down down Serial2/0 unassigned YES NVRAM administratively down down Serial2/1 unassigned YES NVRAM administratively down down Serial2/2 unassigned YES NVRAM administratively down down Serial2/3 unassigned YES NVRAM administratively down down Serial3/0 unassigned YES NVRAM administratively down down Serial3/1 unassigned YES NVRAM administratively down down Serial3/2 unassigned YES NVRAM administratively down down Serial3/3 unassigned YES NVRAM administratively down down Traceback (most recent call last): File “C:\Program Files (x86)\Python38-32\lib\site-packages\paramiko\channel.py”, line 699, in recv out = self.in_buffer.read(nbytes, self.timeout) File “C:\Program Files (x86)\Python38-32\lib\site-packages\paramiko\buffered_pipe.py”, line 164, in read raise PipeTimeout() paramiko.buffered_pipe.PipeTimeout
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File “C:\Users\engmo\AppData\Roaming\Python\Python38\site-packages\netmiko\base_connection.py”, line 569, in _read_channel_expect new_data = self.remote_conn.recv(MAX_BUFFER) File “C:\Program Files (x86)\Python38-32\lib\site-packages\paramiko\channel.py”, line 701, in recv raise socket.timeout() socket.timeout
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File “C:/Users/engmo/PycharmProjects/Netmiko/Netmiko.py”, line 22, in <module> output = net_connect.send_config_set(config_commands=cisco) File “C:\Users\engmo\AppData\Roaming\Python\Python38\site-packages\netmiko\base_connection.py”, line 1853, in send_config_set output += self.config_mode(*cfg_mode_args) File “C:\Users\engmo\AppData\Roaming\Python\Python38\site-packages\netmiko\cisco_base_connection.py”, line 48, in config_mode return super().config_mode( File “C:\Users\engmo\AppData\Roaming\Python\Python38\site-packages\netmiko\base_connection.py”, line 1737, in config_mode if not self.check_config_mode(): File “C:\Users\engmo\AppData\Roaming\Python\Python38\site-packages\netmiko\cisco\cisco_ios.py”, line 32, in check_config_mode return super().check_config_mode(check_string=check_string, pattern=pattern) File “C:\Users\engmo\AppData\Roaming\Python\Python38\site-packages\netmiko\cisco_base_connection.py”, line 38, in check_config_mode return super().check_config_mode(check_string=check_string, pattern=pattern) File “C:\Users\engmo\AppData\Roaming\Python\Python38\site-packages\netmiko\base_connection.py”, line 1721, in check_config_mode output = self.read_until_pattern(pattern=pattern) File “C:\Users\engmo\AppData\Roaming\Python\Python38\site-packages\netmiko\base_connection.py”, line 651, in read_until_pattern return self._read_channel_expect(*args, **kwargs) File “C:\Users\engmo\AppData\Roaming\Python\Python38\site-packages\netmiko\base_connection.py”, line 579, in _read_channel_expect raise NetmikoTimeoutException( netmiko.ssh_exception.NetmikoTimeoutException: Timed-out reading channel, data not available. `
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (2 by maintainers)
Top GitHub Comments
Your debugging shows success. It looks like you are going all the way up to “show version”.
The code you posted when you opened the issue does not report a “show version”. Are you running this with the latest version of Netmiko?
Closing as there was no additional response on this. Just re-open if you have more info on the problem.