CCNA Live Demo!
CCNA Live Demo!
Starts 23rd Feb at 1 PM | Limited seats.
Day
Hr
Min
Sec
Register for Free!
USD ($)
$
United States Dollar
India Rupee

Junos CLI Basics and Configuration Hierarchy Navigation

Lesson 3/16 | Study Time: 120 Min
Junos CLI Basics and Configuration Hierarchy Navigation

Topology

You will be working with:

● vMX-VCP1 (Control Plane for vMX-1)


Objective

This lab deepens your understanding of the Junos CLI structure, focusing on the hierarchical nature of Junos configuration and teaching you how to navigate efficiently through different configuration levels. You will learn to make configuration changes, compare configurations, and use essential navigation commands that form the foundation of all Junos configuration tasks.


Part 1: Basic Configuration Operations


Task 1: Initial Setup and Access

1. Open a console connection to the vMX-VCP1 device.

2. Log in with username root and password uninets@123.

3. Enter the Junos CLI: cli (you should be at root> prompt).

4. Enter Configuration Mode: configure or edit.

5. Your prompt should now show root# with [edit] displayed above it, indicating you're at the root level of the configuration hierarchy.


Task 2: Understanding Configuration Hierarchy

1. From the [edit] level, view the current candidate configuration:

show

Observe how the configuration is displayed in a structured, indented format. This is Junos's hierarchical configuration model.

2. Take note of your command prompt format:

root@vMX-VCP1#

The vMX-VCP1 part is the device's hostname, which is a configurable system parameter.


Task 3: Making Configuration Changes

1. Change the device's hostname to Test-vMX1:

set system host-name Test-vMX1

2. After pressing Enter, notice that your prompt does not immediately change. This is a crucial Junos concept: changes are made to the candidate configuration, not the active running configuration.

3. Verify your change was accepted by viewing the candidate configuration:

show system host-name

You should see: host-name Test-vMX1;


Task 4: Comparing Configurations

1. View the differences between your candidate configuration (with unsaved changes) and the active running configuration:

show | compare

You should see output similar to:


[edit system]

+   host-name Test-vMX1;

The + indicates this line has been added to the candidate configuration compared to the active configuration.

2. Without committing, undo all your changes and restore the candidate configuration to match the active configuration:

rollback

This command is extremely useful for discarding uncommitted changes.

3. Verify the rollback worked:

show | compare

You should see no output, indicating the configurations are identical.


Part 2: Navigating the Configuration Hierarchy


Task 5: Exploring Configuration Levels

1. From the [edit] level, see what configuration options are available:

set ?

Scroll through the list. Notice interfaces is one of the available top-level configuration stanzas.

2. Move down one level into the interfaces configuration:

edit interfaces

Your prompt should now show [edit interfaces].

3. View the configuration from this level:

show

Notice you now see only the interface configuration, not the entire configuration. This is hierarchical navigation in action.

4. See what options are available at this level:

set ?

The options here differ from those you saw at the [edit] level – they're specific to interface configuration.


Task 6: Navigating Deeper into the Hierarchy

1. Move into a specific interface configuration:

edit ge-0/0/1

Your prompt should now show [edit interfaces ge-0/0/1].

2. Move several levels deeper in a single command:

edit unit 0 family inet

Your prompt should now show [edit interfaces ge-0/0/1 unit 0 family inet].

You are now at the level where IP addresses are configured for this specific interface unit.


Task 7: Navigation Commands

Learn to move efficiently through the hierarchy:

1. Return to the very top (root level):

top

Your prompt should show [edit].

2. Go directly back to the deep level you were at:

edit interfaces ge-0/0/1 unit 0 family inet

3. Move up one level:

up

Your prompt should now show [edit interfaces ge-0/0/1 unit 0].

4. Move up two levels at once:

up 2

Your prompt should now show [edit interfaces].

5. Practice moving back to the deep level:

edit ge-0/0/1 unit 0 family inet


Task 8: Exiting Configuration Mode

Try to exit Configuration Mode from your current deep level:

exit

Observation: You don't return to Operational Mode. Instead, you move up one level to [edit interfaces ge-0/0/1 unit 0].

This demonstrates that exit behaves like up when you're not at the root level.

2. To properly exit Configuration Mode, you must first return to the root level. Do this in one command:

top followed by exit

You should now be back in Operational Mode (root>).

3. Alternatively, from any level, you can use:

exit configuration-mode

This command exits Configuration Mode regardless of your current level.


Part 3: Practical Application


Task 9: Configuring an IP Address

1. Re-enter Configuration Mode: configure

2. Configure an IP address on ge-0/0/1. Instead of using multiple edit commands, use the full path from the root level:

set interfaces ge-0/0/1 unit 0 family inet address 10.1.1.1/24

3. Add a description to the interface:

set interfaces ge-0/0/1 description "Uplink to vMX-VFP2"

4. View just the interface configuration to verify:

show interfaces ge-0/0/1

5. View the differences from the active configuration:

show | compare


Task 10: Discarding Changes and Exiting

1. Discard all your uncommitted changes:

rollback

2. Verify no changes remain:

show | compare

3. Exit Configuration Mode properly:

top then exit

Or use the shortcut: exit configuration-mode


Key Concepts Learned

1. Candidate vs. Active Configuration:

● Changes made in Configuration Mode modify the candidate configuration (a temporary working copy)

● The active configuration is the currently running configuration

● Changes don't take effect until committed

2. Hierarchical Navigation:

● edit <path>: Move down into a configuration level

● up or up <number>: Move up one or more levels

● top: Return to the root [edit] level

● show: Displays configuration from current level downward

3. Configuration Commands:

● set: Add or modify configuration

● show | compare: View differences between candidate and active configurations

● rollback: Discard all uncommitted changes

4. Exiting Properly:

● exit: When at [edit] level, returns to Operational Mode; at other levels, behaves like up

● exit configuration-mode: Always returns to Operational Mode regardless of current level

Common Navigation Patterns


To Do ThisUse This Command
Configure an interface IPset interfaces ge-0/0/1 unit 0 family inet address 10.1.1.1/24
View interface configshow interfaces ge-0/0/1
See what you've changedshowcompare
Undo all changesrollback
Go to root leveltop
Exit to Operational Modetop then exit, or exit configuration-mode


Troubleshooting Tips

●  "Unknown command" error: You're likely at the wrong configuration level. Use top to return to root, or check available commands with set ?

● prompt not changing after hostname change: This is normal until you commit the configuration

● Can't exit Configuration Mode: Use exit configuration-mode from any level, or ensure you're at [edit] before using exit


Real-World Application

Understanding hierarchical navigation is critical for:

● Efficiently locating configuration sections

● Writing configuration scripts

● Troubleshooting configuration issues

● Working with Junos automation tools

The hierarchical model is one of Junos's greatest strengths, providing consistency and predictability across all configuration areas.