> For the complete documentation index, see [llms.txt](https://jncia-workbook.gitbook.io/workbook/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://jncia-workbook.gitbook.io/workbook/junos-basics/2-restore-factory-default-config-method-1.md).

# 2) Restore Factory-Default Config (Method 1)

In addition to resetting the root password on a new device, you will likely want to restore to the factory default config. You also may want to do this when decommissioning hardware.

Telnet to R1 (`telnet 10.200.255.2 5000`). (In our pretend scenario, you would login with **root**, but you may also login with the **admin** credentials).

Your task is to forcefully reset the configuration to factory-default, ensuring that all log files, and other settings are wiped.

### Answer

<details>

<summary>Expand to reveal</summary>

Use the operational command `request system zeroize`

```
admin@R1> request system zeroize 
warning: System will be rebooted and may not boot without configuration
Erase all data, including configuration and log files?. In case of Dual RE system, both Routing Engines will be zeroized [yes,no] (no) yes

```

\
After a few minutes, the router will be back up with a default configuration.

\
**Important**: Notice the command prompt now:

```
FreeBSD/amd64 (Amnesiac) (ttyu0)

login: 

```

\
The hostname **Amnesiac** indicates that the router is on the default configuration. If the router had a hostname set, that hostname would be in the parenthesis instead.

\
Login with **root** and no password. (The factory-default configuration does not have a root password set, you must set this yourself).

\
Run **cli** to access the Junos CLI:

```
root@:~ # cli
root> 
```

\
Take a look at the default configuration:

```
root> show configuration 
## Last commit: 2026-07-08 15:42:15 UTC by root
version 25.4R1.12;
system {
    syslog {
        file interactive-commands {
            interactive-commands any;
        }
        file messages {
            any notice;
            authorization info;
        }
    }
    processes {
        dhcp-service {
            traceoptions {
                file dhcp_logfile size 10m;
                level all;
                flag packet;
            }
        }
    }
    ## Warning: missing mandatory statement(s): 'root-authentication'
}
chassis {                               
    auto-image-upgrade;
}
interfaces {
    fxp0 {
        unit 0 {
            family inet {
                dhcp {
                    vendor-id Juniper-vmx-VM6A4E67CB1D;
                }
            }
            family inet6 {
                dhcpv6-client {
                    client-type stateful;
                    client-ia-type ia-na;
                    client-identifier duid-type duid-ll;
                    vendor-id Juniper:vmx:VM6A4E67CB1D;
                }
            }
        }
    }
}
protocols {
    router-advertisement {              
        interface fxp0.0 {
            managed-configuration;
        }
    }
}

root> 

```

</details>

### Explanation

<details>

<summary>Expand to reveal</summary>

Zeroizing the device is a quick way to completely wipe it. This is a useful way to safely wipe the device, including all files.

\
However, be careful that even things like license files may be wiped, requiring you to re-apply them.

\
For more in-depth details of the zeroize command, see this link: <https://supportportal.juniper.net/s/article/SRX-Files-that-are-deleted-by-request-system-zeroize-are-recovered-by-the-autorecovery-feature>

* If the autorecovery feature is enabled, license and configuration is retained. To fully wipe the system, you would need to first use `request system autorecovery state clear` to disable autorecovery, and then run the zeroize command.

</details>

### Further Reading

<https://www.juniper.net/documentation/us/en/software/junos/cli-reference/topics/ref/command/request-system-zeroize.html>
