Jul 1, 2013

How to backup and load cisco configurations

Before changing anything on a cisco switch I do always a backup using tftp.

to check if you cisco is configured to transfer files to an tftp server:

cisco-switch#sh run | include tftp
ip tftp source-interface Vlan211

I have a RHEL server connected to Vlan211, so lets asume the IP address on that Vlan is 192.168.0.2:

cisco-switch#copy running-config tftp
Address or name of remote host []? 192.168.0.2
Destination filename [cisco-switch-confg]? 
!!
45262 bytes copied in 3.666 secs (12346 bytes/sec)

After that command on my Linux box I have the configuration saved:

[root@linux-box ~]$ ls /tftpboot/cisco-switch-confg 
/tftpboot/cisco-switch-confg


You can modify offline you configuration file and then load it to the cisco switch.
Be sure! Checking the sanity of you new confs is a must!!! 
After that just run the following:

cisco-switch#copy tftp startup-config
Address or name of remote host []? 192.168.0.2
Source filename []? cisco-switch-confg-new
Destination filename [startup-config]? 
Accessing tftp://192.168.0.2/cisco-switch-confg-new..
Loading cisco-switch-confg-new from 192.168.0.2 (via Vlan211): !
[OK - 45595 bytes]
[OK]
45595 bytes copied in 0.646 secs (70580 bytes/sec)

 You just now need to reload!
Of course the source-interface for the tftp can be a simple interface not a Vlan.

No comments:

Post a Comment