cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Announcements
Join Customer Connection to register!
268
Views
5
Helpful
2
Replies

Running config of multiple switches

Respected all,
i hope this mail will finds you in good health.
i have about 30 + switches in my environment now i want to get its "running-config" all of the switch to single tftp atonce is there any way to solve it

2 REPLIES 2
Leo Laohoo
VIP Community Legend

Only 30 switches?  That is nothing.  

copy run tftp://<TFTP_IP_ADDRESS>filename.txt
Georg Pauwen
VIP Expert

Hello,

 

you could use an EEM script to automate this. Below is an example (for only 5 switches, if this works for you, you can add as many entries as you want). The script assumes a few things to be configured on the switch:

 

--> username backup privilege 15 password 0 switch

--> line vty 0 4

--> login local

--> transport input telnet

 

Also, in order for the TFTP server to save the files with the respective hostname of the switch, make sure a file HOSTNAME.cfg exists on the TFTP server.

 

Here is the script. It has no timer, you can run it by executing the command. The IP address of the switches are assumed to be 192.168.1.x, if yours are different, change them accordingly.

 

event manager run BACKUP_RUN

 

event manager applet BACKUP_RUN
event none
action 1.0 cli command "enable"
action 1.1 info type routername
action 1.2 cli command "telnet 192.168.1.1" pattern "Username:"
action 1.3 cli command "backup" pattern "Password"
action 1.4 cli command "switch" pattern "#"
action 1.5 cli command "copy run tftp://192.168.2.1/$_info_routername.cfg"" pattern "#"
action 1.6 cli command "exit" pattern "#"
action 1.7 wait 5
action 2.0 cli command "enable"
action 2.1 info type routername
action 2.2 cli command "telnet 192.168.1.2" pattern "Username:"
action 2.3 cli command "backup" pattern "Password"
action 2.4 cli command "switch" pattern "#"
action 2.5 cli command "copy run tftp://192.168.2.1/$_info_routername.cfg"" pattern "#"
action 2.6 cli command "exit" pattern "#"
action 2.7 wait 5
action 3.0 cli command "enable"
action 3.1 info type routername
action 3.2 cli command "telnet 192.168.1.3" pattern "Username:"
action 3.3 cli command "backup" pattern "Password"
action 3.4 cli command "switch" pattern "#"
action 3.5 cli command "copy run tftp://192.168.2.1/$_info_routername.cfg"" pattern "#"
action 3.6 cli command "exit" pattern "#"
action 3.7 wait 5
action 4.0 cli command "enable"
action 4.1 info type routername
action 4.2 cli command "telnet 192.168.1.4" pattern "Username:"
action 4.3 cli command "backup" pattern "Password"
action 4.4 cli command "switch" pattern "#"
action 4.5 cli command "copy run tftp://192.168.2.1/$_info_routername.cfg"" pattern "#"
action 4.6 cli command "exit" pattern "#"
action 4.7 wait 5
action 5.0 cli command "enable"
action 5.1 info type routername
action 5.2 cli command "telnet 192.168.1.5" pattern "Username:"
action 5.3 cli command "backup" pattern "Password"
action 5.4 cli command "switch" pattern "#"
action 5.5 cli command "copy run tftp://192.168.2.1/$_info_routername.cfg"" pattern "#"
action 5.6 cli command "exit" pattern "#"
action 5.7 wait 5