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
- A factory-default device has no root password; first login is root on the console.
- No commit succeeds until
system root-authenticationis set. load factory-defaultis 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.
How it works
The factory-default state
| Item | Factory-default state |
|---|---|
| Root password | Not set; root can log in on the console without a password |
| Other user accounts | None |
| Host name | Not set |
| System logging | Basic syslog settings are included |
| Interfaces and services | Platform 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
| Method | Mode | What it does |
|---|---|---|
load factory-default | Configuration | Replaces the candidate with the factory-default configuration; you must set a root password and commit |
request system zeroize | Operational | Erases 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.
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
| Setting | Command |
|---|---|
| Root password | set system root-authentication plain-text-password |
| Host name | set system host-name R1 |
| Domain name | set system domain-name example.com |
| DNS server | set system name-server 192.0.2.53 |
| Time zone | set system time-zone Europe/London |
| Management address | set interfaces fxp0 unit 0 family inet address 192.168.10.11/24 |
| Default route | set routing-options static route 0.0.0.0/0 next-hop 192.168.10.1 |
| Backup router | set system backup-router 192.168.10.1 |
| Remote access | set system services ssh |
| An admin account | set 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.
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.
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-authenticationis set. load factory-defaultis a configuration mode command; it needs a root password and a commit.request system zeroizeerases 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-routergives 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-authenticationis set.Which command returns the candidate to the factory default without rebooting?
load factory-defaultin 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.