from netmiko import ConnectHandler

device = {
    "device_type": "cisco_ios",
    "ip":"10.1.1.1",
    "username":"admin",
    "password":"admin",
    "secret":"admin"
}

ssh = ConnectHandler(**device)
ssh.enable()
#ssh.send_config_set("hostname duy")
#print(ssh.send_config_set("hostname duy"))
command = ["int loop 0", "ip add 172.16.1.1 255.255.255.0"]
ssh.send_config_set(command)
print(ssh.send_config_set("do sh ip int br"))
output = ssh.find_prompt()
print(output)
ssh.disconnect()
9db93a31dcb3780e7a5c9969f96b72e1f649179d
<mask token>

<mask token>
ssh.enable()
<mask token>
ssh.send_config_set(command)
print(ssh.send_config_set('do sh ip int br'))
<mask token>
print(output)
ssh.disconnect()

<mask token>
device = {'device_type': 'cisco_ios', 'ip': '10.1.1.1', 'username': 'admin',
    'password': 'admin', 'secret': 'admin'}
ssh = ConnectHandler(**device)
ssh.enable()
command = ['int loop 0', 'ip add 172.16.1.1 255.255.255.0']
ssh.send_config_set(command)
print(ssh.send_config_set('do sh ip int br'))
output = ssh.find_prompt()
print(output)
ssh.disconnect()

from netmiko import ConnectHandler
device = {'device_type': 'cisco_ios', 'ip': '10.1.1.1', 'username': 'admin',
    'password': 'admin', 'secret': 'admin'}
ssh = ConnectHandler(**device)
ssh.enable()
command = ['int loop 0', 'ip add 172.16.1.1 255.255.255.0']
ssh.send_config_set(command)
print(ssh.send_config_set('do sh ip int br'))
output = ssh.find_prompt()
print(output)
ssh.disconnect()

from netmiko import ConnectHandler

device = {
    "device_type": "cisco_ios",
    "ip":"10.1.1.1",
    "username":"admin",
    "password":"admin",
    "secret":"admin"
}

ssh = ConnectHandler(**device)
ssh.enable()
#ssh.send_config_set("hostname duy")
#print(ssh.send_config_set("hostname duy"))
command = ["int loop 0", "ip add 172.16.1.1 255.255.255.0"]
ssh.send_config_set(command)
print(ssh.send_config_set("do sh ip int br"))
output = ssh.find_prompt()
print(output)
ssh.disconnect()