Python learning for Network Engineers | Part 18 |Netmiko SSH to multiple Cisco devices and configure
๐๐ผ๐ฟ ๐๐ผ๐บ๐ฝ๐น๐ฒ๐๐ฒ ๐ฃ๐๐๐ต๐ผ๐ป ๐๐ผ๐ฟ ๐ก๐ฒ๐๐๐ผ๐ฟ๐ธ ๐๐ป๐ด๐ถ๐ป๐ฒ๐ฒ๐ฟ๐ ๐๐ผ๐๐ฟ๐๐ฒ: ๐๐ป๐ฟ๐ผ๐น๐น ๐ณ๐ผ๐ฟ ๐ฏ๐ฒ๐น๐ผ๐ ๐จ๐ฑ๐ฒ๐บ๐ ๐๐น๐ฎ๐๐: ๐๐๐๐ ๐๐๐ซ๐ฌ๐ข๐จ๐ง ๐ซ๐๐๐๐๐๐๐๐๐ ๐น๐๐๐๐๐๐๐ ๐ณ๐๐๐: https://www.udemy.com/course/python-for-network-engineers/?referralCode=35A75AAE1ACA94A15829 Python Series Complete video Playlist URL :https://www.youtube.com/watch?v=sG_RiytUA38&list=PLOocymQm7YWakdZkBfCRIC06fv7xQE85N To stay updated with my latest videos Please subscribe to my channel by clicking below https://www.youtube.com/channel/UCcA2nhdC0wzqyv9x1lk5NnA?sub_confirmation=1 This video explains how to SSH to multiple Cisco devices, using multiple device dictionaries in Netmiko and lists. It uses for loop to get each device dictionary from netmiko import ConnectHandler RTR_10 = { 'ip': '10.10.10.10', 'username': 'admin', 'password': 'admin', 'device_type': 'cisco_ios', } RTR_11 = { 'ip': '10.10.10.11', 'username': 'admin', 'password': 'admin', 'device_type': 'cisco_ios', } DEVICE_LIST = [RTR_10, RTR_11] for DEVICE in DEVICE_LIST: print ('Connecting to the Device ' + DEVICE['ip']) net_connect = ConnectHandler(**DEVICE) config_commands = [ 'int lo0', 'ip add 1.1.1.1 255.255.255.0', 'no shut' ] output = net_connect.send_config_set(config_commands) print(output) output = net_connect.send_command('show ip int brief') print(output)
Download
0 formatsNo download links available.