[Contents] [Prev] [Next] [Index] [Report an Error]

Understanding the JUNOS CLI Modes and Command and Statement Hierarchies

The JUNOS command-line interface (CLI) commands and statements are organized under two command modes and various hierarchies. The following sections provide you an overview of the JUNOS CLI command modes and commands and statements hierarchies:

JUNOS CLI Command Modes

The JUNOS CLI has two modes:

When you enter configuration mode, you are actually viewing and changing a file called the candidate configuration. The candidate configuration allows you to make configuration changes without causing operational changes to the current operating configuration, called the active configuration. The router does not implement the changes you added to the candidate configuration until you commit them, which activates the configuration on the router. (See Figure 2.) Candidate configurations enable you to alter your configuration without causing potential damage to your current network operations.

Figure 2: Committing a Configuration

Image g017227.gif

CLI Command Hierarchy

CLI commands are organized in a hierarchy. Commands that perform a similar function are grouped together under the same level of the hierarchy. For example, all commands that display information about the system and the system software are grouped under the show system command, and all commands that display information about the routing table are grouped under the show route command. Figure 3 illustrates a portion of the show command hierarchy.

Figure 3: CLI Command Hierarchy Example

Image h1411.gif

To execute a command, you enter the full command name, starting at the top level of the hierarchy. For example, to display a brief view of the routes in the router table, use the command show route brief.

Configuration Statement Hierarchy

The configuration statement hierarchy has two types of statements: container statements, which are statements that contain other statements, and leaf statements, which do not contain other statements. All of the container and leaf statements together form the configuration hierarchy.

Figure 4 illustrates a part of the hierarchy tree. The protocols statement is a top-level statement at the trunk of the configuration tree. The ospf, area, and interface statements are all subordinate container statements of a higher statement (they are branches of the hierarchy tree), and the hello-interval statement is a leaf on the tree.

Figure 4: Configuration Statement Hierarchy Example

Image h1412.gif

Moving Among Hierarchy Levels

You can use the CLI commands in Table 7 to navigate the levels of the configuration statement hierarchy.

Table 7: CLI Configuration Mode Navigation Commands

Command

Description

edit hierarchy-level

Moves to an existing configuration statement hierarchy or creates a hierarchy and moves to that level.

exit

Moves up the hierarchy to the previous level where you were working. This command is, in effect, the opposite of the edit command. Alternatively, you can use the quit command. exit and quit are interchangeable.

up

Moves up the hierarchy one level at a time.

top

Moves directly to the top level of the hierarchy.

 

Related Topics


[Contents] [Prev] [Next] [Index] [Report an Error]