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 the prompt is operational mode;#with an[edit]banner is configuration mode.configureenters configuration mode;configure privategives a private candidate;configure exclusivelocks the candidate.runexecutes 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.
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.
| Feature | What it gives you |
|---|---|
| Command completion | Space and Tab finish partly typed keywords |
| Context help | ? lists what you can type next |
| Command history | Up arrow and Ctrl+P recall earlier commands |
| Editing keys | Emacs style keys such as Ctrl+A and Ctrl+E |
| Output pipe | The pipe character filters or reformats output, with options such as match and display set |
| Paging | Long 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 mode | Configuration mode | |
|---|---|---|
| Prompt | user@router> | user@router# |
| Purpose | View status, troubleshoot, manage files and software | Change the candidate configuration |
| Typical commands | show, monitor, ping, traceroute, clear, request, file, configure | set, delete, edit, show, commit, rollback, load, run |
| Location banner | None | [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
| Command | Effect |
|---|---|
configure | Shared candidate; every user in this mode edits the same copy |
configure private | Your own private copy; a commit applies only your changes |
configure exclusive | Locks 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 area | Typical tasks |
|---|---|
| Dashboard | System information, alarms, resource use at a glance |
| Monitor | Interfaces, routing, events and other live status |
| Configure | Interfaces, users, services and protocols through forms |
| Maintain | Files, software upgrades, configuration history, reboot |
| Troubleshoot | Ping, 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.
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.
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.configureenters configuration mode;configure privategives a private candidate;configure exclusivelocks the candidate.runexecutes an operational command from configuration mode.- Root logs in to the UNIX shell and types
clito reach the Junos CLI. exit configuration-modeleaves from any level;commit and-quitcommits and leaves.- J-Web is enabled under
system services web-managementand 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 examplerun 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.