User Interfaces · Topic 1 of 4

Junos CLI Modes and J-Web

Learn the Junos CLI, operational and configuration mode, configure private and exclusive, the run command and J-Web basics for JNCIA-Junos JN0-106.

  • 5 min
In a nutshell
  • > in the prompt is operational mode; # with an [edit] banner is configuration mode.
  • configure enters configuration mode; configure private gives a private candidate; configure exclusive locks the candidate.
  • run executes an operational command from configuration mode.

What it is

Junos OS gives you two main user interfaces: the command-line interface (CLI) and J-Web, a graphical interface in a web browser. Both work on the same configuration database, so a change committed in one is visible in the other.

The CLI has two modes. Operational mode is for monitoring, troubleshooting and system tasks, and configuration mode is for changing the configuration.

Root loginshell prompttype cliOperational modemonitor and troubleshootconfigureConfiguration modeedit the candidatecommitActive configuration

How it works

CLI functionality

The Junos CLI is a command shell built for network work. It runs on top of the UNIX based core of Junos OS, but it is separate from the UNIX shell.

A normal user lands straight in the CLI in operational mode. The root user lands in the UNIX shell, with a prompt that ends in %, and must type cli to start the Junos CLI.

FeatureWhat it gives you
Command completionSpace and Tab finish partly typed keywords
Context help? lists what you can type next
Command historyUp arrow and Ctrl+P recall earlier commands
Editing keysEmacs style keys such as Ctrl+A and Ctrl+E
Output pipeThe pipe character filters or reformats output, with options such as match and display set
PagingLong output stops at a ---(more)--- prompt

You can tune the CLI session in operational mode, for example set cli screen-length 0 to turn off paging or set cli screen-width to change the line width. These settings apply to your current session only.

Operational mode and configuration mode

Operational modeConfiguration mode
Promptuser@router>user@router#
PurposeView status, troubleshoot, manage files and softwareChange the candidate configuration
Typical commandsshow, monitor, ping, traceroute, clear, request, file, configureset, delete, edit, show, commit, rollback, load, run
Location bannerNone[edit] line above the prompt shows your hierarchy level

The prompt character is the fastest clue in an exhibit. A > means operational mode, and a # with an [edit] banner means configuration mode.

The show command exists in both modes but does different things. In operational mode show interfaces shows interface status, while in configuration mode show interfaces shows the interfaces part of the candidate configuration.

Entering and leaving configuration mode

CommandEffect
configureShared candidate; every user in this mode edits the same copy
configure privateYour own private copy; a commit applies only your changes
configure exclusiveLocks the candidate so other users cannot change or commit it while you edit

With plain configure, Junos warns you if other users are editing, and the status command in configuration mode lists them. A commit in shared mode commits every uncommitted change in the shared candidate, including other people's.

To leave, type exit at the top [edit] level, exit configuration-mode from any level, or commit and-quit to commit and leave in one step. If there are uncommitted changes, Junos asks whether to exit anyway, and the changes stay in the candidate.

Running operational commands from configuration mode

Prefix any operational command with run to use it without leaving configuration mode.

user@router> configure
Entering configuration mode

[edit]
user@router# set system host-name R1

[edit]
user@router# run show interfaces terse ge-0/0/0

[edit]
user@router# commit and-quit
commit complete
Exiting configuration mode

user@R1>

The prompt shows the new host name only after the commit, because the host name lives in the active configuration.

J-Web

J-Web is the browser based interface built into Junos on platforms such as SRX Series firewalls and EX Series switches. You enable it under [edit system services web-management].

[edit]
user@router# set system services web-management https system-generated-certificate
user@router# commit

You can also enable plain http, but HTTPS is the secure choice. You log in with the same Junos user accounts, and your login class controls what you can see and change.

J-Web areaTypical tasks
DashboardSystem information, alarms, resource use at a glance
MonitorInterfaces, routing, events and other live status
ConfigureInterfaces, users, services and protocols through forms
MaintainFiles, software upgrades, configuration history, reboot
TroubleshootPing, traceroute and similar tools

Menu names vary by platform and release, so learn the functions rather than exact menu paths. J-Web edits the same candidate configuration as the CLI, so a change is not active until it is committed, and J-Web can show and roll back earlier configuration versions.

Exam tip

J-Web is not a different configuration. Anything you configure in J-Web appears in show configuration in the CLI after the commit, and the other way round.

Common mistakes

Typing Junos commands at the root shell. The root user starts in the UNIX shell at a % prompt. Commands such as show or configure work only after you type cli.

Using a show command in the wrong mode. In configuration mode show displays configuration, not status. Use run show ... to see operational output from configuration mode.

Expecting configure private to share changes. In configure private, your commit applies only your own changes. In plain configure, a commit applies everyone's changes in the shared candidate.

Forgetting to commit in J-Web. A change saved in a J-Web form sits in the candidate. Until it is committed, the device behaves as before.

Watch out

In shared configure mode another user can commit your half-finished work. Use configure private or configure exclusive when several administrators work on the same device.

What to remember for the exam

  • > in the prompt is operational mode; # with an [edit] banner is configuration mode.
  • configure enters configuration mode; configure private gives a private candidate; configure exclusive locks the candidate.
  • run executes an operational command from configuration mode.
  • Root logs in to the UNIX shell and types cli to reach the Junos CLI.
  • exit configuration-mode leaves from any level; commit and-quit commits and leaves.
  • J-Web is enabled under system services web-management and uses the same accounts and candidate configuration as the CLI.

Check yourself

  • A prompt reads user@R1# under an [edit] banner. Which mode is the user in?

    Configuration mode. The # and the [edit] banner both show it.

  • How do you see interface status without leaving configuration mode?

    Prefix the operational command with run, for example run show interfaces terse.

  • Which configure option stops other users from committing while you edit?

    configure exclusive, which locks the candidate configuration.

Topic 1 of 4 in User Interfaces

Test yourself on User Interfaces

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.