16,620 views
Script to backup Cisco switches via telnet / tftp
A couple of days ago, I have released a small perl script to back up Cisco IOS based switches via telnet.
I know there are a couple of similar scripts available on the internet, but most of them either use the “expect” functionality (which does not work all the time), or use SendKeys (which only works when the application has the ‘focus’, and thus cannot be safely scripted.), or are commercial tools.
So I decided to write a quick and dirty (free) script myself, which is purely based on a basic tcp socket connection.
I know, this script only works with telnet (clear text), but at least you can backup your switches (and if you have a dedicated management network, it may be ok to use telnet after all). Furthermore, you can safely schedule the script to run in the background, lean back, and enjoy other things …
The script will simply connect to each host in a given text file, log in, and send the configuration + the vlan configuration to a remote tftp server.
You can read more about this script (and download the script / a precompiled binary) at http://www.corelan.be/index.php/my-free-tools/networking/cisco-switch-backup-utility/
© 2009 – 2020, Peter Van Eeckhoutte (corelanc0d3r). All rights reserved.