Posted on April 17, 2020 8:20 pm
 |  Asked by Sayali Upasani
 |  108 views
RESOLVED
0
0
Print Friendly, PDF & Email

Hey Guys,

I wanted to know what is the best way to factory default by Arista Switches without losing management access. So essentially, I need to reset the entire configuration to default except management interface config, SSH state and one of the users.

The purpose it to have a Ansible playbook that when ran would erase everything without me having to have serial console access.

I thought of saving a default config file (with required params in place) on some server and have my playbook pull it and push it into start-up config.

Any other better ideas?

Thank you!

0
Posted by Kenneth Finnegan
Answered on April 17, 2020 8:27 pm

Yeah, I think I would recommend what you've already come up with. Build a minimal config template with just your management interface configured, push it to start-up config, and then if desired, also apply it to the running system with "configure replace startup-config"

0
Posted by Philippe Bureau
Answered on April 20, 2020 1:21 pm

Hello,

You can use "configure session" instead of normal configure mode.

In configure session, you are editing a candidate configuration file, not the running-config.  This means any changes you made are not effective until you enter the "commit" command

By default when you enter in a configuration session, the running-config is copied to your candidate configuration.

In configuration session you can enter "rollback clean-config" which start over with factory default configuration file.

Next add all management config you need.

You can use "show session-config" to view the candidate configuration file.

When happy with your configuration file, enter "commit" to overwrite the running-config with your candidate configuration.

If you do not want to implement the changes, you can enter "abort" in the configuration session to cancel the session and delete the candidate configuration file.  The running configuration will not be affected.

Example :

switch1#configure session Sayali

switch1(config-s-Sayali)#rollback clean-config

switch1(config-s-Sayali)#Interface management1

switch1(config-s-Sayali)#ip addresse 192.168.1.1/24

switch1(config-s-Sayali-if-Ma1)#commit

 

Post your Answer

You must be logged in to post an answer.