"Want more expert insights and updates? Follow us on LinkedIn and explore our company page to connect with us directly. Don’t miss out - click the link and join the conversation!"
Follow us on LinkedIn / plexinor
Company Website Https://www.plexinor.com
HOW TO CONFIGURE MULTIPLE ROUTERS, SWITCHES USING SIMPLE PYTHON Script
Full script is below
lab@admin:~$ cat Config-Multiple-device-using-Config-File
from netmiko import Netmiko
from getpass import getpass
username = input('Enter your SSH username: ')
password=getpass()
with open('Changes') as f:
commands_to_send = f.read().splitlines()
print (commands_to_send)
with open('Device-IP-List') as f:
devices = f.read().splitlines()
print (devices)
for router in devices:
print ('Connecting to device ====================" ' + router)
ip_address_of_device = router
junos_devices = {
'device_type': 'juniper_junos',
'ip': ip_address_of_device,
'username': username,
'password': password
}
all_devices = [junos_devices]
for devices in all_devices:
net_connect = Netmiko(**devices)
print(net_connect.find_prompt())
output = net_connect.send_config_set(commands_to_send, exit_config_mode=False)
output += net_connect.commit(and_quit=True)
print(output)
Смотрите видео HOW TO CONFIGURE MULTIPLE ROUTERS OR SWITCHES USING A "CONFIGURATION FILE" WITH PYTHON SCRIPT онлайн без регистрации, длительностью часов минут секунд в хорошем качестве. Это видео добавил пользователь Network Tips and Topics - Plexinor 06 Март 2023, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 108 раз и оно понравилось 1 людям.