Returning to Factory Default in JUNOS

When looking to revert a JUNOS device back to its default settings, the challenge isn’t performing the task itself. That comes in the form of deciding which outcome is most suited to your objective.

This is because there are two methods of returning to the factory settings. The first being load factory-default, which loads the default configuration and the second being request system zeroize, which removes everything bar the operating system. In this article we will go through both methods to help you decide which is best for you.

Removing the Configuration only – load factory-default

If your aim is to only remove the device’s existing configuration then this is the way forward. Not only does this allow you to keep log files and any user-created data files but it can also be completed remotely.

This is due the fact that once the load factory-default command is entered the default configuration is applied to the candidate configuration. Before committing this to the active configuration you are required to set a root password. You can also apply any additional commands, including the recommended initial setup, thus allowing the application of management settings before removing any anything.

As a result, I would be recommend this option if you are already connecting remotely and do not have easy access to the device. Also use it if you want to keep any additional files such as logs or user-created data.

Requirements

  • Potentially physical access

Quick Steps

  1. Gain access to the device via:
    • Serial or
    • SSH/telnet
  2. Login to the device
  3. Apply the following commands:
    • edit
    • load factory-default
    • set system root-authentication plain-text-password
  4. Apply any additional configuration at this step
  5. Save the changes and load the default configuration (plus any new changes) using:
    • commit and-quit

Walkthrough

Removing Everything – request system zeroize media

If the requirement is a totally clean system that feels fresh out of the box then this is the option for you. This process will remove everything except from the operating system and reboot the device, loading a copy of the factory default configuration when it powers back on.

This command is applied in the operational mode and could be considered a process rather than configuration change. Although physical access to the device isn’t required to begin this process, it is afterwards as once the command is entered the process will begin to remove everything from the device immediately, including any remote management configuration.

I would highly recommend using this option if the device in question is second hand or about to be sold on. Not only does it mean that any former data is fully removed but it gives the new user complete free reign over their new device.

Requirements

  • Physical access to the device
  • A serial cable (either an RS-232 or a USB to Console)

Quick Steps

  1. Gain access to the device via:
    • Serial or
    • SSH/telnet
  2. Enter the following command from the operation mode:
    • request system zeroize media
  3. Confirm you wish to go ahead with the process and subsequent reboot by typing:
    • yes
  4. Connect to the device’s console port via serial cable.
  5. Verify the word Amnesiac appears above the login prompt.

If the word Amnesiac does indeed appear then you can be rest assured that the device has successfully been zeroized,. If not then the system has not been cleansed and a repeat attempt of the above steps should be completed.

Walkthrough

You may also like...