Description

On a switch running Junos OS release 12.3 or later, the configuration may be lost after a reboot. This can occur in a unique case when a load factory-default is first executed on the switch, and then a staging configuration is loaded and committed once.

If, at this point, the switch is rebooted or shut down (graceful power-off or power unplugged), the elements from the last load factory-default command may cause the switch to lose the staged configuration and boot up in amnesiac mode.

Note: Committing the configuration just once is important here. If additional configuration changes are made and committed after the initial commit, the issue will not occur.

This article gives more details and suggests what must be done.

 

Symptoms

The switch loses its saved configuration in ~ 5 minutes after it boots up. A user can log in to the switch within the first few minutes using the credentials stored previously.

After the first few minutes, the switch goes into amnesiac mode and the user is able to log in with default credentials (root/ no password).

 

Solution

Using load factory-default causes the addition of the following snippet in the configuration. A couple of configuration files from /etc/config are loaded and merged. The device-specific configuration file has the below lines:

set system commit factory-settings reset-virtual-chassis-configuration;
set system commit factory-setting reset-chassis-lcd-menu;

When an additional configuration is merged with this factory-default configuration and committed just once, the system commit factory-settings continues to remain in the configuration and causes the above issue in the next system bootup.

These settings cause the chassis auto-image upgrade process in concert with ZTP (Zero Touch Provisioning) to run after the system is booted up, leading to the loss of the user-defined configuration.

These files are deleted by a second commit by the MGD process when any configuration is changed after first commit post load factory-default. This does not occur with the first commit after the load factory-default because the MGD process does not detect any change.

 

Use the delete command

If any part of the factory default settings is not required, the best way to completely avoid this situation is to use the delete command in the edit mode to erase the entire existing configuration prior to adding the desired configuration.

Using commit_confirmed + commit

If you started with load factory-default , it is best to load the desired changes and perform commit_confirmed + commit . This deletes the "system commit factory settings".

Making incremental configuration changes with interim commits

A single commit post the 'load factory-default' stage is not detected by the MGD process.

Additional changes can be made after the first commit and it will commit the changes. This is expected to delete the "system commit factory-settings". Two subsequent commits without any changes between them will not make a difference.

Note: Deletion of system commit factory-settings is recommended to be executed post load-factory default. For more information, refer to Reverting to the Default Factory Configuration for the EX-series Switch .

 

Modification History

2020-04-28: Article reviewed for accuracy; no changes required.