Python learning for Network Engineers Part 20 | Netmiko cisco use send_config_from_file for config
𝗙𝗼𝗿 𝗖𝗼𝗺𝗽𝗹𝗲𝘁𝗲 𝗣𝘆𝘁𝗵𝗼𝗻 𝗙𝗼𝗿 𝗡𝗲𝘁𝘄𝗼𝗿𝗸 𝗘𝗻𝗴𝗶𝗻𝗲𝗲𝗿𝘀 𝗖𝗼𝘂𝗿𝘀𝗲:
𝗘𝗻𝗿𝗼𝗹𝗹 𝗳𝗼𝗿 𝗯𝗲𝗹𝗼𝘄 𝗨𝗱𝗲𝗺𝘆 𝗖𝗹𝗮𝘀𝘀: 𝟐𝟎𝟐𝟐 𝐕𝐞𝐫𝐬𝐢𝐨𝐧
𝑫𝒊𝒔𝒄𝒐𝒖𝒏𝒕𝒆𝒅 𝑹𝒆𝒇𝒆𝒓𝒓𝒂𝒍 𝑳𝒊𝒏𝒌:
https://www.udemy.com/course/python-for-network-engineers/?referralCode=35A75AAE1ACA94A15829 This video demonstrates, how to use the method send_config_from_file in netmiko for device configuration.
Using this we will be able to fetch config from external file and push to device
IP_LIST = open(’15_devices’)
for IP in IP_LIST:
print (‘n ##### ‘+ IP.strip() + ‘ ##### n’ )
RTR = {
‘ip’: IP,
‘username’: ‘admin’,
‘password’: ‘admin’,
‘device_type’: ‘cisco_ios’,
}
net_connect = ConnectHandler(**RTR)
output = net_connect.send_config_from_file(config_file = ’16_config’)
print(output)
output = net_connect.send_command(‘show ip int brief’)
print(output)
Views : 5626
network engineer