Basic Juniper Router Configuration – JunOS Commands

Similar to Cisco routers, Juniper routers are also used to perform the routing functions on networks. Before you should start to learn the routing and switching configuration through the Juniper routers, first, you need to be familiar with basic Juniper Router Configuration commands. Here, we are going to explain the step by step Juniper Router Configuration guide.

We hope you have already added Juniper Router in GNS3 and created a topology. If not yet, visit the following link to add Juniper Router in GNS3.

This article will help to understand the most Basic Juniper Router Configuration commands for the beginners who are new to juniper devices.

Juniper Router CLI Commands Modes

Similar to Cisco IOS CLI modes, JunOS also has different command modes to perform different types of configuration tasks. The major JunOS CLI command modes are:

  1. Operational mode: You can compare this mode to the Privileged mode of Cisco IOS. It is used to display the current status of the Juniper device. In this mode, the JunOS commands are used to monitor and troubleshoot the Juniper devices and their network connectivity.
  2. Configuration mode: The configuration mode of Juniper router is almost similar to the Global Configuration mode of Cisco IOS. You use this mode to define all the properties of the Juniper devices. It includes interfaces configuration, general routing information configuration, routing protocols configuration, user access configuration, and various other system and hardware properties configurations.

Basic Juniper Router Configuration Command and Tasks
The following are some of the basic Juniper router configuration tasks that every network administrator should know:

How To Login to Juniper Router

Working with JunOS is almost similar to working with the CLI interface of Linux/UNIX-based operating systems. To login into JunOS Command mode, simply type username and password. The default login credentials for JunOS Olive are: username as root and password is blank.

Login: root

Note: If you face to login into JunOS Olive, please visit the official Website.

How To enter JunOS CLI Mode

Once you logged into JunOS CLI mode, type CLI and press Enter to switch into CLI mode.

[email protected]% cli

How To Switch into JunOS Configuration Mode

As discussed earlier, configuration mode allows you to configure most of the basic JunOS configuration tasks. In order to switch to JunOS configuration mode, type the configure command and press Enter.

root> configure



To exit from the current mode, use the exit command.


How To Check the Current Configurations of a Juniper Router

To check the current configuration settings on a Juniper Router, execute the following command at the Operational CLI mode.

root> show configuration

Viewing configurations command starting with the specific group of commands use the following command syntax. For example, to show all the command of Operation CLI mode starting with “set” prefix, execute the following command.

root> show configuration | display set

How To View the Interface Information on a Juniper Router

To show all the available interfaces on a Juniper Router you are using, use the following command.

root# show interfaces

How To View the Status of a Specific Interface on a Juniper Router

To view the status of a specific interface information on Juniper Router running on JunOS, use the following command syntax.

root# show interfaces

For example, to view the interface configuration information of emo interface, use the following command.

root> show interfaces em0

How To Set IPv4 address on a Juniper Router

To configure an appropriate IPv4 address on a Juniper Router, use the following command syntax.

root# set interfaces <interface name> unit <unit number> family inet <IP address>/mask

For example, use the following command to set IPv4 address on the em0 interface.

root# set interfaces em0 unit 0 family inet

How To Change the Hostname of a Juniper Router

Use the following JunOS CLI command syntax to set the desired hostname for a Juniper Router.

root# set system host-name <type-name>

For example, to change the current hostname to JunOSR1 hostname, use the following command.

root# set system host-name JunOSR1

How To Set Password on a Juniper Router

To set the desired root password for your Juniper Router, execute the following JunOS CLI command.

root# set system root-authentication plain-text-password

New password: [email protected]
Retype new Password: Ju[email protected]

Note: Password will not be displayed.

How To Save JunOS Configuration Permanently

Whatever you do on a Juniper or Cisco router, the current configuration is stored on the temporary memory called RAM. However, if the power supply fails, your configuration will be lost. So, it is important to save your configuration at the regular time intervals. On a Juniper router, the commit command is used to save the current configuration as permanently. Refer the following figure.

root# commit

How To View Routing Table (Routes) on a Juniper Router

The following command is used to view the all the routes on a Juniper Router running on the JunOS.

root> show route

How To Configure Static Route on a Juniper Router

Configuring the static route on a Juniper Router is pretty simple. For example, to add route with as the default gateway, use the following JunOS CLI command.


root# set routing-options static route <Network/Prefix Length> next-hop <Gateway Address>


root# set routing-options static route next-hop

Login To and Logout From JunOS CLI Interface

Take a look at the following figure to understand the command used in the given output.

In this article, we have explained the Basic Juniper Router Configuration Commands used to configure basic tasks for a Juniper Router. Don’t hesitate to share this nice article to your friends.

Leave a comment

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