Tuesday, 12 December 2017
Netmiko01_CampusNetwork-Divided into Core and Access Confiugration
GNU nano 2.8.6 File: netmikoCampus_Access-Core.py
#!/usr/bin/env python
from netmiko import ConnectHandler
iosv_l2_s1 = {
'device_type': 'cisco_ios',
'ip': '192.168.122.71',
'username': 'adrian',
'password': 'cisco',
}
iosv_l2_s2 = {
'device_type': 'cisco_ios',
'ip': '192.168.122.72',
'username': 'adrian',
'password': 'cisco',
}
iosv_l2_s3 = {
'device_type': 'cisco_ios',
'ip': '192.168.122.73',
'username': 'adrian',
'password': 'cisco',
}
iosv_l2_s4 = {
'device_type': 'cisco_ios',
'ip': '192.168.122.74',
'username': 'adrian',
'password': 'cisco',
}
iosv_l2_s5 = {
'device_type': 'cisco_ios',
'ip': '192.168.122.75',
'username': 'adrian',
'password': 'cisco',
}
with open('iosv_l2_access') as f:
lines = f.read().splitlines()
print lines
all_devices = [iosv_l2_s5, iosv_l2_s4, iosv_l2_s3]
for devices in all_devices:
net_connect = ConnectHandler(**devices)
output = net_connect.send_config_set(lines)
print output
with open('iosv_l2_core') as f:
lines = f.read().splitlines()
print lines
all_devices = [iosv_l2_s2, iosv_l2_s1]
for devices in all_devices:
net_connect = ConnectHandler(**devices)
output = net_connect.send_config_set(lines)
print output
+++
Executing the python script...
+++
Changes has been run, executed in each SW.
Subscribe to:
Post Comments (Atom)
Demo: Interface Profiles
Create Leaf Interface Profile
-
import getpass import sys import telnetlib HOST = "192.168.122.254" user = raw_input("Enter your RCC telnet usernam...
-
I've texted Joanna and we will go up for some fun tonight with my hyper active kido - Hunter!
No comments:
Post a Comment