Introduction To Junos and Cli
Introduction To Junos and Cli
Introduction to Junos and the Command Line Interface (CLI)
Slide 2
Introduction
© 2010 Juniper Networks, Inc. All rights reserved. | www.juniper.net | Proprietary and Confidential
Welcome to the Introduction to Junos the Command Line Interface training program. This
course describes the Juniper Networks Junos operating system as well as the command line
interface (or CLI).
Course FSSCLI © Juniper Networks, Inc. 2
Introduction to Junos and the Command Line Interface (CLI)
Slide 3
© 2010 Juniper Networks, Inc. All rights reserved. CONFIDENTIAL FSSCLI www.juniper.net|3
Throughout this module, you will find slides with valuable detailed information. You can stop
any slide with the Pause button to study the details. You can also read the notes by using the
Notes tab. You can click the Feedback link at anytime to submit suggestions or corrections
directly to the Juniper Networks eLearning team.
Course FSSCLI © Juniper Networks, Inc. 3
Introduction to Junos and the Command Line Interface (CLI)
Slide 4
Course Objectives
© 2010 Juniper Networks, Inc. All rights reserved. CONFIDENTIAL FSSCLI www.juniper.net|4
Course FSSCLI © Juniper Networks, Inc. 4
Introduction to Junos and the Command Line Interface (CLI)
Slide 5
Initial Configuration
© 2010 Juniper Networks, Inc. All rights reserved. | www.juniper.net | Proprietary and Confidential
Course FSSCLI © Juniper Networks, Inc. 5
Introduction to Junos and the Command Line Interface (CLI)
Slide 6
Section Overview
In this section, you will learn how to
initially configure a Junos device.
After successfully completing this
section, you will be able to:
• Power on and off a Junos device
• Describe the factory-default configuration and
how to load it.
• Explain the initial configuration checklist
• Log in as Root
• Enter Configuration Mode
• Define the root password
• Define the system’s hostname
• Set the system’s time
• Enable access protocols
• Configure the management Ethernet Interface
• Define the static route for management traffic
• Activate the initial configuration
• View the resulting configuration
• Set the rescue configuration
• Log out
© 2010 Juniper Networks, Inc. All rights reserved. CONFIDENTIAL FSSCLI www.juniper.net|6
In this section, you will learn how to initially configure a Junos device.
After successfully completing this section, you will be able to:
Power on and off a Junos device
Describe the factory-default configuration and how to load it.
Explain the initial configuration checklist
Log in as Root
Enter Configuration Mode
Define the root password
Define the system’s hostname
Set the system’s time
Enable access protocols
Configure the management Ethernet Interface
Define the static route for management traffic
Activate the initial configuration
View the resulting configuration
Set the rescue configuration, and
Log out
Course FSSCLI © Juniper Networks, Inc. 6
Introduction to Junos and the Command Line Interface (CLI)
Slide 7
© 2010 Juniper Networks, Inc. All rights reserved. CONFIDENTIAL FSSCLI www.juniper.net|7
By now, you’ve probably connected power and turned on the device, but in case you haven’t,
go ahead and do that now. Always refer to the safety guidelines shipped with your device to
avoid accidents and injury.
If power is disrupted, Junos devices automatically power back up when the power is
restored. In other words, no manual intervention is required when power is temporarily
interrupted.
Course FSSCLI © Juniper Networks, Inc. 7
Introduction to Junos and the Command Line Interface (CLI)
Slide 8
© 2010 Juniper Networks, Inc. All rights reserved. CONFIDENTIAL FSSCLI www.juniper.net|8
If you need to remove power from a Junos device, you should shut the system down
gracefully. Since Junos software is a multitasking operating system, an abrupt removal of
power could potentially corrupt the file system and prevent the system from booting properly.
Course FSSCLI © Juniper Networks, Inc. 8
Introduction to Junos and the Command Line Interface (CLI)
Slide 9
© 2010 Juniper Networks, Inc. All rights reserved. CONFIDENTIAL FSSCLI www.juniper.net|9
To gracefully shut down Junos, use the request system halt CLI command.
As shown on the screen, the request system halt command provides a number of options
which allow you to schedule the time of a system shut down, specify the media from which
the next boot up operation should use, and log a user-defined message to the console and
the messages log file.
Course FSSCLI © Juniper Networks, Inc. 9
Introduction to Junos and the Command Line Interface (CLI)
Slide 10
© 2010 Juniper Networks, Inc. All rights reserved. CONFIDENTIAL FSSCLI www.juniper.net|10
All factory-default configurations, regardless of the Junos platform, allow initial access
through the root account. You may remember, we mentioned earlier there is no configured
password for the root account.
In addition to the root account, factory-default configurations include system logging (or
syslog) parameters, which tracks system events and writes those events to pre-defined log
files.
We discuss system logging in greater detail in the secondary system configuration section.
All other configuration parameters found within a factory-default configuration are platform
or model-specific.
There might instances when you want to return a Junos device to its factory-default
configuration.
Course FSSCLI © Juniper Networks, Inc. 10
Introduction to Junos and the Command Line Interface (CLI)
Slide 11
© 2010 Juniper Networks, Inc. All rights reserved. CONFIDENTIAL FSSCLI www.juniper.net|11
You can overwrite the candidate configuration while in configuration mode using the load
factory-default command. Junos does not allow you to save the configuration until you
configure root authentication. So even though you can restore the factory default
configuration, a password is required. Only the first time a device is accessed does it not
require a password.
Also, don’t forget to issue the commit commandto activate your changes.
Note that the prompt continues to display the previously defined hostname until the system
is rebooted.
Course FSSCLI © Juniper Networks, Inc. 11
Introduction to Junos and the Command Line Interface (CLI)
Slide 12
© 2010 Juniper Networks, Inc. All rights reserved. CONFIDENTIAL FSSCLI www.juniper.net|12
For security purposes, Junos requires that a root password be configured before any other
modifications to the factory-default configuration are made. The root password, as well as
the password for any other user, must be six characters or longer and must include a change
of case, digits, or punctuation.
In addition to the root password, Juniper also recommends that you configure the device’s
hostname, the system’s time, system services to allow remote access, and the management
network parameters. We’ll walk you through these tasks typically associated with creating an
initial configuration.
Course FSSCLI © Juniper Networks, Inc. 12
Introduction to Junos and the Command Line Interface (CLI)
Slide 13
Logging in as Root
Logging in as Root:
• Amnesiac indicates these is no current hostname
assigned
• Log in as root
• Begin CLI by typing cli at the UNIX shell
• Use the exit command to log out and return to UNIX
shell
© 2010 Juniper Networks, Inc. All rights reserved. CONFIDENTIAL FSSCLI www.juniper.net|13
Before any configuration takes place you have to log into the system. The presence of
Amnesiac, at the login prompt, indicates there’s no current hostname assigned to the device
which is to be expected since you’re logging in to a device with a factory-default
configuration.
At the log in prompt, type root and press enter. Notice that no password is required. When
you log in as the root user, you’re placed at the UNIX shell. You must start the CLI by typing
the cli command and pressing enter.
When you exit the CLI, you return to the UNIX shell. For security reasons, make sure you also
log out of the shell using the exit command.
Course FSSCLI © Juniper Networks, Inc. 13
Introduction to Junos and the Command Line Interface (CLI)
Slide 14
© 2010 Juniper Networks, Inc. All rights reserved. CONFIDENTIAL FSSCLI www.juniper.net|14
To Enter into configuration mode, type the wordConfigure and then hit the enter key. This
will enter you into configuration mode from operational mode.
Course FSSCLI © Juniper Networks, Inc. 14
Introduction to Junos and the Command Line Interface (CLI)
Slide 15
© 2010 Juniper Networks, Inc. All rights reserved. CONFIDENTIAL FSSCLI www.juniper.net|15
Now that you’re in configuration mode, let’s make our first change to the candidate
configuration file by defining a root password.
Here, you’re presented with a prompt where you can enter the new password.
Once again, you’re presented with a prompt where you confirm the new password.
Course FSSCLI © Juniper Networks, Inc. 15
Introduction to Junos and the Command Line Interface (CLI)
Slide 16
Junos passwords:
• Must be at least 6 characters
• Can include most character classes (alphabetic,
numeric, and special characters), except control
characters
• Must contain at least one change of case or character
class
© 2010 Juniper Networks, Inc. All rights reserved. CONFIDENTIAL FSSCLI www.juniper.net|16
Course FSSCLI © Juniper Networks, Inc. 16
Introduction to Junos and the Command Line Interface (CLI)
Slide 17
© 2010 Juniper Networks, Inc. All rights reserved. CONFIDENTIAL FSSCLI www.juniper.net|17
To help identify individual devices within your network environment, you should assign
unique host names to each system.
To configure the system’s host name, type set host-name, then the desired host name and
press enter. Here, we’ve used the hostname “host”.
Course FSSCLI © Juniper Networks, Inc. 17
Introduction to Junos and the Command Line Interface (CLI)
Slide 18
© 2010 Juniper Networks, Inc. All rights reserved. CONFIDENTIAL FSSCLI www.juniper.net|18
To maintain consistent time on devices, you should configure your system’s time
parameters.
You can configure the current date and time information along with the proper time zone for
the device. Or even better, you can use the Network Time Protocol (or NTP) on all of your
network devices so the time is synchronized. This can come in handy if a network problem
occurs and you need to compare system logs from multiple devices.
Course FSSCLI © Juniper Networks, Inc. 18
Introduction to Junos and the Command Line Interface (CLI)
Slide 19
© 2010 Juniper Networks, Inc. All rights reserved. CONFIDENTIAL FSSCLI www.juniper.net|19
To set the NTP server time, the command that is entered into the [edit system] parameters
is: set ntp server then the IP address of the server.
Course FSSCLI © Juniper Networks, Inc. 19
Introduction to Junos and the Command Line Interface (CLI)
Slide 20
© 2010 Juniper Networks, Inc. All rights reserved. CONFIDENTIAL FSSCLI www.juniper.net|20
To ensure your system synchronizes its time with the NTP server when booting, you need to
define an NTP boot server. This is typically the same device functioning as the primary NTP
server.
Course FSSCLI © Juniper Networks, Inc. 20
Introduction to Junos and the Command Line Interface (CLI)
Slide 21
© 2010 Juniper Networks, Inc. All rights reserved. CONFIDENTIAL FSSCLI www.juniper.net|21
To set the device to the local time, first set the time zone with set time-zone and the desired
time zone. Here, we've set the time zone to Los Angeles but this is just an example. You can
select the option for your specific location.
Then you set the time by entering the year, month, date, time format. So for instance, the
command run set date 200911070900.00 sets the time to 9:00 AM on November 7, 2009.
Note that the system time is defined in operational mode rather than configuration mode.
Course FSSCLI © Juniper Networks, Inc. 21
Introduction to Junos and the Command Line Interface (CLI)
Slide 22
© 2010 Juniper Networks, Inc. All rights reserved. CONFIDENTIAL FSSCLI www.juniper.net|22
You may want to access your Junos device in the future through Telnet or SSH. In order to do
that you must enable those services..
Course FSSCLI © Juniper Networks, Inc. 22
Introduction to Junos and the Command Line Interface (CLI)
Slide 23
Assigning a Management IP
Address:
• Navigate to the [edit
interfaces] level using top edit
interfaces command
• the set interface interface-set-
name unit unit-number family
inet address command to
assign the management
interface.
© 2010 Juniper Networks, Inc. All rights reserved. CONFIDENTIAL FSSCLI www.juniper.net|23
Before remote access is possible, you must assign the system an IP address. You may
remember that most Junos devices have a dedicated management Ethernet port, which is
specifically designed for remote access through an access protocol such as Telnet or SSH.
Let’s assign a management IP address to the system’s management Ethernet interface now.
First, we need to navigate to the [edit interfaces] hierarchy level. To do this, you would enter
the top and edit interfaces CLI commands separatelyor you can combine the two commands
and simply enter the top edit interfaces command as shown here.
Then, you enter the command, set interface-name, unit number, family inet address. Here,
we've used ge-0/0/0 as the interface name, unit 0, and family inet address
10.210.14.131/27 as an example. Then press enter to assign the management interface.
Notice in this case the management Ethernet interface is ge-0/0/0. The management
Ethernet interface can vary between Junos devices.
Course FSSCLI © Juniper Networks, Inc. 23
Introduction to Junos and the Command Line Interface (CLI)
Slide 24
© 2010 Juniper Networks, Inc. All rights reserved. CONFIDENTIAL FSSCLI www.juniper.net|24
When accessing a Junos device from a remote network through the management network,
you’ll need to define a static route to the remote network with a next hop address assigned
to a device on the management network.
In our example scenario, the management network is 10.210.14.128/27. Let’s assume that
the remote network from which you’ll be connecting to this device is 10.210.0.0/16 and the
device used as a next hop to reach that remote network is 10.210.14.129
Let’s add a static route that will accommodate management traffic from that remote
network.
Enter top edit routing-options at the CLI command [edit routing-options] hierarchy level.
Course FSSCLI © Juniper Networks, Inc. 24
Introduction to Junos and the Command Line Interface (CLI)
Slide 25
© 2010 Juniper Networks, Inc. All rights reserved. CONFIDENTIAL FSSCLI www.juniper.net|25
Next, type the command set static route 10.210.0.0/16next-hop 10.210.14.129 no-
readvertise.
Typically, static routes used for management traffic are only used by the local device and
should not be readvertised to other devices connected through inband networks. We’ve
included the no-readvertise option to exclude the route from being mistakenly readvertised
in to a dynamic routing protocol, such as OSPF, through routing policy.
Course FSSCLI © Juniper Networks, Inc. 25
Introduction to Junos and the Command Line Interface (CLI)
Slide 26
© 2010 Juniper Networks, Inc. All rights reserved. CONFIDENTIAL FSSCLI www.juniper.net|26
Now that we’ve made the initial modifications to the configuration, we’ll activate the
candidate configuration and return to operational mode. To do that, you issue the commit
command in conjunction with the exit command. Or you can simply enter the commit and-
quit command to save time.
Notice that the configured host name now appears. This is evidence that your changes have
taken effect.
Course FSSCLI © Juniper Networks, Inc. 26
Introduction to Junos and the Command Line Interface (CLI)
Slide 27
© 2010 Juniper Networks, Inc. All rights reserved. CONFIDENTIAL FSSCLI www.juniper.net|27
You can use the show configuration command under operational mode to view the most
current candidate configuration.
Course FSSCLI © Juniper Networks, Inc. 27
Introduction to Junos and the Command Line Interface (CLI)
Slide 28
© 2010 Juniper Networks, Inc. All rights reserved. CONFIDENTIAL FSSCLI www.juniper.net|28
Now that we’ve defined the initial configuration and ensured basic connectivity to the device
through the management network is available, you should consider saving the configuration
as the rescue configuration file. A rescue configuration is a user-defined, known-good
configuration designed to restore connectivity in the event of configuration problems. We
recommend that the rescue configuration contain the minimum elements necessary to
restore network connectivity. For added security, the rescue configuration must include a
root password.
Course FSSCLI © Juniper Networks, Inc. 28
Introduction to Junos and the Command Line Interface (CLI)
Slide 29
© 2010 Juniper Networks, Inc. All rights reserved. CONFIDENTIAL FSSCLI www.juniper.net|29
You can save the active configuration as the rescue configuration using the CLI’s
operational-mode request system configuration rescue save command. If a rescue
configuration already exists, the request system configuration rescue save command
replaces the rescue configuration file with the contents from the active configuration. To
manually delete the current rescue configuration, issue the request system configuration
rescue delete command.
Once saved, you can load the rescue configuration by entering the rollback rescue
configuration-mode command. Since the rollback operation only replaces the contents of the
candidate configuration, you must issue commit to activate the configuration.
Course FSSCLI © Juniper Networks, Inc. 29
Introduction to Junos and the Command Line Interface (CLI)
Slide 30
Logging out
Logging out:
• To log out of CLI use either exit or quit command
• To log out of the shell use the exit command
© 2010 Juniper Networks, Inc. All rights reserved. CONFIDENTIAL FSSCLI www.juniper.net|30
Since you’re logged in as the root user you’ll not only need to log out of the CLI but you’ll also
need to log out of the shell. This is done using either the exit or quit command.
Course FSSCLI © Juniper Networks, Inc. 30
Introduction to Junos and the Command Line Interface (CLI)
Slide 31
Section Overview
In this section, you learned how to
initially configure a Junos device.
After successfully completing this
section, you should now be able to:
• Power on and off a Junos device
• Describe the factory-default configuration and
how to load it.
• Explain the initial configuration checklist
• Log in as Root
• Enter Configuration Mode
• Define the root password
• Define the system’s hostname
• Set the system’s time
• Enable access protocols
• Configure the management Ethernet Interface
• Define the static route for management traffic
• Activate the initial configuration
• View the resulting configuration
• Set the rescue configuration
• Log out
© 2010 Juniper Networks, Inc. All rights reserved. CONFIDENTIAL FSSCLI www.juniper.net|31
In this section, you will learn how to initially configure a Junos device.
After successfully completing this section, you will be able to:
Power on and off a Junos device
Describe the factory-default configuration and how to load it.
Explain the initial configuration checklist
Log in as Root
Enter Configuration Mode
Define the root password
Define the system’s hostname
Set the system’s time
Enable access protocols
Configure the management Ethernet Interface
Define the static route for management traffic
Activate the initial configuration
View the resulting configuration
Set the rescue configuration, and
Log out
Course FSSCLI © Juniper Networks, Inc. 31
Introduction to Junos and the Command Line Interface (CLI)
Slide 32
© 2010 Juniper Networks, Inc. All rights reserved. | www.juniper.net | Proprietary and Confidential
Course FSSCLI © Juniper Networks, Inc. 32
Introduction to Junos and the Command Line Interface (CLI)
Slide 33
Section Overview
In this section, you will learn about
operational monitoring and maintenance
on a Junos device.
After successfully completing this
section, you will be able to:
• Describe the monitoring tools
• Monitor system-level operation
• Monitor the chassis
• Verify interface status
• Explain the differences between terse output
and extensive output
• Describe monitoring interfaces
• Describe the network utilities: ping and
traceroute; monitoring traffic; and Telnet, SSH,
and FTP commands
• Display the Junos version
• Explain the Junos naming convention
• Upgrade Junos software
• Recover the password
© 2010 Juniper Networks, Inc. All rights reserved. CONFIDENTIAL FSSCLI www.juniper.net|33
In this section, you will learn about operational monitoring and maintenance on a Junos
device.
After successfully completing this section, you will be able to:
Describe the monitoring tools
Monitor system-level operation
Monitor the chassis
Verify interface status
Explain the differences between terse output and extensive output
Describe monitoring interfaces
Describe the network utilities: ping and traceroute; monitoring traffic; and Telnet, SSH,
and FTP commands
Display the Junos version
Explain the Junos naming convention
Upgrade Junos software, and
Recover the password
Course FSSCLI © Juniper Networks, Inc. 33
Introduction to Junos and the Command Line Interface (CLI)
Slide 34
Monitoring Tools
© 2010 Juniper Networks, Inc. All rights reserved. CONFIDENTIAL FSSCLI www.juniper.net|34
Now that we’ve covered some of the basic configuration tasks, let’s take a look at how you
perform some basic monitoring and maintenance.
We’ll start with monitoring.
The primary monitoring tool for Junos is the Junos CLI itself. The CLI includes several show
and monitor commands which facilitate system monitoring. We’ll highlight many of the CLI
monitoring capabilities shortly.
In addition to the Junos CLI, a number of secondary monitoring tools exist such as the J Web,
SNMP, hardware LEDs, and front-panel displays or LCDs.
For specific details on a particular platform, check the technical publications at the link
onscreen.
Course FSSCLI © Juniper Networks, Inc. 34
Introduction to Junos and the Command Line Interface (CLI)
Slide 35
© 2010 Juniper Networks, Inc. All rights reserved. CONFIDENTIAL FSSCLI www.juniper.net|35
You can use the CLI to obtain most system information by using the show system
commands.
Let’s look at some of the most common commands.
The boot-messages argument displays the messages seen during the last system boot.
The connections argument displays the status of local TCP and UDP connections.
The statistics argument provides options for viewing various protocol statistics.
The storage argument displays the status of the file system storage space.
Course FSSCLI © Juniper Networks, Inc. 35
Introduction to Junos and the Command Line Interface (CLI)
Slide 36
© 2010 Juniper Networks, Inc. All rights reserved. CONFIDENTIAL FSSCLI www.juniper.net|36
You can monitor the chassis and obtain chassis information using show chassis commands.
The following arguments are some of the most common:
The environment argument displays component and environmental status as well as the
operational speeds of the cooling system.
The hardware argument displays an inventory of the installed hardware components along
with each component’s serial number.
The routing-engine argument provides operational status and utilization details for the
routing engine.
Course FSSCLI © Juniper Networks, Inc. 36
Introduction to Junos and the Command Line Interface (CLI)
Slide 37
© 2010 Juniper Networks, Inc. All rights reserved. CONFIDENTIAL FSSCLI www.juniper.net|37
You can use the show interfaces command to verify various details and status information
for interfaces. A number of command options exist that determine the generated output for
the show interfaces command.
Here, you can see we used the interface-name option, which filters the generated output
and displays details only for the specified interface.
If the interface-name option is excluded, the output displays interface details for all installed
interfaces.
Course FSSCLI © Juniper Networks, Inc. 37
Introduction to Junos and the Command Line Interface (CLI)
Slide 38
Terse Output
© 2010 Juniper Networks, Inc. All rights reserved. CONFIDENTIAL FSSCLI www.juniper.net|38
The example here illustrates the show interfaces terse command. In this example, we’ve
omitted the interface-name option, so all installed interfaces and their accompanying details
are displayed.
This command is ideal when you simply need to verify state information for physical and
logical interfaces.
The output from this command displays all installed interfaces in the left column and
provides state, protocol family, and addressing details to the right of each listed interface.
Course FSSCLI © Juniper Networks, Inc. 38
Introduction to Junos and the Command Line Interface (CLI)
Slide 39
© 2010 Juniper Networks, Inc. All rights reserved. CONFIDENTIAL FSSCLI www.juniper.net|39
An alternative to the terse command is the show interface extensive command, which you
can use to view detailed information for a named interface (or all interfaces when a specific
interface is not identified).
The example here shows a portion of the generated output when using the extensive option.
This command is ideal for investigating or troubleshooting interfaces because it shows
extensive physical and logical interface properties. It’s also a great command when
determining default settings for interfaces.
Course FSSCLI © Juniper Networks, Inc. 39
Introduction to Junos and the Command Line Interface (CLI)
Slide 40
© 2010 Juniper Networks, Inc. All rights reserved. CONFIDENTIAL FSSCLI www.juniper.net|40
Here you can see typical output from the monitor interface command. Your terminal session
must support VT100 emulation for the screen to display correctly.
This command provides real-time packet and byte counters as well as displaying error and
alarm conditions.
To view real-time usage statistics for all interfaces, use the monitor interface traffic
command. The sample output of this command shows how much each field has changed
since you started the command or since you cleared the counters by using the c key.
Course FSSCLI © Juniper Networks, Inc. 40
Introduction to Junos and the Command Line Interface (CLI)
Slide 41
© 2010 Juniper Networks, Inc. All rights reserved. CONFIDENTIAL FSSCLI www.juniper.net|41
Junos provides ping and traceroute utilities which you can use to determine general network
reachability and the path that packets take to reach a destination.
The ping command is issued with a specific destination. The responses you see on-screen
indicate a successful ping test and confirm reachability to the destination.
The traceroute command illustrates the path taken by packets to reach the specified
network host.
Course FSSCLI © Juniper Networks, Inc. 41
Introduction to Junos and the Command Line Interface (CLI)
Slide 42
You can use various arguments with the ping and traceroute commands, such as source IP
address and packet size, to further assist in problem isolation.
By default, the ping utility sends a continuous flow of ICMP echo requests to the referenced
destination. To stop the ping operation, you press the Ctrl+c keys, as we show here.
Alternatively, you can include the count option with a specified number of ICMP echo
requests to send out as shown below:
Course FSSCLI © Juniper Networks, Inc. 42
Introduction to Junos and the Command Line Interface (CLI)
Slide 43
© 2010 Juniper Networks, Inc. All rights reserved. CONFIDENTIAL FSSCLI www.juniper.net|43
Use the monitor traffic command to monitor traffic originating from or terminating on the
Routing Engine. This is used as a troubleshooting tool by including arguments such as
monitor traffic interface. You will also need to specify the interface that will be monitored. If
the interface is not specified, the management interface will be monitored.
Course FSSCLI © Juniper Networks, Inc. 43
Introduction to Junos and the Command Line Interface (CLI)
Slide 44
© 2010 Juniper Networks, Inc. All rights reserved. CONFIDENTIAL FSSCLI www.juniper.net|44
You can also use arguments to specify what type of traffic that should be monitored on an
interface. Specifically, layer 2-header traffic, or detailed or extensive traffic will result in
providing additional information. Adding a no-resolve to a monitor, will avoid delays related
to the reverse lookup process. If you use the matching argument, it will allow matching on a
specific packet field or protocol.
Course FSSCLI © Juniper Networks, Inc. 44
Introduction to Junos and the Command Line Interface (CLI)
Slide 45
© 2010 Juniper Networks, Inc. All rights reserved. CONFIDENTIAL FSSCLI www.juniper.net|45
Junos supports Telnet, SSH and FTP clients. These clients allow you to originate and
establish Telnet, SSH, and FTP sessions from your Junos device.
To transfer files to and from Junos devices, you use the file copy command. The example
here shows the file copy command used in conjunction with the FTP client to transfer a file
from a remote FTP server to the local Junos device.
To initiate Telnet or SSH sessions from your Junos device, you use the telnet or ssh
commands.
Course FSSCLI © Juniper Networks, Inc. 45
Introduction to Junos and the Command Line Interface (CLI)
Slide 46
© 2010 Juniper Networks, Inc. All rights reserved. CONFIDENTIAL FSSCLI www.juniper.net|46
To determine the current Junos version running on your device, you use the show version
command.
You can include the detail option to view additional details about the software packages and
the processes included in the version.
Course FSSCLI © Juniper Networks, Inc. 46
Introduction to Junos and the Command Line Interface (CLI)
Slide 47
© 2010 Juniper Networks, Inc. All rights reserved. CONFIDENTIAL FSSCLI www.juniper.net|47
package is the description of the software contents, and includes jinstall, which is used on
M, T, and MX-series, jinstall-ex, which is used on EX Series, junos-jsr, which is used on J
Series, and junos-srx, which is used on SRX Series. In our example here, the package is
jinstall.
Course FSSCLI © Juniper Networks, Inc. 47
Introduction to Junos and the Command Line Interface (CLI)
Slide 48
© 2010 Juniper Networks, Inc. All rights reserved. CONFIDENTIAL FSSCLI www.juniper.net|48
release describes the Junos version and includes several subcomponents. The release
includes two integers that represent the major and minor release numbers as well as a
capital letter that indicates the type of software release. In most cases, the letter is an R to
indicate that this is released software. If you are involved in testing prereleased software,
this letter might be a B (for beta-level software) or I (for internal, test, or experimental
versions of software). The release also includes a build and spin number for the Junos
version. Here, the release is 9.5R1.8, which is version 9.5, which has been released, build 1,
spin 8.
edition will typically be either domestic or export. Domestic versions support strong
encryption, whereas export versions do not. A third, less common, edition called FIPS exists
which provides advanced network security for customers who must comply with and operate
in a Federal Information Processing Standards (or FIPS) 140-2 environment
Course FSSCLI © Juniper Networks, Inc. 48
Introduction to Junos and the Command Line Interface (CLI)
Slide 49
© 2010 Juniper Networks, Inc. All rights reserved. CONFIDENTIAL FSSCLI www.juniper.net|49
All Junos software is delivered in signed packages that contain digital signatures, Secure
Hash Algorithm (SHA-1), and Message Digest 5 (MD5) checksums. A package is installed
only if the checksum within it matches the hash recorded in its corresponding file. The
actual checksum used depends on the software version.
Course FSSCLI © Juniper Networks, Inc. 49
Introduction to Junos and the Command Line Interface (CLI)
Slide 50
© 2010 Juniper Networks, Inc. All rights reserved. CONFIDENTIAL FSSCLI www.juniper.net|50
To upgrade Junos, you must first download the appropriate image for your Junos device from
the Junos download site. You can download Junos using a web browser or through an FTP
client (including the one on the Junos device itself). Regardless of the download method you
choose, you must have a valid service contract and access account.
To access Junos through an FTP client, initiate an FTP session from an FTP client to the FTP
server using the command ftp ftp.juniper.net. Log in with your customer support-supplied
username and password. Once validated, the FTP session opens. Navigate to the correct
software directory. The server software download structure here is
/volume/download/docroot/software/junos/9.5R1.8. Set the file transfer mode to binary
using the bin command, Next, the directory in which the file should be placed should be
specified. Here we have saved the file to /var/tmp/ location. Finally, download the
installation file using the get command along with the desired file name. In our example we
download the junos-jsr-9.5R1.8-domestic.tgz file. Once the download is complete, close the
FTP session using the bye command.
Course FSSCLI © Juniper Networks, Inc. 50
Introduction to Junos and the Command Line Interface (CLI)
Slide 51
As images are platform specific, you must download the proper image for your
platform.
© 2010 Juniper Networks, Inc. All rights reserved. CONFIDENTIAL FSSCLI www.juniper.net|51
Since individual Junos images are designed for specific Junos platforms, you must ensure
the correct image is downloaded!
Course FSSCLI © Juniper Networks, Inc. 51
Introduction to Junos and the Command Line Interface (CLI)
Slide 52
© 2010 Juniper Networks, Inc. All rights reserved. CONFIDENTIAL FSSCLI www.juniper.net|52
Once you’ve downloaded the image, enter the request system software add <path/image
name> command, where <path/image name> is the local path and file name or the remote
FTP or SCP URI that contains the required Junos image to download and install. To activate
the new software, you must reboot the system. The system reboot can be performed as a
separate step or can be initiated by adding the reboot option at the end of the request
system software add command.
Once Junos is installed, you are notified that the system is rebooting to complete the
installation. You can use a console connection to view details of the upgrade process. Watch
for any error messages indicating a problem with the upgrade.
Course FSSCLI © Juniper Networks, Inc. 52
Introduction to Junos and the Command Line Interface (CLI)
Slide 53
Junos software only executes signed binaries supplied only by Juniper Networks. Each
Junos image includes registered fingerprint for high security.
© 2010 Juniper Networks, Inc. All rights reserved. CONFIDENTIAL FSSCLI www.juniper.net|53
Junos devices run binaries supplied only by Juniper Networks. Each Junos image includes a
digitally signed manifest of executables, which are registered with the system only if the
signature can be validated. Junos does not execute any binary without a registered
fingerprint. This feature is designed to protect the system against unauthorized software and
activity that might compromise the integrity of your Junos device.
Course FSSCLI © Juniper Networks, Inc. 53
Introduction to Junos and the Command Line Interface (CLI)
Slide 54
© 2010 Juniper Networks, Inc. All rights reserved. CONFIDENTIAL FSSCLI www.juniper.net|54
Let’s take a look at an example upgrade. When upgrading Junos, you need to reference the
image name and a local path or a remote server within a Uniform Reference Identifier (or
URI). Junos images copied to a Junos device in preparation for an upgrade should be stored
in the /var/tmp directory.
These images can be deleted later using the request system storage cleanup command.
Although there is typically plenty of storage space, it is a good practice to check available
storage capacity before downloading a new Junos image. You can view compact-flash device
storage details with the show system storage command.
When an upgrade is performed, the system must be rebooted in order for the new version to
take affect. To save time and keystrokes, you can use the reboot option when performing the
upgrade. Once Junos is installed, you are notified that the system is rebooting to complete
the installation. Use the console connection to view details of the upgrade process. Watch
for any error messages indicating a problem with the upgrade.
Once the system has rebooted, you can issue the show version command, to verify the Junos
version.
Course FSSCLI © Juniper Networks, Inc. 54
Introduction to Junos and the Command Line Interface (CLI)
Slide 55
Password Recovery
© 2010 Juniper Networks, Inc. All rights reserved. CONFIDENTIAL FSSCLI www.juniper.net|55
If you become locked out of a Junos device, and need to recover the root password, you
need to be connected through the console connection. This is a security precaution,
designed to prevent unauthorized access.
To recover the root password, follow these steps:
Please note that the on-screen CLI sequence is only an approximate simulation.
First, establish console access and reboot the system. Watch as the system boots, and press
the Spacebar when prompted during the boot loader process. When the system presents a
loader> prompt or an OK prompt, enter boot -s to boot into single-user mode as shown.
Course FSSCLI © Juniper Networks, Inc. 55
Introduction to Junos and the Command Line Interface (CLI)
Slide 56
Password Recovery
• The OK prompt is used for Junos devices based on the Intel architecture, while the loader>
prompt is used for devices based on the PowerPC architecture.
© 2010 Juniper Networks, Inc. All rights reserved. CONFIDENTIAL FSSCLI www.juniper.net|56
Note that the OK prompt is used for Junos platforms based on the Intel architecture while
the loader> prompt is used on Junos platforms based on PowerPC architecture.
Course FSSCLI © Juniper Networks, Inc. 56
Introduction to Junos and the Command Line Interface (CLI)
Slide 57
Password Recovery
• The system performs a single-user boot-up process and prompts you to run the recovery script.
• Enter a shell pathname or press Enter for a default shell
• Enter recovery
• When presented with the operational mode command prompt:
• Enter configuration mode
• Reset root password
• Commit the configuration
© 2010 Juniper Networks, Inc. All rights reserved. CONFIDENTIAL FSSCLI www.juniper.net|57
Next, the system performs a single-user boot-up process and prompts you to run the
recovery script. Enter a shell pathname or press Enter for a default shell. Enter recovery at
this point. When you enter the recovery command, the system initiates the recovery script
which allows you to login without the currently configured password.
Then, after a series of messages, the CLI starts and you are presented with an operational
mode command prompt. At this point, you can enter configuration mode and reset the root
password. The required commands for these tasks are shown onscreen. Do not forget to
commit your configuration.
Course FSSCLI © Juniper Networks, Inc. 57
Introduction to Junos and the Command Line Interface (CLI)
Slide 58
Password Recovery
© 2010 Juniper Networks, Inc. All rights reserved. CONFIDENTIAL FSSCLI www.juniper.net|58
To complete the recovery, exit configuration mode. You are then prompted to reboot the
system. Choose yes to reboot the system. Once the reboot is complete, you can login with
the new root password.
Course FSSCLI © Juniper Networks, Inc. 58
Introduction to Junos and the Command Line Interface (CLI)
Slide 59
Section Overview
In this section, you learned about
operational monitoring and maintenance
on a Junos device.
After successfully completing this
section, you should now be able to:
• Describe the monitoring tools
• Monitor system-level operation
• Monitor the chassis
• Verify interface status
• Explain the differences between terse output
and extensive output
• Describe monitoring interfaces
• Describe the network utilities: ping and
traceroute; monitoring traffic; and Telnet, SSH,
and FTP commands
• Display the Junos version
• Explain the Junos naming convention
• Upgrade Junos software
• Recover the password
© 2010 Juniper Networks, Inc. All rights reserved. CONFIDENTIAL FSSCLI www.juniper.net|59
In this section, you will learn about operational monitoring and maintenance on a Junos
device.
After successfully completing this section, you will be able to:
Describe the monitoring tools
Monitor system-level operation
Monitor the chassis
Verify interface status
Explain the differences between terse output and extensive output
Describe monitoring interfaces
Describe the network utilities: ping and traceroute; monitoring traffic; and Telnet, SSH,
and FTP commands
Display the Junos version
Explain the Junos naming convention
Upgrade Junos software, and
Recover the password
Course FSSCLI © Juniper Networks, Inc. 59
Introduction to Junos and the Command Line Interface (CLI)
Slide 60
Additional Information
© 2010 Juniper Networks, Inc. All rights reserved. CONFIDENTIAL FSSCLI www.juniper.net|60
The First URL can be usedto get a list of technical publications about the Juniper Networks
switches, appliances and systems, and management products.
The second URL is an excellentto get up-to-date information on instructor led training,
certification, and Juniper Networks books for continuing your Juniper education.
Course FSSCLI © Juniper Networks, Inc. 60
Introduction to Junos and the Command Line Interface (CLI)
Slide 61
Conclusion
Congratulations! You have come to the end of this course. In this course, you learned
about theJunos operating system and the Command Line Interface (or CLI). After
successfully completing this course, you should now be able
to:
Course FSSCLI © Juniper Networks, Inc. 61
Introduction to Junos and the Command Line Interface (CLI)
Slide 62
© 2010 Juniper Networks, Inc. All rights reserved. CONFIDENTIAL FSSCLI www.juniper.net|62
Juniper Networks, Inc. All rights reserved. Juniper Networks, the Juniper Networks logo,
Junos, NetScreen and ScreenOS are registered trademarks of Juniper Networks, Inc. in the
United States and other countries. JunosE is a trademark of Juniper Networks, Inc. All other
trademarks, service marks, registered trademarks or registered service marks are the
property of their respective owners. Juniper Networks reserves the right to change, modify,
transfer or otherwise revise this publication without notice.
Course FSSCLI © Juniper Networks, Inc. 62