Junos CLI Basics

Learn the fundamentals of the Junos CLI, the Candidate configuration, and the commit model.

Junos CLI Basics

Welcome to the Junos CLI basics. Juniper’s Junos OS relies on a unique and robust configuration model that significantly differs from other vendors like Cisco.

The Candidate Configuration and Commit Model

Junos separates the active configuration (what the device is currently running) from the candidate configuration (the draft configuration you are editing).

When you enter configuration mode, you are modifying the candidate configuration. Changes do not take effect immediately. To apply changes, you must use the commit command. This model prevents partial configurations from causing network outages and allows for easy rollbacks.

Basic Configuration Example

Here is how you navigate between modes and make a basic change:

user@juniper> configure
Entering configuration mode

[edit]
user@juniper# set system host-name core-router-01

[edit]
user@juniper# show system
host-name core-router-01;

[edit]
user@juniper# commit check
configuration check succeeds

[edit]
user@juniper# commit
commit complete

[edit]
user@juniper# exit
Exiting configuration mode

Key Commands

  • configure: Enter configuration mode (edit candidate config).
  • set: Add or modify a configuration statement.
  • delete: Remove a configuration statement.
  • show: View the current level of the candidate configuration.
  • commit check: Verify the syntax and semantics without applying.
  • commit: Apply the candidate configuration to the active configuration.
  • rollback: Revert the candidate configuration to a previous state.