Opposite of "save configuration as-script"


I am looking to reconfigure MANY switches "remotely". I have approximately 180 switches, mostly Summit x series, spread across more than 100 remote sites, so doing this remotely would be "Extreme"ly beneficial. (Pun intended). I would like to start with a defaulted switch. I have a script that works great when I'm consoled into the switch, but when I'm telnet-ed into the switch I lose my connection when I "unconfigure switch all".

I tried editing the cfg file with an XML editor and saving with a different name, but that doesn't work either. When I "use configuration .cfg" and reboot, the switch boots with a defaulted config.

Is there a command that is the opposite of "save configuration as-script", such as "save script as configuration"? Then I could "use configuration .cfg" to utilize my new config.

Any help would be greatly appreciated,
Jerry

6 replies

Userlevel 6
Hi Jerry,

I believe you can accomplish that using the command below:

save configuration as-script default

That means a file name as "default.xsf" will be created and loaded every time you do an "unconfigure switch all"
Userlevel 2
This is something I sollved by doing this. First save the file as default.xsf that you have your configuration in. Then you do unconfigure switch all The switch then reboots with the default.xsf configuration. What we did after that was in the file last file in the default.xsf we did mv default.xsf hostname.conf You have to save the config though as primary or something else manually ( or may python script it now that you can do that and have the switch save the file a running new config )
Userlevel 6
Henrique wrote:

Hi Jerry,

I believe you can accomplish that using the command below:

save configuration as-script default

That means a file name as "default.xsf" will be created and loaded every time you do an "unconfigure switch all"

After the switch reboot you can just do "save configuration" so that a .cfg (XML) file is created.
Userlevel 7
Hi Jerry,
When you
code:
use configuration
, make sure you aren't saving the config before rebooting. You're effectively overwriting the "saved" config with the current blank one.

Anytime you use
code:
unconfigure switch all
the switch will boot to a defaulted configuration and you won't have an IP on the VLAN to use.
You may also find it useful to name your config script (not the XML) "
code:
default.xsf
." This will execute anytime the switch is booted from a default configuration.
Henrique, Andreas, and Drew,

Thank You! I just tested it on a switch at my desk and it does exactly what I needed it to do. I will be testing it on a production switch later this week or weekend.
Userlevel 7
Jerry wrote:

Henrique, Andreas, and Drew,

Thank You! I just tested it on a switch at my desk and it does exactly what I needed it to do. I will be testing it on a production switch later this week or weekend.

Great! Glad we could help!

Reply