Port 49, 50, 51 are active. Debug logger is turned on. ----------- code from netmiko import ConnectHandler def run_debug_config(config_commands): net_connect = ConnectHandler(device_type='cisco_nxos_ssh', ip='xxx', username='admin', password='xxx', global_delay_factor=4, blocking_timeout=40) print(config_commands) output = net_connect.send_config_set(config_commands, cmd_verify=False) net_connect.disconnect() config_commands = ['int Ethernet1/48', 'no channel-group', 'no switchport', 'switchport', 'int Ethernet1/49', 'no channel-group', 'no switchport', 'switchport', 'int Ethernet1/50', 'no channel-group', 'no switchport', 'switchport', 'int Ethernet1/51', 'no channel-group', 'no switchport', 'switchport'] run_debug_config(config_commands) ----------- output read_channel: Cisco Nexus Operating System (NX-OS) Software TAC support: http://www.cisco.com/tac Copyright (C) 2002-2019, Cisco and/or its affiliates. All rights reserved. The copyrights to certain works contained in this software are owned by other third parties and used and distributed under their own licenses, such as open source. This software is provided "as is," and unless otherwise stated, there is no warranty, express or implied, including but not limited to warranties of merchantability and fitness for a particular purpose. Certain components of this software are licensed under the GNU General Public License (GPL) version 2.0 or GNU General Public License (GPL) version 3.0 or the GNU Lesser General Public License (LGPL) Version 2.1 or Lesser General Public License (LGPL) Version 2.0. A copy of each such license is available at http://www.opensource.org/licenses/gpl-2.0.php and http://opensource.org/licenses/gpl-3.0.html and http://www.opensource.org/licenses/lgpl-2.1.php and http://www.gnu.org/licenses/old-licenses/library.txt. R1-93180YC-EX-A# read_channel: read_channel: In strip_ansi_escape_codes repr = '' Stripping ANSI escape codes new_output = repr = '' read_channel: write_channel: b'\n' In strip_ansi_escape_codes repr = '\r\r\n\rR1-93180YC-EX-A# ' Stripping ANSI escape codes R1-93180YC-EX-A# repr = '\r\r\n\rR1-93180YC-EX-A# ' R1-93180YC-EX-A# In strip_ansi_escape_codes repr = '' Stripping ANSI escape codes new_output = repr = '' read_channel: [find_prompt()]: prompt is R1-93180YC-EX-A# In strip_ansi_escape_codes repr = '' Stripping ANSI escape codes new_output = repr = '' read_channel: In disable_paging Command: terminal length 0 write_channel: b'terminal length 0\n' Pattern is: terminal\ length\ 0 In strip_ansi_escape_codes repr = 'terminal length 0\r\r\n' Stripping ANSI escape codes repr = 'terminal length 0\r\r\n' Exiting disable_paging write_channel: b'terminal width 511\n' Pattern is: terminal\ width\ 511 In strip_ansi_escape_codes repr = '\rR1-93180YC-EX-A# ' Stripping ANSI escape codes R1-93180YC-EX-A# repr = '\rR1-93180YC-EX-A# ' R1-93180YC-EX-A# In strip_ansi_escape_codes repr = 'terminal width 511\r\r\n\rR1-93180YC-EX-A# ' Stripping ANSI escape codes R1-93180YC-EX-A# repr = 'terminal width 511\r\r\n\rR1-93180YC-EX-A# ' R1-93180YC-EX-A# R1-93180YC-EX-A# In strip_ansi_escape_codes repr = '' Stripping ANSI escape codes new_output = repr = '' read_channel: ['int Ethernet1/48', 'no channel-group', 'no switchport', 'switchport', 'int Ethernet1/49', 'no channel-group', 'no switchport', 'switchport', 'int Ethernet1/50', 'no channel-group', 'no switchport', 'switchport', 'int Ethernet1/51', 'no channel-group', 'no switchport', 'switchport'] write_channel: b'\n' Pattern is: # In strip_ansi_escape_codes repr = '\r\r\n\rR1-93180YC-EX-A# ' Stripping ANSI escape codes R1-93180YC-EX-A# repr = '\r\r\n\rR1-93180YC-EX-A# ' R1-93180YC-EX-A# R1-93180YC-EX-A# write_channel: b'config term\n' Pattern is: config\ term In strip_ansi_escape_codes repr = 'config term\r\r\n' Stripping ANSI escape codes repr = 'config term\r\r\n' Pattern is: R1\-93180YC\-EX\-A In strip_ansi_escape_codes repr = 'Enter configuration commands, one per line. End with CNTL/Z.\r\n\rR1-93180YC-EX-A(config)# ' Stripping ANSI escape codes new_output = Enter configuration commands, one per line. End with CNTL/Z. R1-93180YC-EX-A(config)# repr = 'Enter configuration commands, one per line. End with CNTL/Z.\r\n\rR1-93180YC-EX-A(config)# ' _read_channel_expect read_data: Enter configuration commands, one per line. End with CNTL/Z. R1-93180YC-EX-A(config)# Pattern found: R1\-93180YC\-EX\-A Enter configuration commands, one per line. End with CNTL/Z. R1-93180YC-EX-A(config)# write_channel: b'\n' Pattern is: # In strip_ansi_escape_codes repr = '\r\r\n\rR1-93180YC-EX-A(config)# ' Stripping ANSI escape codes R1-93180YC-EX-A(config)# repr = '\r\r\n\rR1-93180YC-EX-A(config)# ' R1-93180YC-EX-A(config)# R1-93180YC-EX-A(config)# write_channel: b'int Ethernet1/48\n' write_channel: b'no channel-group\n' write_channel: b'no switchport\n' write_channel: b'switchport\n' write_channel: b'int Ethernet1/49\n' write_channel: b'no channel-group\n' write_channel: b'no switchport\n' write_channel: b'switchport\n' write_channel: b'int Ethernet1/50\n' write_channel: b'no channel-group\n' write_channel: b'no switchport\n' write_channel: b'switchport\n' write_channel: b'int Ethernet1/51\n' write_channel: b'no channel-group\n' write_channel: b'no switchport\n' write_channel: b'switchport\n' In strip_ansi_escape_codes repr = 'int Ethernet1/48\r\r\n\rR1-93180YC-EX-A(config-if)# no channel-group\r\r\n\rR1-93180YC-EX-A(config-if)# no switchport\r\r\n\rR1-93180YC-EX-A(config-if)# switchport\r\r\n\rR1-93180YC-EX-A(config-if)# int Ethernet1/49\r\r\n\rR1-93180YC-EX-A(config-if)# no channel-group\r\r\n\rR1-93180YC-EX-A(config-if)# no switchport\r\r\nswitchport\r\n\rR1-93180YC-EX-A(config-if)# switchport\r\r\nint Ethernet1/50\r\nno channel-group\r\nno switchport\r\nswitchport\r\nint Ethernet1/51\r\n\rR1-93180YC-EX-A(config-if)# int Ethernet1/50\r\r\n\rR1-93180YC-EX-A(config-if)# no channel-group\r\r\n\rR1-93180YC-EX-A(config-if)# no switchport\r\r\nno channel-group\r\n\rR1-93180YC-EX-A(config-if)# switchport\r\r\nno switchport\r\n' Stripping ANSI escape codes switchport int Ethernet1/50 no channel-group no switchport switchport int Ethernet1/51 no channel-group no switchport repr = 'int Ethernet1/48\r\r\n\rR1-93180YC-EX-A(config-if)# no channel-group\r\r\n\rR1-93180YC-EX-A(config-if)# no switchport\r\r\n\rR1-93180YC-EX-A(config-if)# switchport\r\r\n\rR1-93180YC-EX-A(config-if)# int Ethernet1/49\r\r\n\rR1-93180YC-EX-A(config-if)# no channel-group\r\r\n\rR1-93180YC-EX-A(config-if)# no switchport\r\r\nswitchport\r\n\rR1-93180YC-EX-A(config-if)# switchport\r\r\nint Ethernet1/50\r\nno channel-group\r\nno switchport\r\nswitchport\r\nint Ethernet1/51\r\n\rR1-93180YC-EX-A(config-if)# int Ethernet1/50\r\r\n\rR1-93180YC-EX-A(config-if)# no channel-group\r\r\n\rR1-93180YC-EX-A(config-if)# no switchport\r\r\nno channel-group\r\n\rR1-93180YC-EX-A(config-if)# switchport\r\r\nno switchport\r\n' switchport int Ethernet1/50 no channel-group no switchport switchport int Ethernet1/51 no channel-group no switchport In strip_ansi_escape_codes repr = '' Stripping ANSI escape codes new_output = repr = '' read_channel: In strip_ansi_escape_codes repr = '' Stripping ANSI escape codes new_output = repr = '' read_channel: write_channel: b'\n' Pattern is: # Socket exception: An existing connection was forcibly closed by the remote host (10054) Traceback (most recent call last): File "C:\Users\lzhao\AppData\Local\Programs\Python\Python37\lib\site-packages\IPython\core\interactiveshell.py", line 3331, in run_code exec(code_obj, self.user_global_ns, self.user_ns) File "", line 24, in run_debug_config(config_commands) File "", line 14, in run_debug_config output = net_connect.send_config_set(config_commands, cmd_verify=False) File "C:\Users\lzhao\AppData\Local\Programs\Python\Python37\lib\site-packages\netmiko\base_connection.py", line 1770, in send_config_set output += self.exit_config_mode() File "C:\Users\lzhao\AppData\Local\Programs\Python\Python37\lib\site-packages\netmiko\cisco_base_connection.py", line 44, in exit_config_mode return super().exit_config_mode(exit_config=exit_config, pattern=pattern) File "C:\Users\lzhao\AppData\Local\Programs\Python\Python37\lib\site-packages\netmiko\base_connection.py", line 1642, in exit_config_mode if self.check_config_mode(): File "C:\Users\lzhao\AppData\Local\Programs\Python\Python37\lib\site-packages\netmiko\cisco\cisco_nxos_ssh.py", line 28, in check_config_mode return super().check_config_mode(check_string=check_string, pattern=pattern) File "C:\Users\lzhao\AppData\Local\Programs\Python\Python37\lib\site-packages\netmiko\cisco_base_connection.py", line 30, in check_config_mode return super().check_config_mode(check_string=check_string, pattern=pattern) File "C:\Users\lzhao\AppData\Local\Programs\Python\Python37\lib\site-packages\netmiko\base_connection.py", line 1606, in check_config_mode output = self.read_until_pattern(pattern=pattern) File "C:\Users\lzhao\AppData\Local\Programs\Python\Python37\lib\site-packages\netmiko\base_connection.py", line 627, in read_until_pattern return self._read_channel_expect(*args, **kwargs) File "C:\Users\lzhao\AppData\Local\Programs\Python\Python37\lib\site-packages\netmiko\base_connection.py", line 552, in _read_channel_expect raise EOFError("Channel stream closed by remote device.") EOFError: Channel stream closed by remote device.