/netmiko_send_commands

Script to send configuration from a file to a list of devices (routers and switches running IOS).

Primary LanguagePythonMIT LicenseMIT

Netmiko Send Commands

Script to send commands from a file to a list of devices (routers and switches running IOS). The output is saved in a .txt.

Requires

  • Python (tested on Python 2.7 and 3.6)
  • Modules
    • Netmiko >= 2.2.2
    • getpass
    • csv
  • You can use pip install -r requirements.txt to install all modules

Supports

Routers and Switches Cisco running IOS with SSH/Telnet configured (default ports 22/23)

Limitations

  • Same credentials for all devices
  • Only SSH/Telnet with default ports (22/23)
  • Last line on configuration file can not be 'exit'
  • Only config that can be the same in different devices

Usage

  1. Install Python and the required modules
  2. Download this repository or copy files commands_to_send.txt, devices_to_configure.csv and send_commands.py to the same folder
  3. Inform port (22/23) and IP address of devices in devices_to_configure.csv file devices
  4. Put the commands that you want to send to devices in file commands_to_send.txt (it starts in config mode) commands
  5. Run pynton send_commands.py
  6. Inform username, password and enable

Use case

To perform backup, to enables logging, to collects information, to creates username, shut/no shut interfaces, to removes config, any other config/command that can be repeated over different devices

Getting Help

If you are having trouble or need help, create an issue here

Credits and references

All credits to Kirk Byers for making Netmiko

published