The CLI is the interface to the software that you use whenever you access the router—whether from the console or through a remote network connection. The CLI, which automatically starts after the router finishes booting, provides commands that you use to perform various tasks, including configuring the JUNOSe software and monitoring and troubleshooting the software, network connectivity, and the router hardware.
Managing your router using the CLI gives you access to thousands of commands. The router’s CLI uses an industry de facto standard look and feel, which might be familiar to you. If you are new to this CLI, it is helpful to read this entire chapter, where you can learn about CLI shortcuts and other helpful information.
Command modes set a context for the CLI. Each command in the CLI is available from one or more command modes. From some command modes you can only view router information; from others you can perform configuration tasks. For example, you can access User Exec mode to display information and then access Global Configuration mode to set parameters or enable a particular feature. By recognizing the command-line prompt, you can identify where you are in the CLI at any given point. When you can easily identify where you are, it is easy to get to where you want to be.
Figure 21 illustrates the command mode architecture. Only some of the many configuration modes are shown.
Command modes are discussed in greater detail in the section Accessing Command Modes . See the JUNOSe Command Reference Guide to find related command modes for any command.
Figure 21: Command Mode Architecture

Within the CLI, the command-line prompt identifies both the hostname and the command mode. The hostname is the name of your router; the command mode indicates your location within the CLI system.
For example:
CLI commands are made up of two primary elements: keywords and parameters.
Every command requires at least one keyword; however, a command can contain other optional keywords. The keyword(s) must be typed into the CLI accurately for it to be recognized. These are examples of keywords:
|
|
|
|
|
|
|
|
|
|
You can abbreviate keywords; however, you must enter enough initial characters to unambiguously identify the command. For example, if the keyword you want to specify is map-class and you enter only map-, an error appears. The error indicates that one or more possible keywords begin with map-, thus making your entry ambiguous.
Parameters are often required elements of a command; however, for some commands, parameters are not required. A parameter is most often a value that you specify after the keyword. There are different types of parameters, such as strings, integers, or IP addresses.
The CLI indicates the type of parameter that you must enter. When you see a range of numbers or uppercase letters, it indicates that you must specify a value. For example:
|
CLI Parameter Placeholder or Range |
Sample Parameter User Input |
|---|---|
|
|
|
|
|
|
|
|
|
|
By combining keywords and parameters in the correct sequence, you can begin using the CLI to configure and monitor your router. For example, you could specify the command hostname to change the name of your router by entering a keyword and a parameter. You need to type only the portion of the keyword that makes it unambiguous, such as hostn. Here, the value of the parameter, which is the name you assign to the host, is a string of up to 64 characters.

When you enter this command, the new hostname appears in the prompt.

Another example is a command that requires you to enter a number from within a given range. The command ip http port requires that a value be entered for the portNumber parameter. The value of this parameter is a number in the range of 0–65535. For example, you could enter:
- juniper(config)#ip http port 56789
![]() |
Note: You can find detailed information about command syntax, with parameter values defined, in the JUNOSe Command Reference Guide. |
This section introduces some useful shortcuts and command-related highlights. These include:
The E-series software includes two types of indicators to inform you of the status of your CLI operation.
The progress indicator displays a series of dots that represents the time required to complete the operation. The dots are followed by the actual percentage of the total that has been completed and by an oscillating asterisk that indicates ongoing activity.
As the application progresses, the dots are replaced with asterisks, starting at the left, to represent how much of the operation is finished. The actual percentage is also adjusted accordingly. When the operation is complete, all dots are replaced by asterisks, and the message DONE replaces the numerical percentage.
The number of dots that appears and the percentage of completion represented by each dot or asterisk are based on the terminal width. For example, if the terminal is set to 80 characters, each of the 50 dots indicates 2 percent of the total time (2 percent x 50 characters = 100 percent). See Managing the System for information about setting the terminal width.
The following examples show progress indicator output for a 50-character-wide display.
*****............................................. (10%) *
*********************************************..... (90%) *
************************************************** (DONE)
The CLI has two levels of access: user and privileged.
User level allows you only to view a router’s status. This level restricts you to User Exec mode.
Privileged level allows you to view a router configuration, change a configuration, and run debugging commands. You need a password to access this level. This level gives you full CLI privileges. Passwords are covered in more detail in Managing the System .
Each line module in a router is initialized independently. As a result, the CLI on the SRP module can become available before the line modules have completed initialization. Commands relating to a line module can fail if the module has not completed initialization. The show version command can be used to display line module status. Do not enter commands for a line module until its state is online.