jueves, 7 de mayo de 2009

capitulo 1.1

As we discussed in the Introduction, you should already have a
grasp of basic networking concepts. This includes the layers of the
Open Systems Interconnection (OSI) model, the format and layout
of an IP packet, and the function of a router as a network device. Additionally, you should
understand the operation of both the Transmission Control Protocol (TCP) and the User Datagram
Protocol (UDP).
This chapter will introduce you to the basic components of the Juniper Networks family of routers.
We start with a high-level examination of the two basic components of the system: the Routing
Engine and the Packet Forwarding Engine. Next, we cover the specific details of the Routing Engine,
including the JUNOS software modules, boot devices, and boot sequence pattern. In addition, we
discuss the various modes of the software as well as some fail-over capabilities. We conclude with
a discussion of the Packet Forwarding Engine ASICs and an example of a packet’s flow through the
router.
Let’s first ensure that we have a common understanding of the terminology and an idea of
how all the pieces fit together.
Juniper Networks Router Design
The central design principle of the Juniper Networks platform centers on a separation of the
control and forwarding planes within the router. The Routing Engine and the Packet Forwarding
Engine, respectively, represent these planes. You can see this design concept in Figure 1.1.
FIGURE 1 . 1
Juniper Networks router design
Let’s examine each of these components in more detail.
Routing
Engine
Packet
Forwarding
Engine
Juniper Networks Router Design
3
Routing Engine Overview
The
Routing Engine
in a Juniper Networks router is the central location for control of the system.
This is where the intelligence of the router operates. You perform software upgrades and
maintenance on the Routing Engine. In addition, you interface with the Routing Engine for
monitoring and configuring the router.
General Functions
Your experience with a Juniper Networks router begins with the Routing Engine. After connecting
to the router, you supply authentication information (name and password) to the
Routing Engine. After you’re authenticated, you perform management and configuration
operations within the Routing Engine. Troubleshooting tools like Telnet, ping, or traceroute
operate from within the Routing Engine as well.
Since control of the router occurs in the Routing Engine, this is the logical location to store the
JUNOS software. As such, the Routing Engine operates all routing protocols and makes all
routing
table
decisions, building a master routing table with the best path to each destination selected.
The router then places these best paths into the
forwarding table
on the Routing Engine and copies
that same data into the forwarding table on the Packet Forwarding Engine. The forwarding table
on the Packet Forwarding Engine allows the router to actually forward user data packets.
Physical Composition
The intelligence of the Routing Engine software is not matched by equally intelligent hardware.
In fact, the physical components are widely available. Each Routing Engine is based on an Intel
PCI motherboard. The actual components of each Routing Engine depend on the model you are
using and include the following:
Routing Engine 2
The Routing Engine 2 is found in the Juniper Networks M-series routers
(M5, M10, M20, M40, M40e, M160). It contains a 333MHz processor and 768MB of random
access memory (RAM). File storage is handled by an 80MB internal flash drive and a 6.4GB
traditional hard drive. When you use the Routing Engine 2 on an M40 router, it contains an
LS 120 disk for external file storage; all other models use a removable PCMCIA flash card for
this purpose.
Routing Engine 3
The Routing Engine 3 is found in the Juniper Networks T-series routers
(T320 and T640). Additionally, recent versions of the JUNOS software support the use of this
Routing Engine in the M5, M10, M20, M40e, and M160 routers. The Routing Engine 3 contains
a 600MHz processor and 2GB of RAM. File storage is handled by a 128MB internal flash drive
and a 30GB traditional hard drive. The Routing Engine 3 uses a removable PCMCIA flash card
for external file storage.
The RAM memory in the Routing Engine stores routing tables, forwarding tables, link-state
databases, and operational memory space for the JUNOS software. The internal flash drive
stores the JUNOS software and configuration files for the router. The hard drive is used to store
a backup copy of the JUNOS software, log files, traceoptions output (debug), and user files.
4
Chapter 1 
The Components of a Juniper Networks Router
While the differences between the Routing Engine models certainly control how much storage
capacity you have in the router, they do not affect the operation of the JUNOS software.
The internal flash drive is used for the same purposes and the software builds routing tables in
the amount of RAM available to it. In fact, each version of the JUNOS software operates across
all Routing Engine models. You never need to worry about replacing the Routing Engine hardware
and then having to find the right software version to support it.
The hardware in a Juniper Networks Routing Engine is generally composed
of the most common components available at its time of construction. As the
cost of hardware decreases over time, you can expect that newer versions of
the Routing Engine will contain more powerful hardware. Regardless, the
requirements of the router design allow the Routing Engine to function quite
well using the hardware described here.
Packet Forwarding Engine Overview
The
Packet Forwarding Engine
is the central location for data packet forwarding through the
router. The router’s throughput speed and capacity are controlled by the specially designed
hardware, which sets a Juniper Networks router apart from its competitors.
General Functions
Simply put, the Packet Forwarding Engine provides industry-leading performance in the forwarding
of data packets across any interface in the router. Achieving this type of throughput requires
dividing the forwarding plane of the router into multiple segments controlled by
applicationspecific
integrated circuits (ASICs)
. The interaction of these ASICs provides the forwarding path
within a Juniper Networks router.
The function of the Juniper Networks ASICs and their role in packet forwarding
is covered in the section “Packet Forwarding Engine Components” later in this
chapter.
Physical Composition
In contrast to the Routing Engine with its single motherboard and processor, the Packet Forwarding
Engine contains a passive midplane as well as multiple boards and processors. Each circuit
board is controlled by software that is fairly non-intelligent when compared to the JUNOS
software on the Routing Engine.
The main portions of the Packet Forwarding Engine are the Physical Interface Card, the Flexible
PIC Concentrator, and a switching control board. Each component contains an ASIC customdesigned
by Juniper Networks engineers and manufactured by IBM. Each ASIC performs a specific
function in the forwarding path of packets. (We discuss the specific functions of each ASIC
in the section “Packet Flow” later in this chapter.)
Juniper Networks Router Design
5
Switching Control Board
The switching control board contains a PowerPC CPU and 64MB of RAM that operates the
components of the circuit board itself, but doesn’t participate in packet forwarding. An additional
8MB (or 16MB in recent versions of the circuit board) of synchronized static random
access memory (SSRAM) contains the forwarding table for the router. The Internet Processor
ASIC is located on the control board and accesses the forwarding table for route lookups. Additionally,
the control board contains an ASIC designed for packet storage memory management.
As a comparison, the 8MB of SSRAM on the switching control board holds
approximately 450,000 forwarding table entries. As of this writing, the Internet
has about 120,000 unique routing entries. This means that the Internet can
double in size twice before you run out of storage capacity for your forwarding
table.
Each router model uses a different name for the control board functionality. The possible
names include:
Forwarding Engine Board (FEB)
The
Forwarding Engine Board
is found in both the M5 and
M10 platforms and integrates the circuit board with the FPC. Each router contains no more
than one FEB, which is specific to either the M5 or the M10 chassis.
System Switching Board (SSB)
The
System Switching Board
is found in the M20 platform. Each
platform is configured to hold dual SSBs, but only one board is operational at any one time.
System Control Board (SCB)
The
System Control Board
is found in the M40 platform. Each
chassis contains no more than one SCB.
Switching and Forwarding Module (SFM)
The
Switching and Forwarding Module
is found in
the M40e and M160 platforms. Each M40e router can contain 2 SFMs, with only one operational
at a time. The M160 router contains four SFMs working in parallel.
Memory Mezzanine Board (MMB)
The
Memory Mezzanine Board
is found in the T320 and
T640 platforms and is located on the FPC itself.
The T320 and T640 platforms are designed with a different internal architecture
for the Packet Forwarding Engine. The M-series platforms are the focus
of this book, and we point out differences with the T-series platforms where
appropriate.
Flexible PIC Concentrator
The
Flexible PIC Concentrator
(FPC)
connects to both the switching control board and the router’s
interfaces within the Packet Forwarding Engine. A PowerPC CPU controls the FPC board, and it
uses 64MB of RAM to operate the Embedded OS software. The PowerPC CPU doesn’t participate
in data packet forwarding, however. This is the function of a Juniper Networks ASIC, which is
located on the FPC and interacts with the data packets as they enter and exit the router interfaces.
6
Chapter 1 
The Components of a Juniper Networks Router
Physical Interface Card
The physical media in your network connects to the
Physical Interface Card (PIC)
in your
router. Up to four individual PICs are contained on an FPC. A media-specific ASIC is located
on each PIC.
Routing Engine Components
Let’s now discuss the specific details and operation of the Routing Engine components. We start
with the JUNOS software, examine the operation of the command-line interface (CLI), and finish
with the fail-over capabilities of the Routing Engine.
Software Architecture
The JUNOS software is based on the FreeBSD Unix operating system. The open source software
is modified and hardened by Juniper Networks engineers to operate in the router’s specialized
environment. For example, some executables have been deleted while other utilities
were de-emphasized. Additionally, certain daemons were added to enhance the routing functionality.
The result of this transformation is the
kernel
, the heart of the JUNOS software.
The kernel is responsible for operating multiple daemons that perform the actual functions
of the router. Each daemon operates in its own protected memory space, which is also controlled
by the kernel. This separation provides isolation between the processes and resiliency in
the event of a process failure. This is important in a core routing platform since a single process
failure does not cause the entire router to cease functioning. Some common daemons include:
Routing Protocol Daemon (rpd)
The router’s protocols are controlled by the
Routing Protocol
Daemon
. Its functionality includes all protocol messages, routing table updates, and implementation
of routing policies.
Device Control Daemon (dcd)
The router’s interfaces are configured and maintained by the
Device Control Daemon
. This process controls both the physical and logical properties of the
interfaces.
Management Daemon (mgd)
The
Management Daemon
process controls all user access to
the router. For example, the user’s CLI is a client of mgd.
Chassis Daemon (chassisd)
The
Chassis Daemon
process controls the properties of the router
itself, including the interaction of the passive midplane, the FPCs, and the control boards.
Packet Forwarding Engine Daemon (pfed)
The
Packet Forwarding Engine Daemon
process
controls the communication between the Packet Forwarding Engine and the Routing Engine.
For example, one of its functions is retrieving the interface input/output statistics from the
Packet Forwarding Engine.
Routing Engine Components
7
The kernel also generates specialized daemons as needed for additional functionality. Some
examples include Simple Network Management Protocol (SNMP), Virtual Router Redundancy
Protocol (VRRP), and Class of Service (CoS).
Software Components
The JUNOS software is actually made up of multiple pieces working together to control the
router’s functions. Each section of the software is referred to as a
package
and contains files
specific to its particular function. The current packages found in each copy of the JUNOS
software are:
jkernel
The
jkernel
package contains the basic components of the JUNOS software operating
system.
jbase
The
jbase
package contains additions to the JUNOS software since the last revision of
the
jkernel
package.
jroute
The
jroute
package contains the software that operates on the Routing Engine. This
controls the Unicast routing protocols, the multicast routing protocols, and the Multiprotocol
Label Switching (MPLS) signaling protocols. The package also contains the software for some
daemons, such as mgd.
jpfe
The
jpfe
package contains the Embedded OS software that controls the components of
the Packet Forwarding Engine.
jdocs
The
jdocs
package contains the complete JUNOS software documentation set.
jcrypto
The
jcrypto
package contains software that controls various security functions, such
as IP Security (IPSec) and Secure Shell (SSH). This package is available only in U.S. and Canadian
versions of the software.
jbundle
The
jbundle
package is a single file that contains all of the other packages we discussed
previously.
Getting Help from Your Router
The
jdocs
package is an interesting topic to discuss. It contains the entire JUNOS software documentation
set on your router and is accessed through the user CLI. It is a handy tool to keep
at your disposal.
You can find conceptual information on network topics by using the
help topic
command. For
example, let’s say you’d like to know more about setting up Open Shortest Path First (OSPF)
backbone areas. Here’s how you’d access this information and what the router would tell you:
user@Merlot>
help topic ospf area-backbone
8 Chapter 1  The Components of a Juniper Networks Router
Configure the Backbone Area
You must create a backbone area if your network consists of multiple areas. An ABR
must have at least one interface in the backbone area, or it must have a virtual
link to a router in the backbone area. The backbone comprises all area border
routers and all routers that are not included in any other area. You configure all
these routers by including the following area statement at the [edit protocols
ospf] hierarchy level (for routing instances, include the statement at the [edit
routing-instances routing-instance-name protocols ospf] hierarchy level):
[edit protocols ospf]
area 0.0.0.0;
When you are ready to configure your router to support an OSPF area, you can view specific
configuration information using the help reference command:
user@Merlot> help reference ospf area
area
Syntax
area area-id;
Hierarchy Level
[edit protocols ospf],
[edit routing-instances routing-instance-name protocols ospf]
Description
Specify the area identifier for this router to use when participating in OSPF
routing. All routers in an area must use the same area identifier to establish
adjacencies.
Specify multiple area statements to configure the router as an area border router.
An area border router automatically summarizes routes between areas; use the arearange
statement to configure route summarization. By definition, an area border
router must be connected to the backbone area either through a physical link or
through a virtual link. To create a virtual link, use the virtual-link statement.
Routing Engine Components 9
The JUNOS software Naming Convention
The JUNOS software follows a specific naming convention of package-major_version
released_version-type. An example from the Merlot router shows this format:
user@Merlot> file list jbundle*
/var/home/user/jbundle-5.2R1.4-domestic-signed.tgz
/var/home/user/jbundle-5.2R2.3-domestic-signed.tgz
/var/home/user/jbundle-5.3R2.4-domestic-signed.tgz
The command output shown here contains information explained in the
“Command-Line Interface” section later in this chapter.
This naming structure allows you to quickly determine if your version of the software supports
a desired feature. The details of the naming convention are as follows:
package This represents the specific portion of the JUNOS software contained in the file.
Examples include jbundle, jroute, and jpfe.
major_version This represents the major version of the JUNOS software located in the file.
This is always shown in a two-integer format, as in 5.2 or 5.3.
stage This single capital letter represents the type of software in the file. Possible values
include:
 R—Publicly released software (most common)
 A—Alpha version of the software
 B—Beta version of the software
 I—Internal or test version of the software
To specify that the router is directly connected to the OSPF backbone, include
the area 0.0.0.0 statement.
Options
area-id--Area identifier. The identifier can be up to 32 bits. It is common to
specify the area number as a simple integer or an IP address. Area number 0.0.0.0
is reserved for the OSPF backbone area.
10 Chapter 1  The Components of a Juniper Networks Router
released_version Each major_version of the software may contain multiple releases.
This field represents the specific release number contained in this file. The Merlot router shows
several examples: 1.4, 2.3, and 2.4.
type Each jbundle package contains an additional field that represents whether the jcrypto
package is contained. jcrypto is included in files marked with domestic and is omitted in files
marked as export.
In addition, all packages may include the signed notation. This means that the package file is
protected using the MD5 algorithm. When you apply the package to the router, the router runs
the algorithm and compares the MD5 hash result to the stored value in the file. The package is
used only when the values match, thereby protecting you from corrupted software files.
Upgrading the Software
You upgrade the JUNOS software by using the request system software add filename command.
This command loads a software file from some location, often the user’s home directory,
onto the internal flash on the Routing Engine. (Files and directories are discussed in the section
“Manipulating Files on the Router” later in this chapter.) In the following example, we want to
upgrade the Merlot router, which is currently running version 5.2R2.3, to version 5.3R2.4:
user@Merlot> show version brief
Hostname: Merlot
Model: m5
JUNOS Base OS boot [5.2R2.3]
JUNOS Base OS Software Suite [5.2R2.3]
JUNOS Kernel Software Suite [5.2R2.3]
JUNOS Packet Forwarding Engine Support [5.2R2.3]
JUNOS Routing Software Suite [5.2R2.3]
JUNOS Online Documentation [5.2R2.3]
JUNOS Crypto Software Suite [5.2R2.3]
user@Merlot> request system software add jbundle-5.3R2.4-domestic-signed.tgz
The command separates the jbundle package into its individual package components
(jroute, jpfe, etc.), and the Routing Engine upgrades each package individually. If the new
version relies on changes to the base operating system, the jbase package is also upgraded.
Upon a successful completion, you must reboot the router to use the new software using the
request system reboot command. You also have the option of an automatic reboot by using
the reboot option in conjunction with the request system software add filename command.
The process looks like this:
user@Merlot> request system software add jbundle-5.3R2.4-domestic-signed.tgz
reboot
Installing package '/var/home/lab/jbundle-5.3R2.4-domestic-signed.tgz' ...
Verified MD5 checksum of jbundle-5.3R2.4-domestic.tgz
Routing Engine Components 11
Adding jbundle...
Verified MD5 checksum of jbase-5.3R2.4.tgz
Verified MD5 checksum of jboot-5.3R2.4
Verified MD5 checksum of jcrypto-5.3R2.4.tgz
Verified MD5 checksum of jdocs-5.3R2.4.tgz
Verified MD5 checksum of jkernel-5.3R2.4.tgz
Verified MD5 checksum of jpfe-5.3R2.4.tgz
Verified MD5 checksum of jroute-5.3R2.4.tgz
Auto-deleting old jroute...
Auto-deleting old jdocs...
Auto-deleting old jpfe...
Auto-deleting old jcrypto...
Restarting kmd ...
Auto-deleting old jkernel...
Adding jkernel...
Restarting watchdog ...
Adding jcrypto...
Adding jpfe...
Adding jdocs...
Adding jroute...
Saving package file in /var/sw/pkg/jbundle-5.3R2.4-domestic-signed.tgz ...
Saving state for rollback ...
Rebooting ...
shutdown: [pid 5584]
*** FINAL System shutdown message from root@HongKong-3 ***
System going down IMMEDIATELY
It is possible to upgrade a single JUNOS software package individually, but this
practice is not recommended. Software packages operating at different version
levels might have an interaction that causes unforeseen consequences. This
type of upgrade should be completed only with the guidance of the Juniper
Networks Technical Assistance Center (JTAC).
Boot Sequence
Whether installed at the factory or upgraded in your network, the router stores bootable copies
of the JUNOS software in three possible locations: the internal flash disk, the hard drive, or the
removable media. Each location has the ability to load the software into memory and boot the
router, but the primary boot media is the internal flash disk. The hard drive is considered the secondary
boot location, while the removable media is used for disaster-recovery purposes.
12 Chapter 1  The Components of a Juniper Networks Router
A “factory fresh” router has the most recent JUNOS software version installed
on the internal flash disk as well as the removable media.
As the router boots, it first runs a power-on self-test (POST) to verify that the basic system
components are operating normally. The router then locates a copy of the JUNOS software and
loads it into memory. The boot sequence of the router is shown in Figure 1.2.
FIGURE 1 . 2 The JUNOS software boot sequence
The removable media is the first boot location examined. If the router finds a copy of the
JUNOS software there, it loads the software on the router. This presents a possible hazard in
your network since all existing files and file systems on the router are erased during this process.
This type of boot process returns the router to a factory default-type environment and should
be used only for disaster recovery. If no removable media is present, the router loads the software
from the internal flash disk. This is considered the normal boot operation and should
occur at each router start.
It is possible for the internal flash disk to become corrupted or otherwise unusable. In this situation,
the router uses the hard drive as its boot location and displays a message to alert you of
this issue. You can see this as you log into the router:
To successfully boot the router from the hard drive, you first need to copy the
JUNOS software and other critical files to it with the request system snapshot
command.
Merlot (ttyp0)
login: user
Password:
--- JUNOS 5.3R1.2 built 2002-04-30 01:40:52 UTC
---
--- NOTICE: System is running on alternate media device (/dev/ad1s1a).
---
user@Merlot>
Primary
Boot Media
Secondary
Boot Media
Removable
Media
Solid-State
Flash Drive
Hard
Drive
Halt Boot
Process
Routing Engine Components 13
Should your router encounter a problem and boot from the hard drive, please
contact the JTAC for assistance.
Command-Line Interface
At this point, we have the router booted and the appropriate software loaded on it. It is now
time to monitor and configure the router using the command-line interface (CLI).
The JUNOS software CLI contains two main modes: operational and configuration. The
names adequately describe the functions permitted within each environment. Operational mode
displays the current router status, and you use it for verifying and troubleshooting the router.
Configuration mode, on the other hand, provides you with a method for altering the current
environment.
Operational Mode
You enter operational mode on the router after a successful login attempt. The router prompt
displays your status graphically:
user@Merlot>
The default prompt for the JUNOS software is a combination of your username and the
router hostname. In our case, the username is user and the hostname of the router is Merlot.
In addition, the > character tells you that you are in operational mode.
As with most router operating systems, the JUNOS software uses a command hierarchy paradigm
within operational mode. This allows you to find only the information you request in a
timely manner. Here we are accessing the top level of the operational-mode hierarchy on the
Merlot router:
user@Merlot> ?
Possible completions:
clear Clear information in the system
configure Manipulate software configuration information
file Perform file operations
help Provide help information
monitor Real-time debugging
mtrace Trace multicast path from a source to a receiver
ping Ping a remote target
quit Exit the management session
request Make system-level requests
restart Restart a software process
set Set CLI properties, date, time, craft display text
show Show information about the system
14 Chapter 1  The Components of a Juniper Networks Router
ssh Open a secure shell to another host
start Start a software process
telnet Telnet to another host
test Diagnostic debugging commands
traceroute Trace the route to a remote host
You use this hierarchy level for several different purposes. For example, the ping, telnet,
traceroute, and ssh commands allow the router to behave as an IP end host. The router generates
these IP packets on the Routing Engine and sends them into the network through a particular
interface. Commands such as request, restart, and start control the router’s operations.
In the “Upgrading the Software” section earlier in this chapter, we used the request command
to load a new version of the JUNOS software.
You can view the router’s current status by using the show command. The hierarchy located
in this directory lets you access interface statistics, routing protocol information, and the current
routing table. The show hierarchy directory on the Merlot router is:
user@Merlot> show ?
Possible completions:
accounting Show accounting profiles and records
aps Show APS information
arp Show system ARP table entries
as-path Show table of known AS paths
bgp Show information about BGP
chassis Show chassis information
class-of-service Show information about class of service
cli Show command-line interface settings
configuration Show configuration file contents
connections Show CCC connections
dvmrp Show information about DVMRP
firewall Show firewall counters and information
helper Show port-forwarding helper information
host Host name lookup service using domain name server
igmp Show information about IGMP
ike Show IKE information
ilmi Show ILMI information
interfaces Show interface information
ipsec Show IPSec information
ipv6 Show information about IPv6
isis Show information about IS-IS
l2circuit Show information about Layer 2 circuits
l2vpn Show information about Layer 2 VPNs
ldp Show information about LDP
log Show contents of a log file
Routing Engine Components 15
mpls Show information about MPLS
msdp Show information about MSDP
multicast Show multicast information
ntp Show Network Time Protocol information
ospf Show information about OSPF
pfe Show Packet Forwarding Engine information
pim Show information about PIM
policer Show interface policer counters and information
policy Show policy information
rip Show information about RIP
ripng Show information about RIPng
route Show routing table information
rsvp Show information about RSVP
sap Show session advertisement addresses
snmp Show SNMP information
system Show system information
task Show routing protocol per-task information
ted Show information about TED
version Show software process revision levels
vrrp Show VRRP information
Context-Sensitive Help
It is no accident that we’ve been utilizing the question mark (?) throughout this chapter to locate
information. This character gives you context-sensitive help to navigate the command hierarchy.
We often use the help function at a specific hierarchy level, but it also provides assistance in locating
specific options within a particular level. For example, let’s locate the possible commands
starting with the letter i within the show hierarchy:
user@Merlot> show i?
Possible completions:
igmp Show information about IGMP
ike Show IKE information
ilmi Show ILMI information
interfaces Show interface information
ipsec Show IPSec information
ipv6 Show information about IPv6
isis Show information about IS-IS
To see information about the Intermediate System to Intermediate System (IS-IS) routing
protocol, let’s use the question mark within the next level of the command hierarchy like so:
user@Merlot> show isis ?
16 Chapter 1  The Components of a Juniper Networks Router
Possible completions:
adjacency Show the IS-IS adjacency database
database Show the IS-IS link-state database
hostname Show IS-IS hostname database
interface Show IS-IS interface information
route Show the IS-IS routing table
spf Show information about IS-IS SPF calculations
statistics Show IS-IS performance statistics
The context-sensitive help system is a powerful tool when you’re learning the command hierarchy
and locating specific commands. The router also provides another tool to assist you in
learning the CLI—the command completion function, which we discuss next.
Command Completion
The JUNOS software CLI provides you with a command completion function. Each unique
combination of characters at a particular hierarchy level expands into the full command when
you use either the spacebar or the Tab key. For example, the characters sh are the most unique
combination at the top of the operational hierarchy. You press the spacebar to complete the
show command as follows:
user@Merlot> show
We further complete our command with the letter c followed by the Tab key:
user@Merlot> show c
^
'c' is ambiguous.
Possible completions:
chassis Show chassis information
class-of-service Show information about class of service
cli Show command-line interface settings
configuration Show configuration file contents
connections Show CCC connections
user@Merlot> show c
The router returns an error message telling us that there are multiple commands in the show
hierarchy that start with the letter c. The output informs you that 'c' is ambiguous and displays
the possible commands that begin with the requested letter. The router maintains the command
prompt at the position of the error and waits for you to enter more characters. We now
complete our command:
user@Merlot> show c
^
'c' is ambiguous.
Routing Engine Components 17
Possible completions:
chassis Show chassis information
class-of-service Show information about class of service
cli Show command-line interface settings
configuration Show configuration file contents
connections Show CCC connections
user@Merlot> show cli
CLI complete-on-space set to on
CLI idle-timeout disabled
CLI restart-on-upgrade set to on
CLI screen-length set to 24
CLI screen-width set to 80
CLI terminal is 'vt100'
CLI is operating in enhanced mode
The router’s parsing of the CLI during your command typing provides you with an immediate
syntax check. With the CLI, you’ll never type out a long command and then after you press
Enter be told that you made an error at the beginning of the command.
Easing into the JUNOS software CLI
The command completion functionality of the JUNOS software allows you to easily migrate
from another vendor’s software. Your mind and your fingers can still use the same keystrokes
and produce the same results. For example, the command string sh rou completes into show
route and displays the routing table:
user@Merlot> show route
inet.0: 6 destinations, 6 routes (6 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both
10.0.24.2/32 *[Local/0] 10w2d 05:45:23
Local via so-0/3/0.0
10.0.31.0/24 *[Direct/0] 2w2d 06:42:26
> via fe-0/0/1.0
10.0.31.1/32 *[Local/0] 2w2d 06:42:26
Local via fe-0/0/1.0
172.64.0.0/16 *[Direct/0] 2w2d 06:50:26
> via fxp0.0
18 Chapter 1  The Components of a Juniper Networks Router
Editing Command Lines
The router stores operational mode commands in a history buffer as you type them. This allows
you to repeat a command by accessing the previous version and pressing the Enter key. When
the CLI and your terminal emulator agree to use vt100 as the character output, you can use the
172.64.0.24/32 *[Local/0] 2w2d 06:50:26
Local via fxp0.0
192.168.24.1/32 *[Direct/0] 2w2d 06:42:26
> via lo0.0
The string sh int completes into show interfaces and displays the interfaces on the router:
user@Merlot> show interfaces
Physical interface: fe-0/0/0, Enabled, Physical link is Up
Interface index: 11, SNMP ifIndex: 13
Description: Where does this go
Link-level type: VLAN-CCC, MTU: 1518, Speed: 100mbps, Loopback: Disabled,
Source filtering: Disabled, Flow control: Enabled
Device flags : Present Running
Interface flags: SNMP-Traps
Current address: 00:90:69:6a:f0:00, Hardware address: 00:90:69:6a:f0:00
Last flapped : 2002-07-09 10:40:16 UTC (10w2d 06:24 ago)
Input rate : 0 bps (0 pps)
Output rate : 0 bps (0 pps)
Active alarms : None
Active defects : None
(Note: Information deleted for brevity)
Since the JUNOS software was built to support IPv4 as its primary protocol, the only thing you
have to erase from your mind is the use of ip in your commands:
user@Merlot> show ip
^
'ip' is ambiguous.
Possible completions:
ipsec Show IPSec information
ipv6 Show information about IPv6
user@Merlot> show ip
Routing Engine Components 19
left, right, up, and down arrows. These keystrokes provide you with access to the CLI history
and allow you to easily edit your previous commands. The Backspace key is also enabled in
vt100 mode, and you use it to delete characters to the left of the cursor. To set your current terminal
session to vt100 mode, use the following:
user@Merlot> set cli terminal vt100
Regardless of your current terminal type, the JUNOS software CLI responds to common editor
macros (Emacs) keystrokes to edit the command line. Some of the more useful commands
are shown in Table 1.1.
Operational Command Variables
Now that you are exposed to the command hierarchy and you know how to get help from the
CLI, you can operate your Juniper Networks router efficiently. The router, however, provides
TABLE 1 . 1 Common Emacs Keystrokes
Command Effect
Ctrl+P Displays the previous line in the CLI history buffer and is equivalent to the
Up arrow key.
Ctrl+N Displays the next line in the CLI history buffer and is equivalent to the Down
arrow key.
Ctrl+B Moves the cursor back one character and is equivalent to the Left arrow key.
Ctrl+F Moves the cursor forward one character and is equivalent to the Right
arrow key.
Esc+B Moves the cursor back one word at a time. The Esc key must be released
and re-pressed for each keystroke.
Esc+F Moves the cursor forward one word at a time. The Esc key must be released
and re-pressed for each keystroke.
Ctrl+A Moves the cursor to the beginning of the current command line.
Crtl+E Moves the cursor to the end of the current command line.
Ctrl+W Deletes the word to the left of the cursor.
Ctrl+X Deletes the entire current command line.
Ctrl+L Redraws the current command line.
20 Chapter 1  The Components of a Juniper Networks Router
you with additional capabilities that you may find useful. One such option is the ability to
attach variables to your commands through the use of the pipe key (|).
Each valid command in operational mode has this ability. You can see it as a final option
when you use the context-sensitive help function:
user@Merlot> show cli ?
Possible completions:
<[Enter]> Execute this command
authorization Show authorization and authentication information
history Show list of previous commands
| Pipe through a command
user@Merlot> show cli
The router’s help system also works with the pipe functionality:
user@Merlot> show cli | ?
Possible completions:
count Count occurrences
display Display additional information
except Show only text that does not match a pattern
find Search for the first occurrence of a pattern
hold Hold text without exiting the --More-- prompt
match Show only text that matches a pattern
no-more Don't paginate output
resolve Resolve IP addresses
save Save output text to a file
trim Trim specified number of columns from start of line
user@Merlot> show cli
The options available to you include the following:
count This option prompts the router to count the lines in the output. You see only a single
line returned with the total count listed; for example, Count: 7 lines.
display This option allows the router to show you additional data associated with the command.
In operational mode, only the xml switch is accessible to view the Extensible Markup
Language (XML) tags for each command.
except This option allows you to omit any line in the output containing the text string you
provide.
find This option prompts the router to begin the output at the first occurrence of the text
string you provide.
hold The router automatically paginates its output based on the current terminal screen
length. When the end of the output is reached, the router returns to the command prompt. This
option prevents the router from automatically ending the pagination process when the end of
the output is reached.

No hay comentarios: