Factory-default Configuration on Juniper

In every Junos device, there is a possibility to load the factory-default configuration which is the configuration that Juniper provide it to the Junos device by default.

The way to do it is very easy. But before we apply it, let’s check 1st the current configuration that I have on the Juniper router:

root@R2# show

## Last changed: 2024-02-05 17:52:52 UTC

version 14.1R4.8;

system {

host-name R2;

root-authentication {

encrypted-password “$1$3hHX87WB$VlIPrcgAMz9TInBYol9.U/”; ## SECRET-DATA

}

login {

user Brian {

uid 2002;

class super-user;

authentication {

encrypted-password “$1$R8WYawVo$lSoc3h5PTgP8XdRkwKF371”; ## SECRET-DATA

}

}

user Jack {

uid 2000;

class read-only;

authentication {

encrypted-password “$1$3x3wZw7H$4IwR6bNhmvw0F5bPs8nWX.”; ## SECRET-DATA

}

—(more)—

I am just showing the 1st page of the “show” command where I can see that I have previously created many users when I was doing the previous LABs.

I would like now to load the factory-default configuration on the Juniper router:

root@R2# load ?

Possible completions:

factory-default     Override existing configuration with factory default

merge                   Merge contents with existing configuration

override               Override existing configuration

patch                    Load patch file into configuration

replace                 Replace configuration data

set                        Execute set of commands on existing configuration

update                 Update existing configuration

When I write “load ?” it shows me the possible completions to the command and one of them is the “factory-default”. Let’s apply it now:

root@R2# load factory-default

warning: activating factory configuration

[edit]

root@R2#

This has been applied, and now the factory-default configuration has been loaded to the candidate configuration but not yet to the active configuration. To have it in the active configuration, we need to write “commit” after we load the factory-default configuration.

Let’s check 1st if the candidate configuration has been changed successfully to the factory-default one:

root@R2# show

## Last changed: 2024-02-05 18:04:09 UTC

system {

syslog {

user * {

any emergency;

}

file messages {

any notice;

authorization info;

}

file interactive-commands {

interactive-commands any;

}

}

## Warning: missing mandatory statement(s): ‘root-authentication’

}

[edit]

root@R2#

Indeed, I do not see anymore the users on the candidate configuration. But again, if we want to apply this new configuration to the router, it should be saved to the active configuration. Let’s apply a commit command so the candidate configuration is saved to the active configuration:

root@R2# commit

[edit]

‘system’

Missing mandatory statement: ‘root-authentication’

error: commit failed: (missing mandatory statements)

[edit]

root@R2#

Oh! The commit did not work because once we loaded the factory-default configuration to the candidate configuration, it has reset the root password and made it blank, and to save the configuration you need to put a password to the root.

Let’s do that and see if the commit will work:

root@R2# set system root-authentication plain-text-password

New password:

Retype new password:

[edit]

root@R2# commit

commit complete

[edit]

root@R2#

Now it is working perfectly 😊

Last thing, I want to see if the active configuration has the factory-default configuration loaded on it:

root@R2> show configuration

## Last commit: 2024-02-05 18:09:57 UTC by root

version 14.1R4.8;

system {

root-authentication {

encrypted-password “$1$J2Be9GcK$KqcscPTTnpyczdQoLhlAR/”; ## SECRET-DATA

}

syslog {

user * {

any emergency;

}

file messages {

any notice;

authorization info;

}

file interactive-commands {

interactive-commands any;

}

}

}

root@R2>

Yes indeed, this is working now 😊

I hope you enjoyed this lesson, and see you in the upcoming one.

Course Content

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *


The reCAPTCHA verification period has expired. Please reload the page.

About