Netmiko: Configure multiple devices with multiple commands (Cisco IOS)

Create a script and save it as config.py
Create a text file with your IOS script inside – This example is named c3750_lab_design
Save the file in the same folder path you save the script.
Example of Cisco IOS Script:
vtp mode transparent
spanning-tree mode rapid-pvst
udld enable
errdisable recovery cause all
port-channel load-balance src-dst-ip
ip name-server 10.0.10.3
no ip http server
no ip http secure-server
snmp-server community python1 RO
snmp-server community python2 RW
ntp server 0.us.pool.ntp.org
clock timezone CST -6
clock summer-time CST recurring
service timestamps debug datetime msec localtime
service timestamps log datetime msec localtime
vlan 10
name Data
vlan 11
name Voice
vlan 12
name Test
interface vlan 1
description In-band Management
ip default-gateway 10.0.10.1
ip dhcp snooping vlan 100,101
no ip dhcp snooping information option
ip dhcp snooping
ip arp inspection vlan 10
spanning-tree portfast bpduguard default
interface range Fa 1/0/1 - 20
switchport
switchport access vlan 10
switchport voice vlan 11
switchport host
switchport port-security maximum 5
switchport port-security
switchport port-security aging time 5
switchport port-security aging type inactivity
switchport port-security violation restrict
ip arp inspection limit rate 100
ip dhcp snooping limit rate 100
ip verify source
interface range Fa 1/0/21 - 48
switch tr en do
switchport mode trunk
end
wr
Leave a Reply