Configuration Basics · Topic 1 of 5

Factory Default and Initial Configuration

Learn the Junos factory-default state, why the root password must be set before the first commit, and the first settings to add for JNCIA-Junos JN0-106.

  • 5 min
In a nutshell
  • A factory-default device has no root password; first login is root on the console.
  • No commit succeeds until system root-authentication is set.
  • load factory-default is a configuration mode command; it needs a root password and a commit.

What it is

A new Junos device boots with a factory-default configuration. It is a small working configuration that Juniper ships with the device, and it varies by platform: a branch SRX firewall, an EX switch and an MX router each start with different defaults.

Initial configuration is the short list of settings you add first so the device is secure and reachable: a root password, a host name, a management address, a route to the management network and remote access such as SSH.

Factory defaultno root passwordconsole login as rootSet root passwordHost namemanagement address|SSHcommitReachable device

How it works

The factory-default state

ItemFactory-default state
Root passwordNot set; root can log in on the console without a password
Other user accountsNone
Host nameNot set
System loggingBasic syslog settings are included
Interfaces and servicesPlatform dependent; for example switches and branch firewalls ship with ready-made interface and security settings

You always do the first login on the console port as root. Because root starts in the UNIX shell, you type cli and then configure.

login: root

root@% cli
root> configure
Entering configuration mode

[edit]
root#

The root password rule

Junos will not commit any configuration until a root password is set. If you try, the commit fails with an error about the missing root-authentication statement.

[edit]
root# set system root-authentication plain-text-password
New password:
Retype new password:

With plain-text-password you type the password at the prompt, and Junos stores it only as a hash shown as encrypted-password. You can also give an already hashed value with encrypted-password, or an SSH public key with ssh-rsa.

Returning to the factory default

MethodModeWhat it does
load factory-defaultConfigurationReplaces the candidate with the factory-default configuration; you must set a root password and commit
request system zeroizeOperationalErases all configuration and log files and reboots the device to the factory default

load factory-default is the gentle option: nothing happens until you commit. request system zeroize wipes the device completely, which is what you use before returning or reusing hardware.

Watch out

After load factory-default, the commit fails until you set system root-authentication again, because the factory-default configuration has no root password.

The initial configuration

SettingCommand
Root passwordset system root-authentication plain-text-password
Host nameset system host-name R1
Domain nameset system domain-name example.com
DNS serverset system name-server 192.0.2.53
Time zoneset system time-zone Europe/London
Management addressset interfaces fxp0 unit 0 family inet address 192.168.10.11/24
Default routeset routing-options static route 0.0.0.0/0 next-hop 192.168.10.1
Backup routerset system backup-router 192.168.10.1
Remote accessset system services ssh
An admin accountset system login user admin class super-user authentication plain-text-password

The management interface name depends on the platform: fxp0 on many routers and SRX devices, and me0 or em0 on some switches. It is an out-of-band port for management and does not forward transit traffic.

The backup router is a gateway the device uses to reach the management network when the routing protocol process is not running, for example while the device is booting. Once routing is up, the normal routing table takes over.

Consolerootroot authenticationhost namedomain|DNSfxp0 addressbackup routerssh servicecommitManage over SSH

A worked example

A new router is powered on. The engineer connects to the console, logs in as root with no password, types cli and configure, and sets the root password first.

The engineer then adds the host name R1, the fxp0 address, a backup router, SSH and a super-user account named admin. After commit, the prompt changes to root@R1#, and the engineer can log in remotely as admin over SSH.

Exam tip

Create a named admin account during initial setup and use it for daily work. Root is for recovery, and logging in as root puts you in the shell instead of the CLI.

Common mistakes

Trying to commit before setting the root password. The first commit on a factory-default device always fails without root-authentication.

Thinking load factory-default reboots the device. It only loads the default configuration into the candidate. You still set the root password and commit.

Confusing load factory-default with zeroize. request system zeroize erases the whole configuration and log files and reboots. load factory-default changes only the candidate.

Expecting fxp0 to route user traffic. The management interface is out of band. Transit traffic uses the revenue ports such as ge-0/0/0.

What to remember for the exam

  • A factory-default device has no root password; first login is root on the console.
  • No commit succeeds until system root-authentication is set.
  • load factory-default is a configuration mode command; it needs a root password and a commit.
  • request system zeroize erases the configuration and logs and reboots to factory default.
  • Initial settings live mostly under [edit system]: host-name, domain-name, name-server, time-zone, services ssh, login.
  • backup-router gives a route to the management network while the routing process is not running.

Check yourself

  • Why does the first commit on a new device fail?

    The factory-default configuration has no root password, and Junos will not commit until system root-authentication is set.

  • Which command returns the candidate to the factory default without rebooting?

    load factory-default in configuration mode, followed by a root password and a commit.

  • What is the backup router used for?

    It gives the device a route to the management network when the routing protocol process is not running, such as during boot.

Topic 1 of 5 in Configuration Basics

Test yourself on Configuration Basics

The full Juniper JNCIA-Junos JN0-106 question bank has 1,155 questions, with timed practice exams and an explanation for every answer.

This study guide is independent and is not affiliated with, endorsed by, or sponsored by Juniper. Vendor names, certification names and exam codes are trademarks of their respective owners and are used for identification only.