02_The CLI

February 10, 2018 in juniper ‐ 2 min read

The CLI or Command Line Interface is a textbased konfiguration utility. With it you can get information about the current konfiguration and staus of the device or change the configuration.

Basics

When you are connected to the Router your prompt looks something like this.

image

Root is the user you are logged in with and you are working on Routing Engine 0. To start the CLI simply type cli.

image

There are two modes in wich you can operate, operational and configuration. You will always enter the cli in the operational mode.

In operational mode you prompt is > and in configuration mode it is #.

In the operational mode you will get informations on the current state of the Router like:

  • What does the current mac address table look like
  • How much Watt is used on Interface ge-0/0/3 over POE right now?

In the configuration mode you can check and change the configuration:

  • What is the configuration on Interface ge-0/0/3?
  • Change what v-lans are tagged on Interface ge-0/0/3

Changes to the config are not live on Juniper! You change whats called a candidate config. To let the changes take effekct you have to run the commit command.

Finding Commands

In both modes you have a lot of commands you can choose from. Wich ones is depending on what device you have and firmware version you have isntalled.

You can list all available command in the mode you are currently in with ?.

To see what parameters a command has you can type another ? after it. < [Enter]> means that the command can be executed at this point.

image

If you want to get more information regarding a command you can use the builtin help.

Help Apropos Is listing ALL possible commands containing the searchstring. Is capable of regex.

  • Help Apropos vlan → is finding very much
  • Help Apropos „*vlan “ → is finding only what is ending in vlan
  • Help Apropos „ vlan „ → is finding only “vlan” as a single word

 

Help Refference Same as manpage

  • Help Refference snmp alarm → dscribes function and syntax
  • Help Refference ospf area → describes syntax and options

 

Help Topic Info about usage guidelines

  • help topic interfaces family → explains how to configure protocol families on Juniper Interfaces

Cheers, Ori