Opposite of "save configuration as-script"

  • 0
  • 1
  • Question
  • Updated 2 years ago
  • Answered
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 <new_name>.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 <new_name>.cfg" to utilize my new config.

Any help would be greatly appreciated,
Jerry
Photo of Jerry

Jerry

  • 102 Points 100 badge 2x thumb

Posted 2 years ago

  • 0
  • 1
Photo of Henrique

Henrique, Employee

  • 10,302 Points 10k badge 2x thumb
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"
Photo of Henrique

Henrique, Employee

  • 10,302 Points 10k badge 2x thumb
After the switch reboot you can just do "save configuration" so that a .cfg (XML) file is created.
Photo of andreas

andreas

  • 1,218 Points 1k badge 2x thumb
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 )
Photo of Drew C.

Drew C., Community Manager

  • 38,546 Points 20k badge 2x thumb
Hi Jerry,
When you 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 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) "default.xsf."  This will execute anytime the switch is booted from a default configuration.
(Edited)
Photo of Jerry

Jerry

  • 102 Points 100 badge 2x thumb
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.
Photo of Drew C.

Drew C., Community Manager

  • 38,276 Points 20k badge 2x thumb
Great!  Glad we could help!