SSFJUN02A-ML5
SSFJUN02A-ML5
JUNOS CONFIGURATION
BASICS
Student Guide
Junos Configuration Basics
NOTE: Please note this Student Guide has been developed from an audio narration. Therefore, it will have
conversational English. The purpose of this transcript is to help you follow the online presentation and may
require reference to it.
Slide 1
Slide 2
© 2017 Juniper Networks, Inc. All rights reserved. | www.juniper.net | Proprietary and Confidential
Slide 3
Navigation
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 any time to submit suggestions or corrections directly to the Juniper Networks
eLearning team.
Slide 4
Course Objectives
© 2017 Juniper Networks, Inc. All rights reserved. CONFIDENTIAL SSFJUN02A-ML5 www.juniper.net
| 4
Slide 5
Slide 6
© 2017 Juniper Networks, Inc. All rights reserved. | www.juniper.net | Proprietary and Confidential
The Command-Line
Interface
Slide 7
Section Objectives
Slide 8
Another option for user management is the J-Web GUI, a powerful web-based management interface available on
Junos OS devices. J-Web lets you perform the actions available in the CLI, but in a graphical format. It provides
practical tools to monitor, configure, troubleshoot, and manage your device.
Additionally, customers can manage platforms running the Junos OS with an expanding set of Junos Space
applications. Junos Space is Juniper’s network management platform.
Since Junos OS supports standards-compliant and open protocols, APIs, and interfaces, many other
third-party network
management, monitoring, automation, and orchestration tools can be used to manage Juniper
devices. Programmatic interfaces, such as JET, NETCONF, and REST API are available to provide
access to third-party tools as a user interface.
Slide 9
CLI Login
username @ symbol
hostname prompt symbol
CLI
Login
The Junos OS CLI is the software interface you use to access a device running the Junos OS—whether
from the console or through a network connection. By leveraging industry-standard tools and utilities,
the CLI provides a powerful set of commands that you can use to monitor and configure devices
running the Junos OS.
To access the CLI, you need to connect and log in. If you are using a brand new device, rather than
one that has already
been configured with your username and password, you would log in with a username of root, leave
the password blank, and press enter. The root login account has superuser privileges, with access to
all commands and statements. When you log in as root, the command prompt will end with a
percentage symbol. At this point, you are in a command shell. To enter the CLI you need to type cli
and press enter. The command prompt will change to a “greater-than” symbol, as shown in
the example on this slide. This new command prompt indicates that you are now in operational mode
of the CLI. On a brand
new device,
When you logyou should
in with youralways create
username anda password
secure password
(instead for theroot
of the rootusername),
user, then you
create
will other user
be taken
accountsinto
directly as the
needed.
CLI In fact, you are required to set a root password the first time you commit a
configuration.
operational mode, as shown in the second example on this slide where a username of lab was used.
Note that the default CLI prompt is comprised of the username, then an “at” symbol, the device host
name, and then the prompt symbol. The prompt symbol indicates whether you are in the shell,
operational mode, or configuration mode.
Slide 10
CLI Modes
Operational mode
•Monitor and manage device operations
The > character identifies
mike@jnpr1> operational mode
Configuration mode
•Configure the device and its interfaces
© 2017 Juniper Networks, Inc. All rights reserved. CONFIDENTIAL SSFJUN02A-ML5 www.juniper.net
| 10
CLI
Modes
The Junos CLI organizes its commands into two groups, known as modes:
• Operational mode is for managing and monitoring device operations. For example, monitor the
status of the device interfaces, check chassis alarms, and upgrade or downgrade the device's
operating system.
• Configuration mode is for configuring the device and its interfaces. This includes configuring the
management console with its network settings, setting up user accounts for access to the
device, specifying the security measures used to protect the device and the network, and
The setting
promptupfollowing
routing and
the switching protocols.
device name indicates the mode you are currently in, as
illustrated on this slide.
Slide 11
Hierarchical Command
Structure
2nd Level
... ... ...
3rd Level
... ... ... ...
... ... ... ...
... ... ... ...
Hierarchical Command
Structure
The Junos CLI structures the activities of each mode into hierarchies. The hierarchy of each mode is
made up of cascading branches of related functions commonly used together.
The structured hierarchy of the CLI is among the first of many preferred differences that new users
discover about the Junos CLI. By logically grouping activities, the Junos CLI provides a regular,
consistent syntax that is helpful to knowing where you are, finding what you want, quickly moving
around the interface, and efficiently entering commands. The hierarchy of commands makes learning
and using the Junos CLI easier. New users regularly comment on just how logical the command- line is.
Slide 12
Common Administrative
Tasks
• Monitor and troubleshoot the
device
• Connect to other network
systems
• Restart software processes
• Enter configuration mode and
exit the CLI
• Display the configuration
• Control the CLI environment
• Perform system-level operations such as
stopping and rebooting the device and
loading Junos images
Functions | 12
This slide shows some of the common administrative tasks that can be performed in operational
mode. The Junos OS provides an extensive set of on-board instrumentation capabilities for gathering
critical operational status, statistics, and other information. These tools deliver advance notification
of issues and speed problem-solving during events.
As part of your configuration setup you can specify the types of events to track, the event severity, and
the files in which to store the data, among other options. You can then access this information in
operational mode. Juniper devices come with sufficient processing power to collect and store critical
operational data, including SNMP management, system logging, and traceoptions (or debugging) that
help you to understand how the device operates in normal conditions and where, when, and why
changes occur.
Slide 13
top
Less Specific
Slide 14
Specifying Output
Specifying
Output
The show command includes other arguments to modify the output. This slide displays the available arguments for
the
show interfaces command for the fe-1/1/1 Fast Ethernet interface. The question mark (?) helps you
to complete commands by showing a list of possible completions available for that command at that
level, without you needing to reference a CLI manual. The question mark will become your best friend
while operating or configuring a Junos OS device.
Slide 15
Output
Options
mike@jnpr1> show interfaces fe-1/1/1 brief
Physical interface: fe-1/1/1 Enabled, Physic link is
Down
Link-level type: Ethernet, MTU: 1514, Speed: 100mbps, Loopback:
Disabled, Source filtering: Disabled
Flow control: Enabled
Device flags: Present Running Down
Interface flags: Hardware-Down SNMP-Traps Internal: Ox4000
Link flags: None
Command
output with
brief option
Command
output with
terse option
Output
Options
Junos OS operational mode commands can include brief, detail, extensive, or terse options. You
can use these options to control the amount of information you want to view.
This slide illustrates the results of adding the keywords and terse to the show interfaces comman
brief d.
Slide 16
Switching Between
Modes
configuration mode
Switching Between
Modes
As you monitor and configure a device, you will need to switch between operational mode and
configuration mode. When you change to configuration mode the command prompt changes from the
greater than symbol to the hashtag symbol, as shown in the examples on this slide.
To switch from operational mode to configuration mode, issue the configure command. The [edit] banner shows
your location at the top level of the configuration hierarchy. To switch back to operational mode, you
issue the exit
command.
Slide 17
Slide 18
system {
services {
ftp;
}
}
Indentatio
n of
subordina
te levels
Container statements are indicated with open
and close curly brackets { }
• In the example, system and services are cascading
container statements
Leaf statements are indicated with a semicolon ;
• In the example, ftp; is a leaf statement
© 2017 Juniper Networks, Inc. All rights reserved. CONFIDENTIAL SSFJUN02A-ML5
www.juniper.net | 18
Configuration Mode
Syntax
The CLI displays the hierarchy of the configuration mode through the
following syntax:levels are indicated by indenting each subordinate level. In the example shown on this slide,
• The hierarchy
services
• is a subordinate of system, and ftp is a subordinate of services.
Container statements are indicated between open and close curly brackets. In the example,
• system and services
are cascading container statements.
Leaf statements are indicated with a semicolon at the end. In the example, ftp; is a leaf
statement.
Slide 19
Hierarchy Flexibility
View from a
sublevel of
configuration
mode:
Configuration mode banner [edit
system services]
ftp;
Hierarchy CONFIDENTIAL
© 2017 Juniper Networks, Inc. All rights reserved.
www.juniper.net | 19
SSFJUN02A-ML5
Flexibility
The flexibility to work at a specific sublevel or stanza in the hierarchy is helpful when users want to
focus on just a small portion of the configuration.
Looking at the examples on this slide, the two configuration statements shown for the FTP service are
equal. In the top
example, you are looking at the statement from the root level of the hierarchy, and thus the ftp;
statement is shown in this listing within the system and services container statements.
In the bottom example, you are viewing the same ftp; statement from a deeper level within the hierarchy. When you
are in
deeper levels of the hierarchy, the [edit] banner displays the entire hierarchical path. In this example, the banner
[edit system services] indicates a place in the hierarchy lying within services (the 3rd level),
system (the
2nd level), and [edit] (the root or 1st level). At this level, whenever you view the configuration, the
command-line
To only displays
determine where you are the ftp;
in the statement.hierarchy, refer to the configuration mode banner
configuration
before entering configuration commands. While you can edit the configuration from the root
directory, often it is easier to navigate to the area within the configuration you are changing prior to
adding and removing commands.
Slide 20
Command
s
• edit
• The user must know the full
hierarchical path
• This command will create new intermediate hierarchy levels
if they do not yet exist in your configuration
• up
• Moves you up one level in the hierarchy
• To move up multiple levels, add an optional count (up 2, for example)
• top
• Moves you to the top level in the hierarchy
• exit
• Leaves the current level of the configuration hierarchy,
returning to the level prior to the last edit command
• If you enter exit from the top level of the configuration hierarchy, you
exit
configuration mode and enter operational mode
© 2017 Juniper Networks, Inc. All rights reserved. CONFIDENTIAL SSFJUN02A-ML5 www.juniper.net
| 20
Slide 21
© 2017 Juniper Networks, Inc. All rights reserved. CONFIDENTIAL SSFJUN02A-ML5 www.juniper.net
| 21
CLI Shortcut
Keys
Fortunately, for new users, and even experienced users, the Junos CLI includes lots of shortcuts
and ways to get help.
Both configuration mode and operational mode offer options to shorten keystrokes. All standard UNIX
keyboard shortcuts are available to you when you are logged on to the Junos OS device. It might take
some repetition for these to become second nature, but once they are, these shortcuts can save you
a lot of typing time.
For example, the CLI stores every entered command in its command history. At any command
prompt, the up and down arrow keys let you scroll through this history. This allows you to re-use
commands that you previously entered, or modify them as needed.
Keyboard shortcut sequences can save you much time, for example, when you are configuring similar
items on the device, or you are repeating operational commands.
Slide 22
The spacebar completes most CLI commands. The tab key not only completes CLI commands, but also
filenames and user- defined variables such as policy names, community names, and IP addresses.
When the completion of the command or argument is ambiguous, hitting space or tab lists the possible
completions, as shown in the top example on this slide.
Slide 23
Getting Help
Getting
Help
You can query the command-line with the question mark character at any level of the operational or
configuration hierarchies for a list of available commands and a short description of each. Typing a
partial command followed by a question mark provides a list of all the valid ways to complete your
command, as shown in the example on this slide. Using the question mark in this way is known as
context-sensitive help in Junos OS lingo. For commands that require a filename as an argument, the
question mark lists the files in the working directory.
Slide 24
More Help
help apropos
•Displays help about a text string contained in a
statement or command name
help reference
•Provides assistance with configuration syntax by
displaying summary information for the
statement
help syslog
•Displays information on specific syslog events
help tip
•Provides random tips for using the CLI
help topic
•Displays usage guidelines for configuration
statements
© 2017 Juniper Networks, Inc. All rights reserved. CONFIDENTIAL SSFJUN02A-ML5
www.juniper.net | 24
More
Help
When you want more information than provided by context-sensitive help, you can turn to the
Junos OS technical documentation included on your device by using the help commands. When
requesting help, follow each of these help commands with the string or topic for which you are
seeking information.
The help files are divided into major categories. You can access these files in operational
•mode.
helpYou can use:
apropos to display help about a text string contained in a statement or command name;
• help reference to provide assistance with configuration syntax by displaying summary
information for the
statemen
t;
• help syslog to display information on specific syslog events;
• help tip to provide random tips for using the CLI; and
• help topic to display usage guidelines for configuration
statements.
Slide 25
Logging
Out
[edit protocols
ospf]
mike@jnpr1# exit
configuration-mode
Exiting configuration mode
mike@jnpr1> exit
jnpr1 (ttyu0)
login:
CONFIDENTIAL
SSFJUN02A-ML5 www.juniper.net | 25
Logging
Out
You must be in operational mode to log out completely from the device. If you are in configuration mode, use the
exit
configuration-mode command to enter operational mode. If you are at the top of the configuration
mode hierarchy, you only need to use the exit command. From operational mode, you can
completely exit the CLI by entering the exit command and hitting enter.
Slide 26
https://
virtuallabs.juniper.net/
© 2017 Juniper Networks, Inc. All rights reserved. CONFIDENTIAL SSFJUN02A-ML5 www.juniper.net
| 26
Slide 27
Section Summary
Slide 28
A. # (hashtag
symbol)
B. } (curly bracket
symbol)
C. > (greater-than
symbol)
D. ~ (tilde symbol)
CONFIDENTIAL SSFJUN02A-ML5
Learning Activity 1:
www.juniper.net | 28
Question 1
Operational mode is identified by which
prompt?
• # (hashtag symbol)
• } (curly bracket
• symbol)
• > (greater-than
symbol)
~ (tilde
That’s symbol)
correct.
The prompt for operational mode ends with the greater-
than symbol.
That’s incorrect. The correct option is C.
The prompt for operational mode ends with the greater-
than symbol.
Learning Activity 1:
Question 2
Configuration mode is identified by which
prompt?
• # (hashtag symbol)
• } (curly bracket
• symbol)
• ~ (tilde symbol)
% (percentage
symbol)
That’s correct.
The prompt for configuration mode ends with the
hashtag symbol.
That’s incorrect. The correct option is A.
The prompt for configuration mode ends with the
hashtag symbol.
Slide 29
© 2017 Juniper Networks, Inc. All rights reserved. | www.juniper.net | Proprietary and Confidential
Slide 30
Section Objectives
Slide 31
commit
candidate validated
active commit
confirmed commit commit
scripts
validations
© 2017 Juniper Networks, Inc. All rights reserved. CONFIDENTIAL SSFJUN02A-ML5 www.juniper.net
| 31
Slide 32
rollback
configuratio configurati
commit
commit
n on
commit configuratio 1
n commit
confirmed
s
cripts validations
49
Let’s take a look at the basic steps of the multi-stage Junos OS configuration process,
SSFJUN02A-ML5 www.juniper.net | 32
which arethe
• First, as user
follows:
makes changes to the candidate
configuration.
• The candidate configuration is a copy of the active configuration. You can enter
configuration changes to the candidate configuration through the CLI by using cut-and-
paste, loading or merging a text file with the updated
configuration changes, or entering the changes manually through the CLI interface. After
• Second, making all your
you will candidate
commit changes,
your changes, you can
which reviewthe
will make your work, including
candidate comparing
configuration the the
active
• candidate to the the
configuration.
Before finalizing active running file.
changeover, the software checks for certain statements within the
candidate configuration and performs other context validations. If the device includes pre-
loaded commit scripts, these scripts will also
check for errors and possibly correct errors within the candidate configuration. If there are
• Third,anyonceissues, the user
everything will be
checks notified
out, and the configuration
the candidate configuration will not become
becomes the active.
active
• configuration.
The candidate configuration you were working on becomes the active configuration and the
device places the previous active configuration into an archive of up to 49 of the past active
configurations, which you can access
through the rollback command if needed.
We will explore each of these steps in more detail on the
upcoming slides.
Slide 33
To enter configuration mode, the Junos OS provides several options. These options give users different
ways to manage who is making changes and when.
If users enter configuration mode with the command: configure, then they are in standard
configuration mode. Standard mode allows any number of users to edit the candidate configuration
simultaneously, and changes made by a single user
are visibly shared by all users, any of whom will activate all changes if they enter a commit command.
Alternatively, the Junos OS offers the options to configure private or configure exclusive. These
prevent one user from inadvertently activating another users changes before they are ready.
In configure private mode, the device keeps a separate candidate copy, which holds only the changes made by the
private user. In configure exclusive mode, the CLI locks all other users out of configuration mode
until the exclusive user closes the exclusive state. These two configuration options are very handy
when multiple users can change the candidate configuration of a device.
Slide 34
Initially, before any changes are entered, the candidate configuration is the same as the active
running configuration.
To display the candidate configuration, use the show command in configuration mode. When entered
from the top of the configuration hierarchy, the CLI displays the entire candidate configuration, as
shown in the abbreviated example on the left of this slide.
Deeper in the hierarchy, the show command displays the configuration from the current hierarchy level
and below, as show in the example on the right of this slide.
You might have noticed that configuration mode uses the show command in a different way than operational mode.
The
commands of each mode are independent of each other, and thus the show command represents
different actions in each mode.
Slide 35
{ services
Either
finger; ftp;
mi
ke@jnpr1# set finger
mike@jnpr1# set ftp mi
ke@jnpr1# set ssh mike
@jnpr1# set telnet
© 2017 Juniper
Networks, Inc. All rights reserved.
CONFIDENTIAL
SSFJUN02A-ML5 www.juniper.net
| 35
You can create or change the candidate configuration by entering a series of commands, including those
to add and remove
configuration statements. The set command inserts a statement and values into the candidate
configuration.
While you can edit the candidate from the root directory, as shown in the top example on this slide,
often it is easier to navigate to the area within the configuration you are changing prior to adding and
removing
second commands.
example Thiswhere
on this slide is shown in the
changes are entered in the [edit system services] sublevel of the
hierarchy.
Either approach provides the same results, as shown in the example on the
right of this slide.
Slide 36
[edit]
mike@jnpr1# delete system services Res t [edit]
}
system {
ul
The delete command removes statements from the candidate configuration. In the example shown on this slide,
we
delete what we had just added in the prior slide, which was system services.
Deleting a statement effectively returns the device, protocol, or service to an un-configured state.
Deleting a container
statement removes everything under that level of the hierarchy. Proceed with caution. Remember,
the delete command removes all subordinate statements and identifiers. For example, if you
entered the simple command: delete protocols from the top of the CLI hierarchy, you would
remove all the protocols configured in your candidate file. You need to be aware of where you are
within the hierarchy and what you are removing when you issue a delete statement.
Slide 37
In configuration mode only, when you have made changes to the configuration and want to compare
the candidate
configuration with a prior version, you can use the compare command to display the differences. The
compare command compares the candidate configuration with either the current active configuration
or another configuration file and displays the differences between the two configurations. The CLI
indicates new lines in the candidate with a plus (+) sign and those removed with a minus (-) sign. In
the example shown at the top of this slide, the user has enabled telnet within system services and also
removed
To comparessh and web-management.
configurations, specify the compare command after the pipe symbol, as shown in the examples on this
slide. If
you do not specify any arguments after the compare command, then the candidate configuration is
compared against the active configuration file, as shown in the top example on this slide. If you want
to specify a file other than the active
configuration file for comparison, then you would specify the filename after the compare command, as
shown in the bottom example on this slide. You can also do a comparison to a previously active
configuration by using rollback n, where n is the index into the list of previously committed
configurations. The most recently saved configuration (which is the active configuration) is number 0,
and the oldest saved configuration is number 49.
Slide 38
The CLI also provides a command to check that the system can process your candidate configuration. The commit
check
command validates the logic and completeness of the candidate semantics without activating any
changes. These are the
same validations which run when you commit a candidate. If the system finds a problem in the
candidate configuration, it lets you know, as the example on this slide illustrates.
Slide 39
The candidate configuration file is only the proposed configuration, and your device does not use any
of this configuration
until a commit command activates the configuration. After you have entered all desired changes, and
you have double checked your work, you are ready to activate your candidate as the active running
configuration. To activate the candidate configuration, enter the commit command.
Before actually activating the candidate configuration, the Junos OS checks basic syntax and
semantics. For example, the software makes sure that a policy has been defined before it is
referenced. If any syntax or semantic problems are found,
the commit command returns an error and the configuration is not activated, as shown in the first
example
You onallthis
must fix slide.
errors before the candidate can become active. The complete message tells you that the new
commit
configuration is up and running on the device.
Slide 40
© 2017 Juniper Networks, Inc. All rights reserved. CONFIDENTIAL SSFJUN02A-ML5 www.juniper.net
| 40
Are you among those of us who have made the mistake of adding security to a remote device, only to
discover that the security configuration changes you made locked you out of the very interface that
you were using to access the device? Do you have a story about the time you accidently isolated a
remote device and then had to jump in the car and drive two-and-
a-half hours in the middle of the night just to reset it? The commit confirmed command can prevent
costly configuration mistakes by automatically rolling back problematic configurations.
The commit confirmed command commits a candidate configuration for 10 minutes (this is the default time
setting).
Then if you do not follow up with a second commit within that time period, the device automatically
rolls back to the previous configuration. You can use the commit confirmed command anytime you
want a safety net against potential configuration problems.
If you do not confirm the configuration by entering a second commit command, the CLI will roll back
the device to the previous active configuration at the end of the 10 minutes (or an interval you
specify). In this way, if you have accidently isolated the device, you simply need to wait for the
rollback instead of agonizing over how you are going to otherwise undo your mistake.
Slide 41
[edit]
mike@host# commit
commit complete
© 2017 Juniper Networks, Inc. All rights reserved. CONFIDENTIAL SSFJUN02A-ML5 www.juniper.net
| 41
Whenever you commit the candidate as the new active configuration, the Junos OS automatically saves
a copy of the active configuration file that is being replaced. As you store each newly replaced
configuration, all the prior configuration files move back one version number further in the configuration
archive. Each device can store up to 50 of the most recently active versions. This number includes the
current active configuration (also known as rollback 0). You can access this
configuration archive using the rollback command.
You can reset your candidate configuration to match the active running configuration by entering rollback or
rollback
0.
You can also return to the most recent previous active configuration file by using the rollback 1
command, or use any other number between 2 and 49 to go back to any of the previous
configurations.
The rollback command loads the requested archive as the candidate file. You can also create a rescue
configuration of a known working configuration so that you can rollback to it when all else fails.
If you want to use a rollback file you will need to commit the configuration. First, use the show command to view the
file so
you can be sure it is what you want. Then activate the file with the commit command. This is a
very important step—to complete a rollback for the active configuration of the device, you must
run the commit command to activate it.
Slide 42
Preparing Changes in
Advance
Unlike other systems, the Junos OS lets you prepare for an installation before actually installing the
hardware. The software simply ignores the areas of the running configuration which are irrelevant to
the existing hardware installation. Those areas of the running configuration will become active once
the hardware becomes available.
The option to set up a configuration prior to hardware installation is quite useful, especially when the
person installing the hardware is different than the person configuring the device, a common
occurrence for remote devices. At the top of this slide we show a configuration for fe-3/0/0, which will
be installed at a later date. Nevertheless, the configuration statement is the same. The settings will
simply be ignored until the hardware is installed. Then the setting will become active.
You can also schedule when you want your candidate configuration to become active. To save Junos
OS configuration
changes
mode and activate
command, thereboot
specifying configuration
or a future on the
time at device
the at a future time
hierarchy or as
level, upon reboot,
shown useexample
in the the at
commit
[edit] at configuration the bottom
of this slide.
Slide 43
edit interfaces]
mike@jnpr1# delete se-0/0/1 unit 0 family inet address 10.0.22.1/24
© 2017 Juniper Networks, Inc. All rights reserved. CONFIDENTIAL SSFJUN02A-ML5 www.juniper.net
| 43
The copy command duplicates a configuration statement along with all the subordinate statements configured
underneath it. In using the copy command, you copy the configuration associated with one user-
defined element to a new, similarly configured element. You can then modify that second element with
any needed changes. Copying statements is useful when you are configuring many physical or logical
interfaces of the same type.
The rename command is a convenient shortcut when you need to alter the value of a user-defined
variable—such as policy names, filter names, and IP addresses—or to change the name of a user-
defined element.
The examples on this slide illustrate a very useful technique for configuring similar interfaces, where
only IP addresses are
different. First, you create an identical configuration of se-0/0/1 based on the se-0/0/2 interface using
the copy
command. Then, you change the IP address of the newly created se-0/0/1 interface by deleting the IP
address of the copied
se-0/0/2 interface and setting the IP address for the se-0/0/1 interface, which is 10.0.36.2/24 in the
example shown on this slide. You could also use the rename command to change the IP address of
the newly created interface, thereby achieving the same result, as shown in the bottom example on
this slide.
Slide 44
Symbol
The pipe symbol lets you filter output in both operational and configuration modes. Pipe makes it
possible to achieve results such as: displaying specific information in a single command step, sending
the output of one command as input to another, or redirecting the output to a file, to name a few
examples. The output of the command to the left of the pipe symbol serves as input to the command or
file to the right of the pipe.
The first example shown on this slide creates a file that stores the output of the request support information
command entered in operational mode by piping its output to a filename specified by the user.
In the second example on this slide, the pipe symbol, followed by count, counts the number of lines in the
output.
These are only a few of the examples of what the pipe
symbol can do.
Slide 45
The run
Command
<...OUTPUT TRIMMED...>
The run command lets you issue CLI operational mode commands while in configuration mode. Just add the keyword
run
before any operational mode command that you want to execute while you are inside configuration
mode.
As shown in the example on the slide, entering the run show interfaces command displays the output as if show
interfaces had been entered from operational mode. The example on this slide shows an
abbreviated listing of the output.
Slide 46
© 2017 Juniper Networks, Inc. All rights reserved. CONFIDENTIAL SSFJUN02A-ML5 www.juniper.net
| 46
Slide 47
Slide 48
XML
Configuratio
n
Actions
ACTIVE
Proactive Network
bug
Service Director:
On-Box thorough automated
end-Insight: data center
Automation: impact switches/routers
notifications
analysis and
management application
Puppe Service
enables
that
t Management of
Chef
Now:campus and administration
Automated …and many other easy-
Pytho that enables
n Juniper of-life/end-of-support to-use
Commit/Op/Event Scripts/Macros management for various
Per resolve a
domains
l Security Director: problem in
environme
SLAX networ scalable and
Off-Box Automation:
(Juise) nts
k
responsive security
Network
Junos automation consists of a suite of tools used to automate operational and configuration tasks on
network devices running the Junos OS. The Junos automation tool kit is part of the standard Junos OS
available on all switches, routers, and security devices running Junos OS. Junos automation tools for on-
box automation, which leverage the native XML capabilities of the Junos OS, include commit scripts,
operational scripts (op scripts), event policies and scripts, and macros.
Junos automation simplifies complex configurations and reduces potential configuration errors. It saves
time by automating operational and configuration tasks. It also speeds troubleshooting and maximizes
network uptime by warning of potential problems and automatically responding to system events.
Junos automation can capture the knowledge and expertise of experienced network operators and
administrators and allow a business to leverage this combined expertise across the organization.
Where a Juniper Networks product does not provide an essential functionality in the creation or
monitoring of a robust automated network service, the Junos OS enables an interface, protocol, or API,
or adds a third-party client to integrate with a best-in-class product.
Slide 49
https://
virtuallabs.juniper.net/
Slide 50
Section Summary
In this section,
•we: Presented and demonstrated the Junos OS configuration process and its multiple safeguards;
• Highlighted some key Junos OS CLI commands; and
• Discussed features and commands of the Junos OS CLI that can be used to save time,
automate operations, and monitor the network.
Slide 51
A. True
B. False
Learning Activity 2:
Question 1
True or False: As soon as you edit the configuration file and press “Enter” the changes are
implemented on your Junos OS
device.
• True
•
False
That’s correct.
In the Junos OS, configuration changes are not activated every time you press Enter. Configuration
changes are made to a candidate configuration and are not activated until the user is ready to
commit the configuration.
That’s incorrect. The statement is false.
In the Junos OS, configuration changes are not activated every time you press Enter. Configuration
changes are made to a candidate configuration and are not activated until the user is ready to
commit the configuration.
Learning Activity 2:
Question 2
What is the purpose of configure private mode?
Slide 52
Junos OS Routing
© 2017 Juniper Networks, Inc. All rights reserved. | www.juniper.net | Proprietary and Confidential
Junos OS
Routing
Slide 53
Section Objectives
© 2017 Juniper Networks, Inc. All rights reserved. CONFIDENTIAL SSFJUN02A-ML5 www.juniper.net
| 53
Slide 54
Server
Server
A
B
Interne
t Legend
Data
User
User A Center
B
Router
Switch
A Basic Definition of
Routing
Routing, in its most basic form, is the process of moving data between Layer 3 networks. The sample
topology on shown on this slide consists of several Layer 3 networks, all connected by routers. Although
routers are the most common devices for performing routing operations, note that many switches and
security devices also perform routing operations. Note also that the Internet is actually a collection of
many networks rather than a single network.
In this section, we will look at the required components of routing, and how devices running the
Junos OS make routing decisions.
Slide 55
The Components of
Routing
Legend
Internet
Network 1
gatewa Data
User
y Center
B
User A
Route
r device
Switc
h
The Components of
Routing
There are several components and concerns you need to consider to effectively implement routing
between remote networks. However, you can classify the various components and considerations into
two primary requirements—an end-to- end communications path and ensuring all Layer 3 devices
within the communications path have the required routing information.
In the example shown on this slide, you can see that a physical path exists between the two networks
and the Internet. As long as the physical path is configured and functioning correctly, the first
requirement is satisfied.
For the second requirement, all Layer 3 devices participating in the communications path must have the
necessary routing information. The devices within the networks must have the proper gateway
configured (the router that connects to those networks as well as the Internet). The gateway device
must determine the proper next hop for each destination prefix for the transit traffic it receives. Devices
running the Junos OS use the forwarding table, which is a subset of information found in the routing
table, to make this determination.
We discuss the routing and forwarding
tables next.
Slide 56
The Routing
Table
The Junos OS routing table consolidates prefixes from multiple routing information sources
including various routing protocols, static routes, and directly connected routes.
Slide 57
Predefined Routing
Tables
Predefined Routing
Tables
The slide provides a summary of the common predefined routing tables you might see on a device
running the Junos OS.
Slide 58
Route Preference
Local
0
Static
5
OSPF internal
10
RIP
100
OSPF AS external
150
BGP (both EBGP and IBGP) 170
Less Preferred
Route CONFIDENTIAL
© 2017 Juniper Networks, Inc. All rights reserved. SSFJUN02A-ML5 www.juniper.net
Preference | 58
The Junos OS uses route preference to differentiate routes received from different routing protocols or
routing information sources. Route preference is equivalent to administrative distance on equipment
from other vendors such as Cisco.
Selecting the Active Route
The Junos OS uses route preference to rank routes received through the various route information
sources and as the primary criterion for selecting the active route. The table at the bottom of this slide
shows the default preference values for a selected set of routing information sources. Any of these
default values can be changed.
Slide 59
…
route is selected as active
Slide 60
Routing
protocol
databas OSPF
es Routing Forwardi
n
ng
table
Other routing
table
source
s
information Direct Static
© 2017 Juniper Networks, Inc. All rights reserved. CONFIDENTIAL SSFJUN02A-ML5 www.juniper.net
| 60
The Forwarding
Table
The forwarding table stores a subset of information from the routing table. Within the forwarding table,
you can find the details used by a device running the Junos OS to forward packets such as the learned
destination prefixes and the outgoing
interfaces associated with each destination prefix. You use the show route forwarding-table CLI
command to view the forwarding table contents.
Note that the Junos OS kernel adds some forwarding entries and considers them permanent in nature.
One such example is the default forwarding entry, which matches all packets when no other matching
entry exists. When a packet matches this default forwarding entry, the device discards the packet and
sends an ICMP destination unreachable message back to the sender. If you configured a user-defined
default route, it will be used by the device instead of the permanent default forwarding entry.
Slide 61
Forwarding
Plane
FT
Packets in
Packets out
© 2017 Juniper Networks, Inc. All rights reserved. CONFIDENTIAL SSFJUN02A-ML5 www.juniper.net
| 61
Slide 62
© 2017 Juniper Networks, Inc. All rights reserved. CONFIDENTIAL SSFJUN02A-ML5 www.juniper.net
Overview of Routing | 62
Instances
The Junos OS logically groups routing tables, interfaces, and routing protocol parameters to form
unique routing instances. The device logically keeps the routing information in one routing instance
apart from all other routing instances. The use of routing instances introduces great flexibility because
a single device can effectively imitate multiple devices.
Slide 63
Default Routing
Instance
The Junos OS creates a default unicast routing instance called the master routing instance. By default,
the master routing instance includes the inet.0 route table, which the device uses for IPv4 unicast
routing. The software creates other route tables, such as inet6.0, adds them to their respective
routing instance, and displays them when required by the configuration.
The Junos OS also creates private routing instances, which the device uses for internal communications
between hardware components. You can safely ignore these instances and their related information
when planning your network.
Slide 64
© 2017 Juniper Networks, Inc. All rights reserved. CONFIDENTIAL SSFJUN02A-ML5 www.juniper.net
| 64
User-Defined Routing
Instances
For added flexibility, the Junos OS allows you to configure additional routing instances under the routing-
instances]
[edit hierarchy. User-defined routing instances can be used for a variety of different situations
and provide users a great amount of flexibility in their respective environments.
We also commonly refer to filter-based forwarding (FBF) as policy-based routing (PBR). Some typical
uses for user-defined routing instances include filter-based forwarding (FBF), Layer 2 and Layer 3 VPN
services, and system virtualization.
The following are some of the common routing
instance types: Used to implement filter-based forwarding for common Access
• forwarding:
• Layer applications;
• l2vpn: Used in Layer 2 VPN implementations;
• no-forwarding: Used to separate large networks into smaller administrative
• entities;
• virtual-router: Used for non-VPN-related applications such as system
virtualization;
Notevpls:
thatUsed for point-to-multipoint
the actual routing instance LAN implementations
types between running
vary between platforms a set of the
sitesJunos OS. Be sure to
in athe
check VPN; and
technical documentation for your specific product.
vrf: Used in Layer 3 VPN implementations.
Slide 65
Slide 66
© 2017 Juniper Networks, Inc. All rights reserved. CONFIDENTIAL SSFJUN02A-ML5 www.juniper.net
| 66
Slide 67
© 2017 Juniper Networks, Inc. All rights reserved. CONFIDENTIAL SSFJUN02A-ML5 www.juniper.net
| 67
You can also source traffic from a specific routing instance by referencing the name of the desired
routing instance. The last
two examples on this slide show this option in action with the ping and traceroute utilities.
Slide 68
Static Routes
172.30.25.0/30
0.0.0.0/0
inet.0: 4 destinations,[Static/5]
4 routes (4
active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * =
Both
* 01:09:34
© 2017 Juniper Networks, Inc. All rights reserved. CONFIDENTIAL SSFJUN02A-ML5 www.juniper.net
| 68
Static
Routes
Static routes are used in a networking environment for multiple purposes, including a default route
for the autonomous system (AS) and as routes to customer networks. Unlike dynamic routing
protocols, you manually configure the routing information provided by static routes on each router or
multilayer switch in the network. All configuration for static routes
occurs at the [edit routing-options] level of the hierarchy.
Static routes must have a valid next-hop defined. Often, that next-hop value is the IP address of the
neighboring router headed toward the ultimate destination. On point-to-point interfaces, you can
specify the egress interface name rather than the IP address of the remote device. Another possibility is
that the next-hop value is the bit bucket. This phrase is analogous to dropping the packet off the
network. Within the Junos OS, the way to represent the dropping of packets is with the
keywords reject or discard. Both options drop the packet from the network. The difference between
them is in the action the device running the Junos OS takes after the drop action. If you specify reject
as the next-hop value, the system sends an ICMP message (the network unreachable message) back to
the source of the IP packet. If you specify discard
as the
By next-hop
default, value, the
the next-hop IP system
addressdoes not send
of static back
routes an ICMPinmessage,
configured the Junosthe
OSsystem just
must be drops the
reachable
packeta silently.
using direct route. Unlike with software from other vendors, the Junos OS does not perform
recursive lookups of next hops by default.
Static routes remain in the routing table until you remove them or until they become inactive. One
possible scenario in which a static route becomes inactive is when the IP address used as the next hop
becomes unreachable.
Slide 69
Configuring Static
Routing
This slide illustrates the basic configuration syntax for IPv4 and IPv6 static routes. The slide also highlights the no-
readvertise option which prohibits the redistribution of the associated route through routing policy
into a dynamic routing protocol such as OSPF. We highly suggest that you use the no-readvertise
option on static routes that direct traffic out the management Ethernet interface and through the
management network.
Note that IPv6 support varies between Junos OS platforms. Be sure to check the technical
documentation for your specific product for support information.
Slide 70
Monitoring Static
Routing
Monitoring
•Use show route protocol static to
display static routes
user@host> show route protocol static
reachability:
user@host> ping 192.168.63.14 rapid count 25
PING 192.168.63.14 (192.168.63.14): 56 data bytes
© 2017 Juniper Networks, Inc. All rights reserved. CONFIDENTIAL SSFJUN02A-ML5 www.juniper.net
| 70
Monitoring Static
Routing
This slide shows the basic verification steps when determining proper operation of static routing. Use the route
protocol static command to display static routes. The ping utility can be used to
show
verify reachability.
Slide 71
Next-Hop Resolution
[edit routing-options]
user@Host-A# show Indirect next-hop
static {
route 172.20.3.0/24 {
next-hop 172.25.1.6;
resolve; resolve option required
}
}
CONFIDENTIAL
SSFJUN02A-ML5 www.juniper.net | 71
Next-Hop
Resolution
By default, the Junos OS requires that the next-hop IP address of static routes be reachable using a
direct route. Unlike software from other vendors, the Junos OS does not perform recursive lookups
of next hops by default.
As illustrated on this slide, you can alter the default next-hop resolution behavior using the resolve CLI option. In
addition
to the resolve CLI option, a route to the indirect next-hop is also required. Indirect next-hops can be
resolved through another static route or through a dynamic routing protocol. We recommend,
whenever possible, that you use a dynamic routing protocol as your method of resolution. Using a
dynamic routing protocol rather than a static route to resolve indirect next-hops, dynamically removes
the static route if the indirect next-hop becomes unavailable.
Slide 72
Qualified Next-Hops
Use qualified-next-hop to allow
independent preference for static routes to
the same destination
172.30.25.0/3
0 ge-0/0/1 Intern
Network A .2 et
primary .1
172.29.100.0/24 .1 .6 secondary
.5
se-1/0/0
172.30.25.4/30
[edit routing-options]
user@host# show qualified-next-hop Primary
next-hop due to
static { default
route} preference (5) configured route
route 0.0.0.0/0 { preference (7)
next-hop 172.30.25.1;
172.30.25.5 {
preference 7;
}
Secondary
next-hop due to
© 2017 Juniper Networks, Inc. All rights reserved. CONFIDENTIAL SSFJUN02A-ML5 www.juniper.net
| 72
Qualified Next-
Hops
The qualified-next-hop option allows independent preferences for static routes to the same destination. This slide
shows an example using the qualified-next-hop option.
In the example configuration shown on this slide, the 172.30.25.1 next-hop assumes the default static
route preference of
5, whereas the qualified 172.30.25.5 next-hop, uses the defined route preference of 7. All traffic using
this static route uses the 172.30.25.1 next-hop unless it becomes unavailable. If the 172.30.25.1 next-
hop becomes unavailable, the device
uses the 172.30.25.5 next-hop. Some vendors refer to this implementation as a floating static route.
Slide 73
Dynamic Routing
Static routing
Dynamic routing
Dynamic
Routing
Static routing is ideal in small networks where only a few routes exist, or in networks where absolute
control of routing is required. However, static routing has certain drawbacks that might make it
cumbersome and hard to manage in large environments where growth and change are constant. For
large networks or networks that change regularly, dynamic routing might be the best option.
With dynamic routing, you simply configure the network interfaces to participate in a routing
protocol. Devices running routing protocols can dynamically learn routing information from each
other. When a device adds or removes routing information for a participating device, all other
devices automatically update.
Dynamic routing resolves many of the limitations and drawbacks of static routing. Some of the general
benefits of dynamic routing include the following:
• Lower administrative overhead: The device learns routing information automatically, which
eliminates the need for manual route definition;
• Increased network availability: During failure situations, dynamic routing can reroute traffic
around the failure automatically (the ability to react to failures when they occur can provide
• increased network uptime); and
Greater network scalability: The device easily manages network growth by dynamically
learning routes and calculating the best paths through a network.
Slide 74
• Current
IGP EGP in use today is BGP
IBGP
AS 64512 AS =
Autonomous system
AS 64513
© 2017 Juniper Networks, Inc. All rights reserved. CONFIDENTIAL SSFJUN02A-ML5 www.juniper.net
| 74
Dynamic Routing
Protocols
Although there are many types of routing protocols, two major categories are in widespread use in
today’s IP network—
interior gateway protocols (IGPs) and exterior gateway protocols (EGPs).
IGPs distribute routing information to routers within an autonomous system (AS). Examples include
RIP, OSPF, and IS-IS.
EGPs distribute routing information to routers that connect separate autonomous systems. BGP is the
current EGP in use today.
Slide 75
OSPF Protocol
AS 64512
OSPF
Protocol
OSPF is a link-state routing protocol designed for use within an AS. OSPF is an IGP. Link-state
protocols allow for faster reconvergence, support larger internetworks, and are less susceptible to
bad routing information than distance-vector protocols. It is common to refer to distance-vector
protocols learning as “learning by rumor”, where a router learns about prefixes from neighboring
routers’ perspectives. Routers using link-state routing protocols learn network topology by
“propaganda”, where they learn the topology from all the routers directly.
Devices running OSPF send out information about their network links and the state of those links to
other routers in the AS. This information transmits reliably to all other routers in the AS by means of
link-state advertisements (LSAs). The other routers receive this information, and each router stores it
locally. This total set of information now contains all possible links in the network.
In addition to flooding LSAs and discovering neighbors, a third major task of the link-state routing
protocol is establishing the link-state database. The link-state (or topological) database stores the LSAs
as a series of records. The important
information for the shortest path determination process is the advertising router’s ID, its attached
networks and neighboring routers, and the cost associated with those networks or neighbors.
OSPF uses the shortest-path-first (SPF) algorithm (also called the Dijkstra algorithm) to calculate the
shortest paths to all destinations. It does this calculation by calculating a tree of shortest paths
incrementally and picking the best candidate from that tree.
OSPF uses areas to allow for a hierarchical organization and facilitate scalability. An OSPF area is a
logical group of routers. The software can summarize the routing information from an OSPF area and
the device can pass it to the rest of the
network. Areas can reduce the size of the link-state database on an individual router. Each OSPF router
maintains a
separate link-state database for each area to which it is connected. The link-state database for a given
area
To is identical
ensure correctfor all participating
routing knowledgerouters within that OSPF
and connectivity, area. maintains a special area called the
backbone area. OSPF designates the backbone area as Area 0.0.0.0. All other OSPF areas must
connect themselves to the backbone for connectivity. All data traffic between OSPF areas must
transit the backbone.
Slide 76
ge-0/0/2
172.25.1.0/3
ge-0/0/3 .1
172.20.1.0/24 0 .1 .2 .1
172.20.2.0/24
.10
.5
ge-0/0/1
.1
lo0: 192.168.100.3/32
.9
.6
Host-C
172.20.
3.0/24
Slide 77
prohibit
adjacency [edit protocols ospf]
formation user@Host-A# set area 0 interface lo0.0
[edit
protocols ospf]
user@Host-A#
show The Junos OS converts area 0 to its
area 0.0.0.0
{ proper dotted decimal notation (0.0.0.0)
i
nterface ge-0/0/1.0;
interface ge-0/0/2.0;
interface ge-0/0/3.0 {
p
assive;
}
i
nterface
lo0.0;
}
This slide illustrates the required OSPF configuration for Host-A. Although not shown, Host-B and
Host-C require a similar
OSPF configuration to establish adjacencies and share routing information.
Slide 78
Slide 79
CONFIDENTIAL SSFJUN02A-ML5
www.juniper.net | 79
Slide 80
https://
virtuallabs.juniper.net/
Slide 81
Section Summary
In this section,
we:
• Discussed routing and forwarding tables;
• Described routing instances;
• Explored static routing and its configuration using the
• Junos OS; and
Described dynamic routing.
Slide 82
Learning Activity 3:
Question 1
In the Junos OS, route preference is similar to what
Cisco concept?
• Administrative
• distance Route
• hierarchy
• Destination table
Routing table
That’s correct.
Route preference is similar to administrative distance on equipment from other
vendors, such as Cisco.
That’s incorrect. The correct option is A.
Route preference is similar to administrative distance on equipment from other
vendors, such as Cisco.
Learning Activity 3:
Question 2
What are three benefits of dynamic routing?
(Choose three.)
• Most useful for small
• networks Lower
• administrative overhead
• Increased network
availability Greater
network
That’s scalability
correct.
Three benefits of dynamic routing include lower administrative overhead, increased network
availability, and greater network scalability.
Slide 83
Course Summary
In this course,
we:
• Discussed the Junos OS command line interface;
• Described various configuration features and
• commands; and
Explored routing configuration fundamentals.
Slide 84
Additional Resources
© 2017 Juniper Networks, Inc. All rights reserved. CONFIDENTIAL SSFJUN02A-ML5 www.juniper.net
| 84
For additional resources or to contact the Juniper Networks eLearning team, click the
links on the screen.
Slide 85
You have reached the end of this Juniper Networks eLearning module. You should now return to your
Juniper Learning Center to take the assessment and the student survey. After successfully completing
the assessment, you will earn credits that will be recognized through certificates and non-monetary
rewards. The survey will allow you to give feedback on the quality and usefulness of the course.
Slide 86
Slide 87
CONFIDENTIAL
Corporate and Sales Headquarters APAC Headquarters EMEA Headquarters Copyright 2010 Juniper Networks, Inc. All
rights reserved. Juniper Networks, the
Juniper Networks, Inc. Juniper Networks (Hong Kong) Juniper Networks Ireland Juniper Networks logo, Junos,
1194 North Mathilda Avenue 26/F, Cityplaza One Airside Business Park NetScreen, and ScreenOS are registered
Sunnyvale, CA 94089 USA 1111 King’s Road Swords, County Dublin, Ireland trademarks of Juniper Networks, Inc. in the
Phone: 888.JUNIPER Taikoo Shing, Hong Kong Phone: 35.31.8903.600 United States and other countries. All other
(888.586.4737) Phone: 852.2332.3636 EMEA Sales: 00800.4586.4737 trademarks, service marks, registered marks,
or 408.745.2000 or registered service marks are the property
Fax: 852.2574.7803 Fax: 35.31.8903.601
Fax: 408.745.2100 ww of their respective owners. Juniper Networks
w.juniper.net assumes no responsibility for any
inaccuracies in this document. Juniper
Networks reserves the right to change,
modify, transfer, or otherwise revise this
publication without notice.