Junos CLI Navigation is the topic of this section. in other words how to navigate command hierarchy and how it helps us to configure juniper devices.

Junos CLI Navigation overview

Although we have seen and manipulated various Junos CLI hierarchical levels in the previous sections, in this section we will get to know them in more detail.

Juniper Junos CLI Navigation
Juniper Junos CLI Navigation

As you know with “configure” command, we change CLI environment from “operational” mode to “configuration” mode.

In the configuration mode we will move to the different context using “edit” command. example contexts are “system”, “interfaces” and “security”.

Contexts have a hierarchical structure in which we can go further down with the “edit” command. for example from “system” context we can move to the “login” and “ntp” or from “security” to “zones” and “policies” sub-context.

It is also possible to go several steps further into the hierarchical structure with the “edit” command. Using the “edit system login” command, we go directly to the “login” sub context under the “system” context.

To go up through the hierarchical structure, we can use the “up” command to go one step up, or use the “top” command to go straight to the top of the hierarchical configuration structure.. With ” exit configuration-mode” we jump from any of hierarchical level in configuration mode into operational mode.

To configure in configuration mode, there are two options.

Juniper Junos configuration options
Juniper Junos configuration options

First, with the “edit” command we go further down in the context that we want to configure something and then we configure it with the “set” command.

The second option is to configure directly from the top-level configuration mode using the “set” command. This second method is mostly used when we copy a command or configure through automation tools.

To better understand the hierarchical structure of the Junos configuration, let’s touch them together.

Junos CLI Navigation practice

With “configure” command we move from operational mode to configuration mode.

Then with “edit system” command, move to the system context. then with “edit services” command move to the “system -> services” context. and finally with “edit ssh” command, move to “system -> services -> ssh” context.

Then we configure our final command with “set” command.

With each “up” commands, we go up through the hierarchical structure. With three “up” commands, we will come back again to the top-level configuration mode.

However, it is possible to go directly to the specified context with the “edit system services ssh” command and then configure the final command with the “set” command.

With “top” command, we will come back straight to the top-level configuration mode.

It is also possible to configure a final command without entering any context using “set” command.

With command “set system services ssh root-login allow”, the same configuration can be implemented straight  from top-level configuration mode

With “exit configuration-mode” command, from any context in configuration mode, you will come back to the operational mode.

rayka@vSRX> configure 
Entering configuration mode

[edit]
rayka@vSRX# edit system 

[edit system]
rayka@vSRX# edit services 

[edit system services]
rayka@vSRX# edit ssh 

[edit system services ssh]
rayka@vSRX# set root-login allow 

[edit system services ssh]
rayka@vSRX# up 

[edit system services]
rayka@vSRX# up 

[edit system]
rayka@vSRX# up 

[edit]
rayka@vSRX# edit system services ssh 

[edit system services ssh]
rayka@vSRX# set root-login allow        

[edit system services ssh]
rayka@vSRX# top 

[edit]
rayka@vSRX# set system services ssh root-login allow 

[edit]
rayka@vSRX# edit system 

[edit system]
rayka@vSRX# exit configuration-mode 
Exiting configuration mode

rayka@vSRX> 
Back to: Juniper Junos Associate version 22.1R1.10 (JNCIA-Junos) > Junos User Interfaces

Leave a Reply

Your email address will not be published. Required fields are marked *


Post comment