Cli User Guide
Cli User Guide
Release 8.1
This product includes memory allocation software developed by Mark Moraes, copyright © 1988, 1989, 1993, University of Toronto.
This product includes FreeBSD software developed by the University of California, Berkeley, and its contributors. All of the documentation and software
included in the 4.4BSD and 4.4BSD-Lite Releases is copyrighted by The Regents of the University of California. Copyright © 1979, 1980, 1983, 1986, 1988,
1989, 1991, 1992, 1993, 1994. The Regents of the University of California. All rights reserved.
GateD software copyright © 1995, The Regents of the University. All rights reserved. Gate Daemon was originated and developed through release 3.0 by
Cornell University and its collaborators. Gated is based on Kirton’s EGP, UC Berkeley’s routing daemon (routed), and DCN’s HELLO routing protocol.
Development of Gated has been supported in part by the National Science Foundation. Portions of the GateD software copyright © 1988, Regents of the
University of California. All rights reserved. Portions of the GateD software copyright © 1991, D. L. S. Associates.
Juniper Networks, the Juniper Networks logo, NetScreen, and ScreenOS are registered trademarks of Juniper Networks, Inc. in the United States and other
countries. JUNOS and JUNOSe are trademarks of Juniper Networks, Inc. All other trademarks, service marks, registered trademarks, or registered service
marks are the property of their respective owners.
Juniper Networks 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.
Products made or sold by Juniper Networks or components thereof might be covered by one or more of the following patents that are owned by or licensed
to Juniper Networks: U.S. Patent Nos. 5,473,599, 5,905,725, 5,909,440, 6,192,051, 6,333,650, 6,359,479, 6,406,312, 6,429,706, 6,459,579, 6,493,347,
6,538,518, 6,538,899, 6,552,918, 6,567,902, 6,578,186, and 6,590,785.
Revision History
15 September 2006—Revision 1
The information in this document is current as of the date listed in the revision history.
Juniper Networks hardware and software products are Year 2000 compliant. The JUNOS software has no known time-related limitations through the year
2038. However, the NTP application is known to have some difficulty in the year 2036.
Software License
The terms and conditions for using this software are described in the software license contained in the acknowledgment to your purchase order or, to the
extent applicable, to any reseller agreement or end-user purchase agreement executed between you and Juniper Networks. By using this software, you
indicate that you understand and agree to be bound by those terms and conditions.
Generally speaking, the software license restricts the manner in which you are permitted to use the software and may contain prohibitions against certain
uses. The software license may state conditions under which the license is automatically terminated. You should consult the license for further details.
For complete product documentation, please see the Juniper Networks Web site at www.juniper.net/techpubs.
READ THIS END USER LICENSE AGREEMENT (“AGREEMENT”) BEFORE DOWNLOADING, INSTALLING, OR USING THE SOFTWARE. BY DOWNLOADING,
INSTALLING, OR USING THE SOFTWARE OR OTHERWISE EXPRESSING YOUR AGREEMENT TO THE TERMS CONTAINED HEREIN, YOU (AS CUSTOMER OR
IF YOU ARE NOT THE CUSTOMER, AS A REPRESENTATIVE/AGENT AUTHORIZED TO BIND THE CUSTOMER) CONSENT TO BE BOUND BY THIS
AGREEMENT. IF YOU DO NOT OR CANNOT AGREE TO THE TERMS CONTAINED HEREIN, THEN (A) DO NOT DOWNLOAD, INSTALL, OR USE THE
SOFTWARE, AND (B) YOU MAY CONTACT JUNIPER NETWORKS REGARDING LICENSE TERMS.
1. The Parties. The parties to this Agreement are Juniper Networks, Inc. and its subsidiaries (collectively “Juniper”), and the person or organization that
originally purchased from Juniper or an authorized Juniper reseller the applicable license(s) for use of the Software (“Customer”) (collectively, the “Parties”).
2. The Software. In this Agreement, "Software" means the program modules and features of the Juniper or Juniper-supplied software, and updates and
releases of such software, for which Customer has paid the applicable license or support fees to Juniper or an authorized Juniper reseller. "Embedded
Software" means Software which Juniper has embedded in the Juniper equipment.
3. License Grant. Subject to payment of the applicable fees and the limitations and restrictions set forth herein, Juniper grants to Customer a non-exclusive
and non-transferable license, without right to sublicense, to use the Software, in executable form only, subject to the following use restrictions:
a. Customer shall use the Embedded Software solely as embedded in, and for execution on, Juniper equipment originally purchased by Customer from
Juniper or an authorized Juniper reseller.
b. Customer shall use the Software on a single hardware chassis having a single processing unit, or as many chassis or processing units for which Customer
has paid the applicable license fees; provided, however, with respect to the Steel-Belted Radius or Odyssey Access Client software only, Customer shall use
such Software on a single computer containing a single physical random access memory space and containing any number of processors. Use of the
Steel-Belted Radius software on multiple computers requires multiple licenses, regardless of whether such computers are physically contained on a single
chassis.
ii !
c. Product purchase documents, paper or electronic user documentation, and/or the particular licenses purchased by Customer may specify limits to
Customer's use of the Software. Such limits may restrict use to a maximum number of seats, registered endpoints, concurrent users, sessions, calls,
connections, subscribers, clusters, nodes, realms, devices, links, ports or transactions, or require the purchase of separate licenses to use particular features,
functionalities, services, applications, operations, or capabilities, or provide throughput, performance, configuration, bandwidth, interface, processing,
temporal, or geographical limits. In addition, such limits may restrict the use of the Software to managing certain kinds of networks or require the Software
to be used only in conjunction with other specific Software. Customer's use of the Software shall be subject to all such limitations and purchase of all
applicable licenses.
d. For any trial copy of the Software, Customer's right to use the Software expires 30 days after download, installation or use of the Software. Customer may
operate the Software after the 30-day trial period only if Customer pays for a license to do so. Customer may not extend or create an additional trial period
by re-installing the Software after the 30-day trial period.
e. The Global Enterprise Edition of the Steel-Belted Radius software may be used by Customer only to manage access to Customer's enterprise network.
Specifically, service provider customers are expressly prohibited from using the Global Enterprise Edition of the Steel-Belted Radius software to support any
commercial network access services.
The foregoing license is not transferable or assignable by Customer. No license is granted herein to any user who did not originally purchase the applicable
license(s) for the Software from Juniper or an authorized Juniper reseller.
4. Use Prohibitions. Notwithstanding the foregoing, the license provided herein does not permit the Customer to, and Customer agrees not to and shall not:
(a) modify, unbundle, reverse engineer, or create derivative works based on the Software; (b) make unauthorized copies of the Software (except as necessary
for backup purposes); (c) rent, sell, transfer, or grant any rights in and to any copy of the Software, in any form, to any third party; (d) remove any
proprietary notices, labels, or marks on or in any copy of the Software or any product in which the Software is embedded; (e) distribute any copy of the
Software to any third party, including as may be embedded in Juniper equipment sold in the secondhand market; (f) use any 'locked' or key-restricted
feature, function, service, application, operation, or capability without first purchasing the applicable license(s) and obtaining a valid key from Juniper, even
if such feature, function, service, application, operation, or capability is enabled without a key; (g) distribute any key for the Software provided by Juniper to
any third party; (h) use the Software in any manner that extends or is broader than the uses purchased by Customer from Juniper or an authorized Juniper
reseller; (i) use the Embedded Software on non-Juniper equipment; (j) use the Software (or make it available for use) on Juniper equipment that the
Customer did not originally purchase from Juniper or an authorized Juniper reseller; (k) disclose the results of testing or benchmarking of the Software to
any third party without the prior written consent of Juniper; or (l) use the Software in any manner other than as expressly provided herein.
5. Audit. Customer shall maintain accurate records as necessary to verify compliance with this Agreement. Upon request by Juniper, Customer shall furnish
such records to Juniper and certify its compliance with this Agreement.
6. Confidentiality. The Parties agree that aspects of the Software and associated documentation are the confidential property of Juniper. As such, Customer
shall exercise all reasonable commercial efforts to maintain the Software and associated documentation in confidence, which at a minimum includes
restricting access to the Software to Customer employees and contractors having a need to use the Software for Customer's internal business purposes.
7. Ownership. Juniper and Juniper's licensors, respectively, retain ownership of all right, title, and interest (including copyright) in and to the Software,
associated documentation, and all copies of the Software. Nothing in this Agreement constitutes a transfer or conveyance of any right, title, or interest in the
Software or associated documentation, or a sale of the Software, associated documentation, or copies of the Software.
8. Warranty, Limitation of Liability, Disclaimer of Warranty. The warranty applicable to the Software shall be as set forth in the warranty statement that
accompanies the Software (the “Warranty Statement”). Nothing in this Agreement shall give rise to any obligation to support the Software. Support services
may be purchased separately. Any such support shall be governed by a separate, written support services agreement. TO THE MAXIMUM EXTENT
PERMITTED BY LAW, JUNIPER SHALL NOT BE LIABLE FOR ANY LOST PROFITS, LOSS OF DATA, OR COSTS OR PROCUREMENT OF SUBSTITUTE GOODS
OR SERVICES, OR FOR ANY SPECIAL, INDIRECT, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, THE SOFTWARE, OR ANY JUNIPER
OR JUNIPER-SUPPLIED SOFTWARE. IN NO EVENT SHALL JUNIPER BE LIABLE FOR DAMAGES ARISING FROM UNAUTHORIZED OR IMPROPER USE OF
ANY JUNIPER OR JUNIPER-SUPPLIED SOFTWARE. EXCEPT AS EXPRESSLY PROVIDED IN THE WARRANTY STATEMENT TO THE EXTENT PERMITTED BY
LAW, JUNIPER DISCLAIMS ANY AND ALL WARRANTIES IN AND TO THE SOFTWARE (WHETHER EXPRESS, IMPLIED, STATUTORY, OR OTHERWISE),
INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NONINFRINGEMENT. IN NO EVENT DOES
JUNIPER WARRANT THAT THE SOFTWARE, OR ANY EQUIPMENT OR NETWORK RUNNING THE SOFTWARE, WILL OPERATE WITHOUT ERROR OR
INTERRUPTION, OR WILL BE FREE OF VULNERABILITY TO INTRUSION OR ATTACK. In no event shall Juniper's or its suppliers' or licensors' liability to
Customer, whether in contract, tort (including negligence), breach of warranty, or otherwise, exceed the price paid by Customer for the Software that gave
rise to the claim, or if the Software is embedded in another Juniper product, the price paid by Customer for such other product. Customer acknowledges and
agrees that Juniper has set its prices and entered into this Agreement in reliance upon the disclaimers of warranty and the limitations of liability set forth
herein, that the same reflect an allocation of risk between the Parties (including the risk that a contract remedy may fail of its essential purpose and cause
consequential loss), and that the same form an essential basis of the bargain between the Parties.
9. Termination. Any breach of this Agreement or failure by Customer to pay any applicable fees due shall result in automatic termination of the license
granted herein. Upon such termination, Customer shall destroy or return to Juniper all copies of the Software and related documentation in Customer's
possession or control.
10. Taxes. All license fees for the Software are exclusive of taxes, withholdings, duties, or levies (collectively “Taxes”). Customer shall be responsible for
paying Taxes arising from the purchase of the license, or importation or use of the Software.
11. Export. Customer agrees to comply with all applicable export laws and restrictions and regulations of any United States and any applicable foreign
agency or authority, and not to export or re-export the Software or any direct product thereof in violation of any such restrictions, laws or regulations, or
without all necessary approvals. Customer shall be liable for any such violations. The version of the Software supplied to Customer may contain encryption
or other capabilities restricting Customer's ability to export the Software without an export license.
12. Commercial Computer Software. The Software is “commercial computer software” and is provided with restricted rights. Use, duplication, or
disclosure by the United States government is subject to restrictions set forth in this Agreement and as provided in DFARS 227.7201 through 227.7202-4,
FAR 12.212, FAR 27.405(b)(2), FAR 52.227-19, or FAR 52.227-14(ALT III) as applicable.
13. Interface Information. To the extent required by applicable law, and at Customer's written request, Juniper shall provide Customer with the interface
information needed to achieve interoperability between the Software and another independently created program, on payment of applicable fee, if any.
Customer shall observe strict obligations of confidentiality with respect to such information and shall use such information in compliance with any
applicable terms and conditions upon which Juniper makes such information available.
! iii
14. Third Party Software. Any licensor of Juniper whose software is embedded in the Software and any supplier of Juniper whose products or technology
are embedded in (or services are accessed by) the Software shall be a third party beneficiary with respect to this Agreement, and such licensor or vendor
shall have the right to enforce this Agreement in its own name as if it were Juniper. In addition, certain third party software may be provided with the
Software and is subject to the accompanying license(s), if any, of its respective owner(s). To the extent portions of the Software are distributed under and
subject to open source licenses obligating Juniper to make the source code for such portions publicly available (such as the GNU General Public License
(“GPL”) or the GNU Library General Public License (“LGPL”)), Juniper will make such source code portions (including Juniper modifications, as appropriate)
available upon request for a period of up to three years from the date of distribution. Such request can be made in writing to Juniper Networks, Inc., 1194 N.
Mathilda Ave., Sunnyvale, CA 94089, ATTN: General Counsel. You may obtain a copy of the GPL at http://www.gnu.org/licenses/gpl.html, and a copy of the
LGPL at http://www.gnu.org/licenses/lgpl.html.
15. Miscellaneous. This Agreement shall be governed by the laws of the State of California without reference to its conflicts of laws principles. The
provisions of the U.N. Convention for the International Sale of Goods shall not apply to this Agreement. For any disputes arising under this Agreement, the
Parties hereby consent to the personal and exclusive jurisdiction of, and venue in, the state and federal courts within Santa Clara County, California. This
Agreement constitutes the entire and sole agreement between Juniper and the Customer with respect to the Software, and supersedes all prior and
contemporaneous agreements relating to the Software, whether oral or written (including any inconsistent terms contained in a purchase order), except that
the terms of a separate written agreement executed by an authorized Juniper representative and Customer shall govern to the extent such terms are
inconsistent or conflict with terms contained herein. No modification to this Agreement nor any waiver of any rights hereunder shall be effective unless
expressly assented to in writing by the party to be charged. If any portion of this Agreement is held invalid, the Parties agree that such invalidity shall not
affect the validity of the remainder of this Agreement. This Agreement and associated documentation has been written in the English language, and the
Parties agree that the English version will govern. (For Canada: Les parties aux présentés confirment leur volonté que cette convention de même que tous
les documents y compris tout avis qui s'y rattaché, soient redigés en langue anglaise. (Translation: The parties confirm that this Agreement and all related
documentation is and will be in the English language)).
iv !
Abbreviated Table of Contents
About This Guide xv
Part 1 Introduction
Chapter 1 Introducing the CLI 3
Chapter 2 Getting Started: A Quick Tour of the CLI 9
Chapter 3 CLI Basics 25
Chapter 4 Getting Online Help 37
Part 5 Indexes
Index 227
Index of Statements and Commands 235
Part 1 Introduction
Table of Contents ! ix
JUNOS 8.1 CLI User Guide
x ! Table of Contents
Table of Contents
Table of Contents ! xi
JUNOS 8.1 CLI User Guide
Part 5 Indexes
Index........................................................................................................................ 227
Index of Statements and Commands............................................................ 235
This preface provides the following guidelines for using the JUNOS Internet Software
CLI User Guide and related Juniper Networks, Inc., technical documents:
! Objectives on page xv
Objectives
This guide describes how to use the JUNOS command-line interface (CLI) to
configure, monitor, and manage Juniper Networks routing platforms.
NOTE: This guide documents Release 8.1 of the JUNOS Internet software. For
additional information about the JUNOS software—either corrections to or
information that might have been omitted from this guide—see the software
release notes at http://www.juniper.net/.
! J-series
! M-series
! T-series
Objectives ! xv
JUNOS 8.1 CLI User Guide
Audience
This guide is designed for network administrators who are configuring and
monitoring a Juniper Networks routing platform.
To use this guide, you need a broad understanding of networks in general, the
Internet in particular, networking principles, and network configuration. You must
also be familiar with one or more of the following Internet routing protocols:
Personnel operating the equipment must be trained and competent; must not
conduct themselves in a careless, willfully negligent, or hostile manner; and must
abide by the instructions provided by the documentation.
xvi ! Audience
About This Guide
If the example configuration does not start at the top level of the hierarchy, the
example is a snippet. In this case, use the load merge relative command. These
procedures are described in the following sections.
1. From the HTML or PDF version of the manual, copy a configuration example
into a text file, save the file with a name, and copy the file to a directory on your
routing platform.
For example, copy the following configuration to a file and name the file
ex-script.conf. Copy the ex-script.conf file to the /var/tmp directory on your
routing platform.
system {
scripts {
commit {
file ex-script.xsl;
}
}
}
interfaces {
fxp0 {
disable;
unit 0 {
family inet {
address 10.0.0.1/24;
}
}
}
}
2. Merge the contents of the file into your routing platform configuration by
issuing the load merge configuration mode command:
[edit]
user@host# load merge /var/tmp/ex-script.conf
load complete
Merging a Snippet
To merge a snippet, follow these steps:
1. From the HTML or PDF version of the manual, copy a configuration snippet
into a text file, save the file with a name, and copy the file to a directory on your
routing platform.
For example, copy the following snippet to a file and name the file
ex-script-snippet.conf. Copy the ex-script-snippet.conf file to the /var/tmp
directory on your routing platform.
commit {
file ex-script-snippet.xsl;
}
2. Move to the hierarchy level that is relevant for this snippet by issuing the
following configuration mode command:
[edit]
user@host# edit system scripts
[edit system scripts]
3. Merge the contents of the file into your routing platform configuration by
issuing the load merge relative configuration mode command:
For more information about the load command, see the JUNOS CLI User Guide.
Documentation Conventions
Table 1 defines notice icons used in this guide.
Table 2 defines the text and syntax conventions used in this guide.
Italic typeface ! Introduces important new terms. ! A policy term is a named structure that defines
match conditions and actions.
! Identifies book names. ! JUNOS System Basics Configuration Guide
! Identifies RFC and Internet draft titles. ! RFC 1997, BGP Communities Attribute
Italic sans serif typeface Represents variables (options for which Configure the machine’s domain name:
you substitute a value) in commands or [edit]
configuration statements. root@# set system domain-name domain-name
Sans serif typeface Represents names of configuration ! To configure a stub area, include the stub
statements, commands, files, and statement at the [edit protocols ospf area area-id]
directories; IP addresses; configuration hierarchy level.
hierarchy levels; or labels on routing ! The console port is labeled CONSOLE.
platform components.
< > (angle brackets) Enclose optional keywords or variables. stub <default-metric metric>;
| (pipe symbol) Indicates a choice between the mutually broadcast | multicast
exclusive keywords or variables on either (string1 | string2 | string3)
side of the symbol. The set of choices is
often enclosed in parentheses for clarity.
# (pound sign) Indicates a comment specified on the rsvp { # Required for dynamic MPLS only
same line as the configuration statement
to which it applies.
[ ] (square brackets) Enclose a variable for which you can community name members [ community-ids ]
substitute one or more values.
Indention and braces ( { } ) Identify a level in the configuration [edit]
hierarchy. routing-options {
static {
route default {
; (semicolon) Identifies a leaf statement at a nexthop address;
configuration hierarchy level. retain;
}
}
}
J-Web GUI Conventions
Bold typeface Represents J-Web graphical user interface ! In the Logical Interfaces box, select All Interfaces.
(GUI) items you click or select. ! To cancel the configuration, click Cancel.
> (bold right angle bracket) Separates levels in a hierarchy of J-Web In the configuration editor hierarchy, select
selections. Protocols>Ospf.
Document Description
JUNOS Internet Software Configuration Guides
Class of Service Provides an overview of the class-of-service (CoS) functions of the JUNOS software
and describes how to configure CoS features, including configuring multiple
forwarding classes for transmitting packets, defining which packets are placed into
each output queue, scheduling the transmission service level for each queue, and
managing congestion through the random early detection (RED) algorithm.
CLI User Guide Describes how to use the JUNOS command-line interface (CLI) to configure, monitor,
and manage Juniper Networks routing platforms. This material was formerly
covered in the JUNOS System Basics Configuration Guide.
Feature Guide Provides a detailed explanation and configuration examples for several of the most
complex features in the JUNOS software.
High Availability Provides an overview of hardware and software resources that ensure a high level of
continuous routing platform operation and describes how to configure high
availability (HA) features such as nonstop routing (NSR) and graceful Routing Engine
switchover (GRES).
MPLS Applications Provides an overview of traffic engineering concepts and describes how to configure
traffic engineering protocols.
Multicast Protocols Provides an overview of multicast concepts and describes how to configure
multicast routing protocols.
Network Interfaces Provides an overview of the network interface functions of the JUNOS software and
describes how to configure the network interfaces on the routing platform.
Network Management Provides an overview of network management concepts and describes how to
configure various network management features, such as SNMP and accounting
options.
Policy Framework Provides an overview of policy concepts and describes how to configure routing
policy, firewall filters, forwarding options, and cflowd.
Routing Protocols Provides an overview of routing concepts and describes how to configure routing,
routing instances, and unicast routing protocols.
Secure Configuration Guide for Common Provides an overview of secure Common Criteria and JUNOS-FIPS protocols for the
Criteria and JUNOS-FIPS JUNOS Internet software and describes how to install and configure secure Common
Criteria and JUNOS-FIPS on a routing platform.
Services Interfaces Provides an overview of the services interfaces functions of the JUNOS software and
describes how to configure the services interfaces on the routing platform.
Software Installation and Upgrade Guide Provides a description of JUNOS software components and packaging, and includes
detailed information about how to initially configure, reinstall, and upgrade the
JUNOS system software. This material was formerly covered in the JUNOS System
Basics Configuration Guide.
System Basics Describes Juniper Networks routing platforms, and provides information about how
to configure basic system parameters, supported protocols and software processes,
authentication, and a variety of utilities for managing your router on the network.
Document Description
VPNs Provides an overview and describes how to configure Layer 2 and Layer 3 virtual
private networks (VPNs), virtual private LAN service (VPLS), and Layer 2 circuits.
Provides configuration examples.
JUNOS References
Hierarchy and RFC Reference Describes the JUNOS configuration mode commands. Provides a hierarchy
reference that displays each level of a configuration hierarchy, and includes all
possible configuration statements that can be used at that level. This material was
formerly covered in the JUNOS System Basics Configuration Guide.
Interfaces Command Reference Describes the JUNOS software operational mode commands you use to monitor and
troubleshoot interfaces.
Routing Protocols and Policies Command Describes the JUNOS software operational mode commands you use to monitor and
Reference troubleshoot routing protocols and policies, including firewall filters.
System Basics and Services Command Describes the JUNOS software operational mode commands you use to monitor and
Reference troubleshoot system basics, including commands for real-time monitoring and route
(or path) tracing, system software management, and chassis management. Also
describes commands for monitoring and troubleshooting services such as CoS, IP
Security (IPSec), stateful firewalls, flow collection, and flow monitoring.
System Log Messages Reference Describes how to access and interpret system log messages generated by JUNOS
software modules and provides a reference page for each message.
J-Web User Guide
J-Web Interface User Guide Describes how to use the J-Web GUI to configure, monitor, and manage Juniper
Networks routing platforms.
JUNOS API and Scripting Documentation
JUNOScript API Guide Describes how to use the JUNOScript application programming interface (API) to
monitor and configure Juniper Networks routing platforms.
JUNOS XML API Configuration Reference Provides reference pages for the configuration tag elements in the JUNOS XML API.
JUNOS XML API Operational Reference Provides reference pages for the operational tag elements in the JUNOS XML API.
JUNOS Configuration and Diagnostic Describes how to use the commit script and self-diagnosis features of the JUNOS
Automation Guide software. This guide explains how to enforce custom configuration rules defined in
scripts, how to use commit script macros to provide simplified aliases for frequently
used configuration statements, and how to configure diagnostic event policies.
NETCONF API Guide Describes how to use the NETCONF API to monitor and configure Juniper Networks
routing platforms.
JUNOS Comprehensive Index and Glossary
Comprehensive Index and Glossary Provides a complete index of all JUNOS software books, the JUNOScript API Guide,
and the NETCONF API Guide. Also provides a comprehensive glossary.
JUNOScope Documentation
JUNOScope Software User Guide Describes the JUNOScope software GUI, how to install and administer the software,
and how to use the software to manage routing platform configuration files and
monitor routing platform operations.
Document Description
J-series Services Router Documentation
Getting Started Guide Provides an overview, basic instructions, and specifications for J-series Services
Routers. The guide explains how to prepare your site for installation, unpack and
install the router and its components, install licenses, and establish basic
connectivity. Use the Getting Started Guide for your router model.
Basic LAN and WAN Access Configuration Explains how to configure the interfaces on J-series Services Routers for basic IP
Guide routing with standard routing protocols, ISDN backup, and digital subscriber line
(DSL) connections.
Advanced WAN Access Configuration Explains how to configure J-series Services Routers in virtual private networks
Guide (VPNs) and multicast networks, configure data link switching (DLSw) services, and
apply routing techniques such as policies, stateless and stateful firewall filters, IP
Security (IPSec) tunnels, and class-of-service (CoS) classification for safer, more
efficient routing.
Administration Guide Shows how to manage users and operations, monitor network performance,
upgrade software, and diagnose common problems on J-series Services Routers.
M-series and T-series Hardware Documentation
Hardware Guide Describes how to install, maintain, and troubleshoot routing platforms and
components. Each platform has its own hardware guide.
PIC Guide Describes the routing platform PICs. Each platform has its own PIC guide.
Release Notes
JUNOS Release Notes Summarize new features and known problems for a particular software release,
provide corrections and updates to published JUNOS, JUNOScript, and NETCONF
manuals, provide information that might have been omitted from the manuals, and
describe upgrade and downgrade procedures.
Hardware Release Notes Describe the available documentation for the routing platform and the supported
PICs, and summarize known problems with the hardware and accompanying
software. Each platform has its own release notes.
JUNOScope Software Release Notes Contain corrections and updates to the published JUNOScope manual, provide
information that might have been omitted from the manual, and describe upgrade
and downgrade procedures.
J-series Services Router Release Notes Briefly describe the J-series Services Router features, identify known hardware
problems, and provide upgrade and downgrade instructions.
Book Description
Baseline Describes the most basic tasks for running a network using Juniper Networks
products. Tasks include upgrading and reinstalling JUNOS software, gathering basic
system management information, verifying your network topology, and searching
log messages.
Interfaces Describes tasks for monitoring interfaces. Tasks include using loopback testing and
locating alarms.
MPLS Describes tasks for configuring, monitoring, and troubleshooting an example MPLS
network. Tasks include verifying the correct configuration of the MPLS and RSVP
protocols, displaying the status and statistics of MPLS running on all routers in the
network, and using the layered MPLS troubleshooting model to investigate problems
with an MPLS network.
Book Description
MPLS Log Reference Describes MPLS status and error messages that appear in the output of the show
mpls lsp extensive command. The guide also describes how and when to configure
Constrained Shortest Path First (CSPF) and RSVP trace options, and how to examine
a CSPF or RSVP failure in a sample network.
Hardware Describes tasks for monitoring M-series and T-series routing platforms.
Documentation Feedback
We encourage you to provide feedback, comments, and suggestions so that we can
improve the documentation. Send your comments to
[email protected], or fill out the documentation feedback form at
http://www.juniper.net/techpubs/docbug/docbugreport.html. If you are using e-mail,
be sure to include the following information with your comments:
! Document name
! Page number
Requesting Support
For technical support, open a support case using the Case Manager link at
http://www.juniper.net/support/ or call 1-888-314-JTAC (from the United States,
Canada, or Mexico) or 1-408-745-9500 (from elsewhere).
Introduction ! 1
JUNOS 8.1 CLI User Guide
2 ! Introduction
Chapter 1
Introducing the CLI
The JUNOS command-line interface (CLI) is the software interface you use to access
the router—whether from the console or through a network connection. This
chapter provides an overview of the JUNOS CLI.
The JUNOS CLI is a Juniper Networks-specific command shell that runs on top of a
UNIX-based operating system kernel. By leveraging industry-standard tools and
utilities, the CLI provides a powerful set of commands you can use to monitor and
configure a router. (See Figure 1.)
When you enter configuration mode, you are actually viewing and changing a file
called the candidate configuration. The candidate configuration allows you to make
configuration changes without causing operational changes to the current operating
configuration, called the active configuration. The router does not implement the
changes you added to the candidate configuration until you commit them, which
activates the configuration on the router. (See Figure 2.) Candidate configurations
enable you to alter your configuration without causing potential damage to your
current network operations.
CLI
(Configuration Mode)
g017227
show
1411
brief exact protocol table terse
To execute a command, you enter the full command name, starting at the top level
of the hierarchy. For example, to display a brief view of the routes in the router
table, use the command show route brief.
Figure 4 on page 6 illustrates a part of the hierarchy tree. The protocols statement is
a top-level statement at the trunk of the configuration tree. The ospf, area, and
interface statements are all subordinate container statements of a higher statement
(they are branches of the hierarchy tree), and the hello-interval statement is a leaf on
the tree.
Protocols bgp
dvmrp
icmp dead-interval
igmp hello-interval
isis interface-type
mpis area-range metric
ospf area interface mtu
rip traceoptions stub poll-interval
router-discovery virtual-link priority
rsvp retransmit-interval
sap transit-delay
1412
transmit-interval
! Use regular expression matching to locate and replace values and identifiers in
a configuration, filter command output, or examine log file entries.
! Use Emacs-based key sequences to scroll through command output or edit the
command line,
! You can use standard UNIX conventions to specify filenames and paths.
! You can exit from the CLI environment and create a UNIX C shell or Bourne
shell to navigate the file system, manage router processes, and so on.
Topics include:
! Logging In on page 10
NOTE: The instructions and examples in this book are based on sample M-series
and T-series routers. You can use them as a guideline for entering commands on
your own routers.
Logging In
Log in to the router and start the CLI:
1. Log in as root.
The root login account has superuser privileges, with access to all commands
and statements.
root# cli
root@>
The > command prompt shows you are in operational mode. Later, when you
enter configuration mode, the prompt will change to #.
NOTE: If you are using the root account for the first time on the router, remember
that the router ships with no password required for root, but the first time you
commit a configuration with JUNOS 7.6 software (or a later release), you must set
a root password. Root access is not allowed over a telnet session. To enable root
access over an SSH connection, you must configure the system services ssh
root-login allow statement.
Displaying Commands
The CLI includes several ways to get help about commands. This section shows
some examples of how to get help.
root@> ?
Possible completions:
clear Clear information in the system
configure Manipulate software configuration information
diagnose Invoke diagnose script
file Perform file operations
help Provide help information
monitor Show real-time debugging information
mtrace Trace multicast path from source to receiver
ping Ping remote target
quit Exit the management session
request Make system-level requests
restart Restart software process
set Set CLI properties, date/time, craft interface message
show Show system information
ssh Start secure shell on another host
start Start shell
telnet Telnet to another host
test Perform diagnostic debugging
traceroute Trace route to remote host
10 ! Logging In
Chapter 2: Getting Started: A Quick Tour of the CLI
2. Type file ? to show all possible completions for the file command.
root@> file ?
Possible completions:
<[Enter]> Execute this command
archive Archives files from the system
checksum Calculate file checksum
compare Compare files
copy Copy files (local or remote)
delete Delete files from the system
list List file information
rename Rename files
show Show file contents
source-address Local address to use in originating the connection
| Pipe through a command
3. Type file archive ? to show all possible completions for the file archive
command.
For more information about getting help about commands and statements, see
“Getting Online Help” on page 37.
Displaying Commands ! 11
JUNOS 8.1 CLI User Guide
1. Type show ? to display the list of show commands you can use to monitor the
router:
root@> show ?
Possible completions:
accounting Show accounting profiles and records
aps Show Automatic Protection Switching information
arp Show system Address Resolution Protocol table entries
as-path Show table of known autonomous system paths
bfd Show Bidirectional Forwarding Detection information
bgp Show Border Gateway Protocol information
chassis Show chassis information
class-of-service Show class-of-service (CoS) information
cli Show command-line interface settings
configuration Show current configuration
connections Show circuit cross-connect connections
dvmrp Show Distance Vector Multicast Routing Protocol info
dynamic-tunnels Show dynamic tunnel information information
esis Show end system-to-intermediate system information
firewall Show firewall information
helper Show port-forwarding helper information
host Show hostname information from domain name server
igmp Show Internet Group Management Protocol information
ike Show Internet Key Exchange information
ilmi Show interim local management interface information
interfaces Show interface information
ipsec Show IP Security information
ipv6 Show IP version 6 information
isis Show Intermediate System-to-Intermediate System info
l2circuit Show Layer 2 circuit information
l2vpn Show Layer 2 VPN information
lacp Show Link Aggregation Control Protocol information
ldp Show Label Distribution Protocol information
link-management Show link management information
llc2 Show LLC2 protocol related information
log Show contents of log file
mld Show multicast listener discovery information
mpls Show Multiprotocol Label Switching information
msdp Show Multicast Source Discovery Protocol information
multicast Show multicast information
ntp Show Network Time Protocol information
ospf Show Open Shortest Path First information
ospf3 Show Open Shortest Path First version 3 information
passive-monitoring Show information about passive monitoring
pfe Show Packet Forwarding Engine information
pgm Show Pragmatic Generalized Multicast information
pim Show Protocol Independent Multicast information
policer Show interface policer counters and information
policy Show policy information
ppp Show PPP process information
rip Show Routing Information Protocol information
ripng Show Routing Information Protocol for IPv6 info
route Show routing table information
rsvp Show Resource Reservation Protocol information
sap Show Session Announcement Protocol information
security Show security information
2. Use the show chassis routing-engine command to view Routing Engine status:
3. Use the show system storage command to view available storage on the router:
root@host> configure
[edit]
root@host#
The prompt in brackets ([edit]), also known as a banner, shows that you are in
configuration edit mode, at the top of the hierarchy.
[edit]
root@host# edit system login
The prompt in brackets changes to [edit system login] to show you are at a new
level in the hierarchy.
This example adds an account nchen (for Nathan Chen), but you can use any
account name.
4. Configure a full name for the account. If the name includes spaces, enclose the
entire name in quotation marks (" "):
5. Configure an account class. The account class sets the user access privileges for
the account.
When the new password prompt appears, enter a clear-text password that the
system will encrypt, then confirm the new password.
Configuration changes are not activated until you commit the configuration. If
the commit is successful, a commit complete message appears.
[edit]
root@host# exit
Exiting configuration mode
root@host> exit
10. To test your changes, log back in with the user account and password you just
configured:
>
login: nchen
Password: <password>
When you log in, you should see the new username at the command prompt.
Congratulations! You have successfully used the CLI to view router status and
perform a simple configuration change. Now, you are ready to learn more about
the CLI. See the remaining chapters of this book for details.
NOTE: For complete information about the commands to issue to configure your
router, including examples, see the JUNOS software configuration guides.
[edit]
protocols {
ospf {
area 0.0.0.0 {
interface so-0/0/0 {
hello-interval 5;
dead-interval 20;
}
interface so-0/0/1 {
hello-interval 5;
dead-interval 20;
}
}
}
}
Shortcut
You can create this entire configuration with two commands:
[edit]
user@host# set protocols ospf area 0.0.0.0 interface so-0/0/0 hello-interval 5
dead-interval 20
[edit]
user@host# set protocols ospf area 0.0.0.0 interface so-0/0/1 hello-interval 5
dead-interval 20
user@host> configure
entering configuration mode
[edit]
user@host#
Notice that the prompt has changed to a pound sign (#) to indicate
configuration mode.
2. To create the above configuration, you start by editing the protocols ospf
statements:
[edit]
user@host# edit protocols ospf
[edit protocols ospf]
user@host#
6. You can see what is configured at the current level with the show command:
7. You are finished at this level, so back up a level and take a look at what you
have so far:
The interface statement appears because you have moved to the area
statement.
10. Before committing the configuration (and thereby activating it), verify that the
configuration is correct:
[edit]
user@host# commit check
configuration check succeeds
[edit]
user@host#
[edit]
user@host# commit
commit complete
[edit]
user@host#
Suppose you decide to use different dead and hello intervals on interface so-0/0/1.
You can make changes to the configuration.
1. You can go directly to the appropriate hierarchy level by typing the full
hierarchy path to the statement you want to edit.
[edit]
user@host# edit protocols ospf area 0.0.0.0 interface so-0/0/1
[edit protocols ospf area 0.0.0.0 interface so-0/0/1]
user@host# show
hello-interval 5;
dead-interval 20;
[edit protocols ospf area 0.0.0.0 interface so-0/0/1]
user@host# set hello-interval 7
[edit protocols ospf area 0.0.0.0 interface so-0/0/1]
user@host# set dead-interval 28
[edit protocols ospf area 0.0.0.0 interface so-0/0/1]
user@host# top
[edit]
user@host# show
protocols {
ospf {
area 0.0.0.0 {
interface so-0/0/0 {
hello-interval 5;
dead-interval 20;
}
interface so-0/0/1 {
hello-interval 7;
dead-interval 28;
}
}
}
}
[edit]
user@host#
2. If you change your mind and decide not to run OSPF on the first interface, you
can delete the statement:
[edit]
user@host# edit protocols ospf area 0.0.0.0
[edit protocols ospf area 0.0.0.0]
user@host# delete interface so-0/0/0
[edit protocols ospf area 0.0.0.0]
user@host# top
[edit]
user@host# show
protocols {
ospf {
area 0.0.0.0 {
interface so-0/0/1 {
hello-interval 7;
dead-interval 28;
}
}
}
}
[edit]
user@host#
Everything inside the statement you deleted was deleted with it. You can also
eliminate the entire OSPF configuration by simply entering delete protocols
ospf while at the top level.
3. If you decide to use the default values for the hello and dead intervals on your
remaining interface, but you want OSPF to run on that interface, you can delete
the hello and dead interval timers:
[edit]
user@host# edit protocols ospf area 0.0.0.0 interface so-0/0/1
[edit protocols ospf area 0.0.0.0 interface so-0/0/1]
user@host# delete hello-interval
[edit protocols ospf area 0.0.0.0 interface so-0/0/1]
user@host# delete dead-interval
[edit protocols ospf area 0.0.0.0 interface so-0/0/1]
user@host# top
[edit]
user@host# show
protocols {
ospf {
area 0.0.0.0 {
interface so-0/0/1;
}
}
}
[edit]
user@host#
You can set multiple statements at the same time as long as they are all part of
the same hierarchy (the path of statements from the top inward, as well as one
or more statements at the bottom of the hierarchy). This can reduce
considerably the number of commands you must enter.
4. To go back to the original hello and dead interval timers on interface so-0/0/1,
you can enter:
[edit]
user@host# edit protocols ospf area 0.0.0.0 interface so-0/0/1
[edit protocols ospf area 0.0.0.0 interface so-0/0/1]
user@host# set hello-interval 5 dead-interval 20
[edit protocols ospf area 0.0.0.0 interface so-0/0/1]
user@host# exit
[edit]
user@host# show
protocols {
ospf {
area 0.0.0.0 {
interface so-0/0/1 {
hello-interval 5;
dead-interval 20;
}
}
}
}
[edit]
user@host#
5. You also can recreate the other interface, as you had it before, with only a single
entry:
[edit]
user@host# set protocols ospf area 0.0.0.0 interface so-0/0/1 hello-interval 5
dead-interval 20
[edit]
user@host# show
protocols {
ospf {
area 0.0.0.0 {
interface so-0/0/0 {
hello-interval 5;
dead-interval 20;
}
interface so-0/0/1 {
hello-interval 5;
dead-interval 20;
}
}
}
}
This example shows how to configure an SNMP health monitor on the router, then
return to the most recently committed configuration that does not include the
health monitor. When configured, the SNMP health monitor provides network
management systems (NMS) with predefined monitoring for file system usage, CPU
usage, and memory usage on the router.
user@host> configure
entering configuration mode
[edit]
user@host#
[edit]
user@host# show snmp
No snmp statements appear. SNMP has not been configured on the router.
[edit]
user@host# set snmp health-monitor
[edit]
user@host# show snmp
health-monitor;
5. Use the rollback configuration mode command to return to the most recently
committed configuration:
[edit]
user@host# rollback
load complete
6. Show the configuration again to make sure your change is no longer present:
[edit]
user@host# show snmp
7. Use the commit command to activate the configuration to which you rolled
back:
[edit]
user@host# commit
[edit]
user@host# exit
Exiting configuration mode
You can also use the rollback command to return to earlier configurations. For more
information, see “Managing Configurations” on page 115.
This chapter provides basic information about the JUNOS CLI. Topics include:
CLI Basics ! 25
JUNOS 8.1 CLI User Guide
user@host> configure
entering configuration mode
Banner [edit]
user@host#
Command prompt (#)
The portion of the prompt in square brackets, [edit], is a banner. The banner
indicates that you are in configuration mode and shows your location in the
statement hierarchy. When you first enter configuration mode, you are always at
the top level of the hierarchy, as indicated by the [edit] banner. (See Figure 7.)
user@host> configure
entering configuration mode
Top-level banner [edit]
user@host# edit protocols bgp
Banner at the [protocols [edit protocols bgp]
bgp] hierarchy level user@host#
CLI Messages
The CLI displays messages when you enter and exit from configuration and
operational command modes, when you successfully complete some commands,
and when you type an invalid string or value.
[edit]
user@host# telnet
^
unknown command.
When the number of choices is limited, a message might display the commands
you can enter to correct the syntax error. For example:
[edit]
user@host# load myconfig-file<Enter>
^
syntax error, expecting ‘merge’, ‘override’, or ‘replace’.
In configuration mode, if you do not type an option for a statement that requires
one, a message indicates the type of information expected.
CLI Messages ! 27
JUNOS 8.1 CLI User Guide
In this example, you need to type an area number to complete the command:
[edit]
user@host# set protocols ospf area<Enter>
^
syntax error, expecting <identifier>.
In this example, you need to type a value for the hello interval to complete the
command:
[edit]
user@host# set protocols ospf area 45 interface so-0/0/0
hello-interval<Enter>
^
syntax error, expecting <data>
If you have omitted a required statement at a particular hierarchy level, when you
attempt to move from that hierarchy level or when you issue the show command in
configuration mode, a message indicates which statement is missing. For example:
28 ! CLI Messages
Chapter 3: CLI Basics
Table 5 lists some common keyboard sequences you can use at the ---(more)---
prompt. As soon as the CLI knows how long the output is (usually by the second
screen), it displays the percentage of the command output above the prompt.
Occasionally, if a command produces extensive output, you may wish to cancel the
output.
To cancel command output, press Ctrl+c. Command output stops and the
command prompt appears. (See Figure 9.)
SEFS-S 1223072
SONET line:
BIP-B2 0 0
REI-L 0 0
RDI-L 0 0 OK
AIS-L 1223072 1 Defect Active
BERR-SF 0 0 OK
BERR-SD 0 0 OK
ES-L 1223072
SES-L 1223072
UAS-L 1223062
ES-LFE 0
SES-LFE 0
UAS-LFE 0
Command output is ---(more 31%)---[abort]
cancelled.
user@host>
For more information about working with command output, see “Filtering
Command Output” on page 135.
! For a complete list of CLI operational mode commands, see the JUNOS
command reference guides.
Command Options
When working on the command line, you are bound by specific CLI syntax rules.
Some commands function very simply with just a single word necessary to run
them. Others have required options that you must enter to complete the command.
Additionally, commands may have options that are not required, allowing you to
change the way they run or the information they return.
The command and statement summaries in the JUNOS software books show which
options are required and which options are not. Options that are not required are
shown with angle brackets (<>). (See Figure 10 on page 32.)
Command summary
Command options:
Not required
Required
g017229
Configuration Statements and Identifiers
You configure all router properties by including statements in the configuration. A
statement consists of a keyword, which is fixed text, and, optionally, an identifier.
An identifier is an identifying name that you define, such as the name of an
interface or a username, and that allows you and the CLI to discriminate among a
collection of statements.
The following list shows the statements available at the top level of configuration
mode (that is, the trunk of the hierarchy tree).
user@host# set ?
Possible completions:
> accounting-options Accounting data configuration
+ apply-groups Groups from which to inherit configuration
data
> chassis Chassis configuration
> class-of-service Class-of-service configuration
> firewall Define a firewall configuration
> forwarding-options Configure options to control packet sampling
> groups Configuration groups
> interfaces Interface configuration
> policy-options Routing policy option configuration
> protocols Routing protocol configuration
> routing-instances Routing instance configuration
> routing-options Protocol-independent routing option
configuration
> snmp Simple Network Management Protocol
> system System parameters
An angle bracket ( > ) before the statement name indicates that it is a container
statement and that you can set values for other statements at levels below it.
If there is no angle bracket ( > ) before the statement name, the statement is a leaf
statement; you cannot define other statements at hierarchy levels below it.
A plus sign (+) before the statement name indicates that it can contain a set of
values. To specify a set, include the values in brackets. For example:
[edit]
user@host# set policy-options community my-as1-transit members [65535:10
65535:11]
For statements that include identifiers, such as interface names, you must specify
the identifier in a JUNOS-defined format. For example, the interface name so-0/0/0
refers to a SONET/SDH interface that is on the Flexible PIC Concentrator (FPC) in
slot 0, in the first PIC location, and in the first port on the Physical Interface Card
(PIC). For other identifiers, such as interface descriptive text and policy and firewall
term names, you can specify any name, including special characters, spaces, and
tabs.
You must enclose in quotation marks (double quotes) identifiers and any strings
that include the following characters: space tab ( ) [ ] { } ! @ # $ % ^ & | ’ = ?
For example, users with configure permissions can use the configure command to
enter configuration mode, and users with firewall permissions can view the firewall
filter configuration in configuration mode. The root login account has superuser
privileges—with access to all commands and statements.
Required privilege levels are listed in command and statement summaries. For
more information about setting user accounts and privileges, see the JUNOS System
Basics Configuration Guide.
1. When you log in to the router and type the cli command, you are automatically
in operational mode:
user@host# cli
user@host >
2. To enter configuration mode, type the configure command or the edit command
from the CLI operation mode. For example:
user@host> configure
entering configuration mode
[edit]
user@host#
The CLI prompt changes from user@host> to user@host# and a banner appears
to indicate the hierarchy level.
[edit]
user@host# commit and-quit
commit complete
Exiting configuration mode
user@host>
[edit]
user@host# exit
Exiting configuration mode
user@host>
When you exit configuration mode, the CLI prompt changes from user@host#
to user@host> and the banner no longer appears. You can enter or exit
configuration mode as many times as you wish without committing your
changes.
[edit]
user@host# run operational-mode-command
For example, to display the currently set priority value of the Virtual Router
Redundancy Protocol (VRRP) primary router while you are modifying the VRRP
configuration for a backup router:
Command Description
edit hierarchy-level Moves to an existing configuration statement hierarchy or creates a
hierarchy and moves to that level
exit Moves up the hierarchy to the previous level where you were working. This
command is, in effect, the opposite of the edit command. Alternatively, you
can use the quit command. exit and quit are interchangeable.
up Moves up the hierarchy one level at a time
top Moves directly to the top level of the hierarchy
By default, this command displays the last 100 commands issued in the CLI. If you
specify a number with the command, it displays that number of recent commands.
For example:
If you scroll completely to the beginning of the list, typing Esc+. or Alt+. again
restarts scrolling from the last word entered.
Topics include:
! If you type the question mark at the command-line prompt, the CLI lists the
available commands and options. For example, to view a list of top-level
operational mode commands, type a question mark (?) at the command-line
prompt.
user@host> ?
Possible completions:
clear Clear information in the system
configure Manipulate software configuration information
file Perform file operations
help Provide help information
mtrace Trace mtrace packets from source to receiver.
monitor Real-time debugging
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
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
user@host>
! If you type the question mark after entering the complete name of a command
or command option, the CLI lists the available commands and options, then
redisplays the command names and options that you typed.
user@host> clear ?
Possible completions:
arp Clear address-resolution information
bgp Clear BGP information
chassis Clear chassis information
firewall Clear firewall counters
igmp Clear IGMP information
interfaces Clear interface information
ilmi Clear ILMI statistics information
isis Clear IS-IS information
ldp Clear LDP information
log Clear contents of a log file
mpls Clear MPLS information
msdp Clear MSDP information
multicast Clear Multicast information
ospf Clear OSPF information
pim Clear PIM information
rip Clear RIP information
route Clear routing table information
rsvp Clear RSVP information
! If you type the question mark in the middle of a command name, the CLI lists
possible command completions that match the letters you have entered so far,
then redisplays the letters that you typed. For example, to list all operational
mode commands that start with the letter c, type the following:
user@host> c?
Possible completions:
clear Clear information in the system
configure Manipulate software configuration information
user@host>c
! For introductory information on using the question mark or the help command,
you can also type help and press Enter:
user@host>help
string is a text string about which you want to get help. This string is used to match
statement or command names as well as the help strings that are displayed for the
statements or commands. (See the example on page 41.)
If the string contains spaces, enclose it in quotation marks (" "). You also can specify
a regular expression for the string, using standard UNIX-style regular expression
syntax.
In configuration mode, this command displays statement names and help text that
matches the string specified. In operational mode, this command displays
command names and help text that matches the string specified.
[edit]
user@host# help apropos traps
set interfaces <interface_name>
Enable SNMP notifications on state changes
set interfaces <interface_name> unit <interface_unit_number>
Enable SNMP notifications on state changes
set snmp trap-group
Configure traps and notifications
set snmp trap-group <group_name> version <version> all
Send SNMPv1 and SNMPv2 traps
The help topic command displays usage guidelines for the statement based on
information that appears in the JUNOS configuration guides. The help reference
command displays summary information about the statement based on the
summary descriptions that appear in the JUNOS configuration guides.
The help syslog command displays the contents of a system log message.
! To complete a command or option that you have partially typed, press the Tab
key or the Spacebar. If the partially typed letters begin a string that uniquely
identifies a command, the complete command name appears. Otherwise, a
prompt indicates that you have entered an ambiguous command, and the
possible completions are displayed.
Display a list of all log files whose names start with the string “messages,” and then
display the contents of one of the files:
user@host# ?
Possible completions:
<[Enter]> Execute this command
activate Remove the inactive tag from a statement
annotate Annotate the statement with a comment
commit Commit current set of changes
copy Copy a statement
deactivate Add the inactive tag to a statement
delete Delete a data element
edit Edit a sub-element
exit Exit from this level
help Provide help information
insert Insert a new ordered data element
load Load configuration from an ASCII file
quit Quit from this level
rename Rename a statement
rollback Roll back database to last committed version
run Run an operational-mode command
save Save configuration to an ASCII file
set Set a parameter
show Show a parameter
status Display database user status
top Exit to top level of configuration
up Exit one level of configuration
[edit]
user@host# edit ?
Possible completions:
> accounting-options Accounting data configuration
> chassis Chassis configuration
> class-of-service Class-of-service configuration
> firewall Define a firewall configuration
> forwarding-options Configure options to control packet sampling
> groups Configuration groups
> interfaces Interface configuration
> policy-options Routing policy option configuration
[edit]
user@host# show policy-options policy-statement ?
Possible completions:
<policy_name> Name to identify a policy filter
[edit]
user@host# edit policy-options policy-statement
You can also enter help tip cli <number> to associate a tip with a number. This
enables you to recall the tip at a later time. For example:
Topics include:
Topics include:
! Commands for copying files—The copy command copies files from one
location on the router to another, from the router to a remote system, or from a
remote system to the router. For information about these commands, see the
JUNOS System Basics and Services Command Reference.
! A command—start—to exit the CLI and start a UNIX shell. For information
about this command, see the JUNOS System Basics and Services Command
Reference.
! A command—quit—to exit the CLI. For information about this command, see
the JUNOS System Basics and Services Command Reference.
! For more information about the CLI operational mode commands, see the
JUNOS Interfaces Command Reference and the JUNOS System Basics and Services
Command Reference.
Log files and their contents and recent user logins show log
Remote systems Host reachability and network connectivity ping
Route to a network system traceroute
Forwarding table Information about data in the kernel’s forwarding table show route forwarding-table
information
IS-IS Adjacent routers show isis adjacency
OSPF Display standard information about OSPF neighbors show ospf neighbor
BGP Display information about Border Gateway Protocol (BGP) show bgp neighbor
neighbors
MPLS Status of interfaces on which MPLS is running show mpls interface
Configured LSPs on the router, as well as all ingress, transit, show mpls lsp
and egress LSPs
Routes that form a label-switched path show route label-switched path
Topics include:
1. Use the ? prompt to list options available for the command. For example:
2. Choose the option you wish to use with the command. (See Figure 11.)
/var/crash/cores:
total 9780
-rw-r--r-- 1 root wheel 4990976 Feb 9 15:39
core-FPC2.core.0.060209.1539
Hardware inventory:
Item Version Part number Serial number Description
Chassis 23120 M20
Backplane REV 07 710-001517 AW4431 M20 Backplane
Power Supply B REV 09 740-001466 004233 DC Power Supply
1. Type the show interfaces command to display information about all interfaces
on the router.
user@host>
If you specify none of these options, then the command applies by default to the
whole routing matrix: the TX Matrix platform and all connected T640 routing
nodes.
lcc0-re0:
--------------------------------------------------------------------------
Hostname: lcc0
Model: t640
JUNOS Base OS boot [7.0-20040630.0]
JUNOS Base OS Software Suite [7.0-20040629.0]
JUNOS Kernel Software Suite [7.0-20040630.0]
JUNOS Packet Forwarding Engine Support (T-Series) [7.0-20040630.0]
JUNOS Routing Software Suite [7.0-20040630.0]
JUNOS Online Documentation [7.0-20040630.0]
JUNOS Crypto Software Suite [7.0-20040630.0]
JUNOS Support Tools Package [7.0-20040630.0]
lcc1-re0:
--------------------------------------------------------------------------
Hostname: lcc1
Model: t640
JUNOS Base OS boot [7.0-20040630.0]
JUNOS Base OS Software Suite [7.0-20040629.0]
JUNOS Kernel Software Suite [7.0-20040630.0]
JUNOS Packet Forwarding Engine Support (T-Series) [7.0-20040630.0]
JUNOS Routing Software Suite [7.0-20040630.0]
JUNOS Online Documentation [7.0-20040630.0]
JUNOS Crypto Software Suite [7.0-20040630.0]
JUNOS Support Tools Package [7.0-20040630.0]
lcc1-re0:
--------------------------------------------------------------------------
Hostname: lcc1
Model: t640
JUNOS Base OS boot [7.0-20040630.0]
JUNOS Base OS Software Suite [7.0-20040629.0]
JUNOS Kernel Software Suite [7.0-20040630.0]
JUNOS Packet Forwarding Engine Support (T-Series) [7.0-20040630.0]
JUNOS Routing Software Suite [7.0-20040630.0]
JUNOS Online Documentation [7.0-20040630.0]
JUNOS Crypto Software Suite [7.0-20040630.0]
JUNOS Support Tools Package [7.0-20040630.0]
If, when you enter configuration mode, another user is also in configuration mode,
a notification message is displayed that indicates who the user is and what portion
of the configuration they are viewing or editing:
user@host> configure
Entering configuration mode
Current configuration users:
root terminal p3 (pid 1088) on since 1999-05-13 01:03:27 EDT
[edit interfaces so-3/0/0 unit 0 family inet]
The configuration has been changed but not committed
Topics include:
! M-series and T-series interface names—On the M-series and T-series platforms,
when you display information about an interface, you specify the interface
type, the slot in which the Flexible PIC Concentrator (FPC) is installed, the slot
on the FPC in which the Physical Interface Card (PIC) is located, and the
configured port number.
In the physical part of the interface name, a hyphen (-) separates the media
type from the FPC number, and a slash (/) separates the FPC, PIC, and port
numbers:
type-fpc/pic/port
! J-series interface names—On the J-series routing platform, when you display
information about an interface, you specify the interface type, the slot in which
the Physical Interface Module (PIM) is installed, 0, and the configured port
number.
In the physical part of the interface name, a hyphen (-) separates the media
type from the PIM number, and a slash (/) separates the PIM, 0, and port
numbers:
type-pim/0/port
type-fpc/pic/port.logical
type-pim/0/port.logical
A colon (:) separates the physical and virtual parts of the interface name:
type-fpc/pic/port:channel
type-fpc/pic/port:channel:channel
type-fpc/pic/port:channel:channel:channel
type-pim/0/port:channel
type-pim/0/port:channel:channel
type-pim/0/port:channel:channel:channel
Topics include:
DIrectory Description
/config This directory is located on the router’s internal flash drive. It contains
the active configuration (juniper.conf) and rollback files 1, 2, and 3.
/var/db/config This directory is located on the router’s hard drive and contains
rollback files 4 through 9.
/var/tmp This directory is located on the router’s hard drive. It holds core files
from the various daemons on the Routing Engines. Core files are
generated when a particular daemon crashes and are used by Juniper
Networks engineers to diagnose the reason for failure.
/var/log This directory is located on the router’s hard drive. It contains files
generated by both the router’s logging function as well as the
traceoptions command.
/var/home This directory is located on the router’s hard drive. It contains a
subdirectory for each configured user on the router. These individual
user directories are the default file location for many JUNOS software
commands.
/altroot This directory is located on the router’s hard drive and contains a
copy of the root file structure from the internal flash drive. This
directory is used in certain disaster-recovery modes where the internal
flash drive is not operational.
/altconfig This directory is located on the router’s hard drive and contains a copy
of the /config file structure from the internal flash drive. This directory
is also used in certain disaster recovery modes where the internal
flash drive is not operational.
user@host> file ?
Possible completions:
compare Compare files (local)
copy Copy files (local or remote)
delete Delete files from the system (local)
list List file information (local)
rename Rename files (local)
show Display file contents (local)
Help shows that the file command includes several options for manipulating
files.
2. Use the list option to see the directory structure of the router. For example, to
show the files located in your home directory on the router:
The default directory for the file list command is the home directory of the user
logged in to the router. In fact, the user’s home directory is the default directory
for most of the JUNOS software commands requiring a filename.
3. To view the contents of other file directories, specify the directory location. For
example:
4. You can also use the router’s context-sensitive help system to locate a directory.
For example:
! filename—File in the user’s current directory on the local flash drive. You can
use wildcards to specify multiple source files or a single destination file.
Wildcards are not supported in Hypertext Transfer Protocol (HTTP) or FTP.
NOTE: Wildcards are supported only by the file (compare | copy | delete | list |
rename | show) commands. When you issue the file show command with a
wildcard, it must resolve to one filename.
Topics include:
2. To display brief information and status for the kernel and Packet Forwarding
Engine, type the following command:
This command shows version information for the JUNOS software packages
installed on the router. For example:
Model: m160
JUNOS Base OS boot [8.1R1.0]
JUNOS Base OS Software Suite [8.1R1.0]
JUNOS Kernel Software Suite [8.1R1.0]
JUNOS Packet Forwarding Engine Support (M160) [8.1R1.0]
JUNOS Routing Software Suite [8.1R1.0]
JUNOS Online Documentation [8.1R1.0]
JUNOS Crypto Software Suite [8.1R1.0]
JUNOS Support Tools Package [8.1R1.0]
If the JUNOS Crypto Software Suite is listed, the router has Canada and USA
encrypted JUNOS software. If the JUNOS Crypto Software Suite is not listed, the
router is running worldwide nonencrypted JUNOS software.
This command displays shows the hostname and version information for the
JUNOS software packages installed on your router. It also includes the version
information for each software process. For example:
Hostname: my-router.net
Model: m160
JUNOS Base OS boot [8.1R1.0]
JUNOS Base OS Software Suite [8.1R1.0]
JUNOS Kernel Software Suite [8.1R1.0]
JUNOS Packet Forwarding Engine Support (M20/M40) [8.1R1.0]
JUNOS Routing Software Suite [8.1R1.0]
JUNOS Online Documentation [8.1R1.0]
JUNOS Crypto Software Suite [8.1R1.0]
JUNOS Support Tools Package [8.1R1.0]
jpfe-common: JUNOS Packet Forwarding Engine Support (M/T Common) [8.1R1.0]
systestelf.pkg: labpkg [7.0]
KERNEL 8.1R1.0 #0 built by builder on 2005-12-15 22:42:19 UTC
MGD release 8.1R1.0 built by builder on 2005-12-15 22:42:50 UTC
CLI release 8.1R1.0 built by builder on 2005-12-15 22:42:29 UTC
CHASSISD release 8.1R1.0 built by builder on 2005-12-15 22:31:33 UTC
DFWD release 8.1R1.0 built by builder on 2005-12-15 22:33:30 UTC
DCD release 8.1R1.0 built by builder on 2005-12-15 22:30:31 UTC
RPD release 8.1R1.0 built by builder on 2005-12-15 22:43:01 UTC
SNMPD release 8.1R1.0 built by builder on 2005-12-15 22:36:55 UTC
MIB2D release 8.1R1.0 built by builder on 2005-12-15 22:35:10 UTC
APSD release 8.1R1.0 built by builder on 2005-12-15 22:31:27 UTC
VRRPD release 8.1R1.0 built by builder on 2005-12-15 22:37:27 UTC
ALARMD release 8.1R1.0 built by builder on 2005-12-15 22:31:21 UTC
PFED release 8.1R1.0 built by builder on 2005-12-15 22:35:59 UTC
CRAFTD release 8.1R1.0 built by builder on 2005-12-15 22:33:14 UTC
SAMPLED release 8.1R1.0 built by builder on 2005-12-15 22:36:45 UTC
ILMID release 8.1R1.0 built by builder on 2005-12-15 22:34:47 UTC
RMOPD release 8.1R1.0 built by builder on 2005-12-15 22:36:27 UTC
COSD release 8.1R1.0 built by builder on 2005-12-15 22:33:01 UTC
KMD release 8.1R1.0 built by builder on 2005-12-15 22:27:33 UTC
FSAD release 8.1R1.0 built by builder on 2005-12-15 22:34:10 UTC
IRSD release 8.1R1.0 built by builder on 2005-12-15 22:34:51 UTC
NASD release 8.1R1.0 built by builder on 2005-12-15 22:35:53 UTC
FUD release 8.1R1.0 built by builder on 2005-12-15 22:34:14 UTC
PPMD release 8.1R1.0 built by builder on 2005-12-15 22:42:57 UTC
LMPD release 8.1R1.0 built by builder on 2005-12-15 22:42:44 UTC
RTSPD release 8.1R1.0 built by builder on 2005-12-15 22:36:39 UTC
SMARTD release 8.1R1.0 built by builder on 2005-12-15 22:30:06 UTC
KSYNCD release 8.1R1.0 built by builder on 2005-12-15 22:34:59 UTC
LRMUXD release 8.1R1.0 built by builder on 2005-12-15 22:42:47 UTC
SPD release 8.1R1.0 built by builder on 2005-12-15 22:37:12 UTC
ECCD release 8.1R1.0 built by builder on 2005-12-15 22:34:09 UTC
PGMD release 8.1R1.0 built by builder on 2005-12-15 22:42:55 UTC
BFDD release 8.1R1.0 built by builder on 2005-12-15 22:42:26 UTC
L2TPD release 8.1R1.0 built by builder on 2005-12-15 22:37:33 UTC
HTTPD release 8.1R1.0 built by builder on 2005-12-15 22:27:29 UTC
SDXD release 8.1R1.0 built by builder on 2005-12-15 22:28:01 UTC
---(more)---
This command shows the central processing unit (CPU) utilization on the router and
lists the processes in order of CPU utilization. For example:
last pid: 750; load averages: 0.00, 0.00, 0.00 up 0+00:58:50 18:34:17
52 processes: 1 running, 51 sleeping
Mem: 50M Active, 19M Inact, 38M Wired, 264K Cache, 86M Buf, 642M Free
Swap: 768M Total, 768M Free
PID USERNAME PRI NICE SIZE RES STATE TIME WCPU CPU COMMAND
546 root 10 0 9096K 1720K nanslp 0:21 0.00% 0.00% chassisd
685 root 2 0 12716K 3840K kqread 0:01 0.00% 0.00% rpd
553 root 2 0 8792K 1544K select 0:01 0.00% 0.00% mib2d
552 root 2 0 8632K 1556K select 0:01 0.00% 0.00% snmpd
563 root 2 0 9316K 1564K select 0:00 0.00% 0.00% kmd
564 root 2 0 7736K 948K select 0:00 0.00% 0.00% fud
131 root 10 0 770M 25568K mfsidl 0:00 0.00% 0.00% newfs
547 root 2 0 7732K 888K select 0:00 0.00% 0.00% alarmd
545 root 2 0 10292K 2268K select 0:00 0.00% 0.00% dcd
550 root 2 -12 1308K 692K select 0:00 0.00% 0.00% ntpd
1 root 10 0 816K 520K wait 0:00 0.00% 0.00% init
750 root 32 0 21716K 828K RUN 0:00 0.00% 0.00% top
560 root 2 0 8208K 1088K select 0:00 0.00% 0.00% rmopd
561 root 2 0 8188K 1156K select 0:00 0.00% 0.00% cosd
559 root 2 0 1632K 840K select 0:00 0.00% 0.00% ilmid
Table 9 lists and describes the output fields included in this example. The fields are
listed in alphabetical order.
Field Description
COMMAND Command that is running.
CPU Raw (unweighted) CPU usage. The value of this field is used to sort the
processes in the output.
last pid Last process identifier assigned to the process.
load averages Three load averages, followed by the current time.
Mem Information about physical and virtual memory allocation.
NICE UNIX “nice” value. The nice value allows a process to change its final
scheduling priority.
PID Process identifier.
PRI Current kernel scheduling priority of the process. A lower number indicates a
higher priority.
processes Number of existing processes and the number of processes in each state
(sleeping, running, starting, zombies, and stopped).
RES Current amount of resident memory, in KB.
SIZE Total size of the process (text, data, and stack), in KB.
STATE Current state of the process (sleep, wait, run, idle, zombi, or stop).
Swap Information about physical and virtual memory allocation.
USERNAME Owner of the process.
WCPU Weighted CPU usage.
Where <process> is the name of the process you want to restart. For example:
This command restarts the routing protocol daemon. When a process restarts,
the process identification (PID) is updated. (See Figure 13 on page 70.)
PID USERNAME PRI NICE SIZE RES STATE TIME WCPU CPU COMMAND
546 root 10 0 9096K 1720K nanslp 0:21 0.00% 0.00% chassisd
PID before restart 685 root 2 0 12716K 3840K kqread 0:01 0.00% 0.00% rpd
553 root 2 0 8792K 1544K select 0:01 0.00% 0.00% mib2d
Option Description
class-of-service Restart the class-of-service process, which controls the router’s
class-of-service configuration.
gracefully Restart the software process by sending the equivalent of a UNIX
SIGTERM signal.
immediately Immediately restart the process by sending the equivalent of a
UNIX SIGKILL signal.
interface-control Restart the interface process, which controls the router’s physical
interface devices and logical interfaces.
mib-process Restart the Management Information Base (MIB) II process, which
provides the router’s MIB II agent.
network-access-service Restart the network access process, which provides the router’s
Challenge Handshake Authentication Process (CHAP)
authentication service.
remote-operations Restart the remote operations process, which provides the ping and
traceroute MIBs.
routing Restart the routing protocol process, which controls the routing
protocols that run on the router and maintains the routing tables.
sampling Restart the sampling process, which performs packet sampling and
cflowd export.
Option Description
snmp Restart the Simple Network Management Process (SNMP) process,
which provides the router’s SNMP master agent.
soft Reread and reactivate the configuration without completely
restarting the software processes. For example, Border Gateway
Protocol (BGP) peers stay up and the routing table stays constant.
This option is the equivalent of a UNIX SIGHUP signal; omitting this
option is the equivalent of a UNIX SIGTERM (kill) operation.
This command stops all system processes and halts the operating system. For
example:
user@host> Dec 17 17:28:40 init: syslogd (PID 2514) exited with status=0
Normal Exit
Waiting (max 60 seconds) for system process `bufdaemon' to stop...stopped
Waiting (max 60 seconds) for system process `syncer' to stop...stopped
syncing disks... 4
done
Uptime: 3h31m41s
ata0: resetting devices.. done
The operating system has halted.
Please press any key to reboot.
This command displays the final stages of the system shutdown and executes
the reboot. Reboot requests are recorded to the system log files, which you can
view with the show log messages command. For example:
user@host> Dec 17 17:34:20 init: syslogd (PID 409) exited with status=0
Normal Exit
Waiting (max 60 seconds) for system process `bufdaemon' to stop...stopped
Waiting (max 60 seconds) for system process `syncer' to stop...stopped
syncing disks... 10 6
done
Uptime: 2m45s
ata0: resetting devices.. done
Rebooting...
To add comments in operational mode, start with a # and end with a new line
(carriage return):
user@host> # comment-string
comment-string is the text of the comment. The comment text can be any length,
and you must type it on a single line.
This chapter describes how to use the CLI to configure the router.
Topics include:
You can create the hierarchy interactively or you can create an ASCII text file that is
loaded onto the router and then committed.
Command Description
activate Remove the inactive: tag from a statement, effectively reading the
statement or identifier to the configuration. Statements or
identifiers that have been activated take effect when you next issue
the commit command.
annotate Add comments to a configuration. You can add comments only at
the current hierarchy level.
commit Commit the set of changes to the database and cause the changes
to take operational effect.
copy Make a copy of an existing statement in the configuration.
deactivate Add the inactive: tag to a statement, effectively commenting out the
statement or identifier from the configuration. Statements or
identifiers marked as inactive do not take effect when you issue the
commit command.
delete Delete a statement or identifier. All subordinate statements and
identifiers contained within the specified statement path are
deleted with it.
edit Move inside the specified statement hierarchy. If the statement
does not exist, it is created.
exit Exit the current level of the statement hierarchy, returning to the
level prior to the last edit command, or exit from configuration
mode. The quit and exit commands are synonyms.
help Display help about available configuration statements.
insert Insert an identifier into an existing hierarchy.
load Load a configuration from an ASCII configuration file or from
terminal input. Your current location in the configuration hierarchy
is ignored when the load operation occurs.
quit Exit the current level of the statement hierarchy, returning to the
level prior to the last edit command, or exit from configuration
mode. The quit and exit commands are synonyms.
rename Rename an existing configuration statement or identifier.
replace Replace identifiers or values in a configuration.
rollback Return to a previously committed configuration. The software
saves the last 10 committed configurations, including the rollback
number, date, time, and name of the user who issued the commit
configuration command.
Command Description
run Run a top-level CLI command without exiting from configuration
mode.
save Save the configuration to an ASCII file. The contents of the current
level of the statement hierarchy (and below) are saved, along with
the statement hierarchy containing it. This allows a section of the
configuration to be saved, while fully specifying the statement
hierarchy.
set Create a statement hierarchy and set identifier values. This is
similar to edit except that your current level in the hierarchy does
not change.
show Display the current configuration.
status Display the users currently editing the configuration.
top Return to the top level of configuration command mode, which is
indicated by the [edit] banner.
up Move up one level in the statement hierarchy.
update Update a private database.
wildcard Delete a statement or identifier.
For more information about configuration mode commands, see “Summary of CLI
Configuration Mode Commands” on page 201.
Statement Description
access Configure the Challenge Handshake Authentication Protocol (CHAP). For
information about the statements in this hierarchy, see the JUNOS System
Basics Configuration Guide.
accounting-options Configure accounting statistics data collection for interfaces and firewall
filters. For information about the statements in this hierarchy, see the JUNOS
Network Management Configuration Guide.
chassis Configure properties of the router chassis, including conditions that activate
alarms and SONET/SDH framing and concatenation properties. For
information about the statements in this hierarchy, see the JUNOS System
Basics Configuration Guide.
class-of-service Configure class-of-service parameters. For information about the statements
in this hierarchy, see the JUNOS Class of Service Configuration Guide.
firewall Define filters that select packets based on their contents. For information
about the statements in this hierarchy, see the JUNOS Policy Framework
Configuration Guide.
Statement Description
forwarding-options Define forwarding options, including traffic sampling options. For
information about the statements in this hierarchy, see the JUNOS Network
Interfaces Configuration Guide.
groups Configure configuration groups. For information about statements in this
hierarchy, see the JUNOS System Basics Configuration Guide.
interfaces Configure interface information, such as encapsulation, interfaces, virtual
channel identifiers (VCIs), and data-link connection identifiers (DLCIs). For
information about the statements in this hierarchy, see the JUNOS Network
Interfaces Configuration Guide.
policy-options Define routing policies, which allow you to filter and set properties in
incoming and outgoing routes. For information about the statements in this
hierarchy, see the JUNOS Policy Framework Configuration Guide.
protocols Configure routing protocols, including Border Gateway Protocol (BGP),
Intermediate System-to-Intermediate System (IS-IS), Label Distribution
Protocol (LDP), Multiprotocol Label Switching (MPLS), OSPF, Routing
Information Protocol (RIP), and Resource Reservation Protocol (RSVP). For
information about the statements in this hierarchy, see the chapters that
discuss how to configure the individual routing protocols in the JUNOS
Routing Protocols Configuration Guide and the JUNOS MPLS Applications
Configuration Guide.
routing-instances Configure multiple routing instances. For information about the statements
in this hierarchy, see the JUNOS Routing Protocols Configuration Guide.
routing-options Configure protocol-independent routing options, such as static routes,
autonomous system numbers, confederation members, and global tracing
(debugging) operations to log. For information about the statements in this
hierarchy, see the JUNOS Routing Protocols Configuration Guide.
security Configure IP Security (IPSec) services. For information about the statements
in this hierarchy see the JUNOS System Basics Configuration Guide.
snmp Configure Simple Network Management Protocol (SNMP) community strings,
interfaces, traps, and notifications. For information about the statements in
this hierarchy, see the JUNOS Network Management Configuration Guide.
system Configure systemwide properties, including the hostname, domain name,
Domain Name System (DNS) server, user logins and permissions, mappings
between hostnames and addresses, and software processes. For information
about the statements in this hierarchy, see the JUNOS System Basics
Configuration Guide.
Protocols bgp
dvmrp
icmp dead-interval
igmp hello-interval
isis interface-type
mpis area-range metric
ospf area interface mtu
rip traceoptions stub poll-interval
router-discovery virtual-link priority
rsvp retransmit-interval
sap transit-delay
1412
transmit-interval
Each statement at the top level of the configuration hierarchy resides at the trunk
(or root level) of a hierarchy tree. The top-level statements are container
statements, containing other statements that form the tree branches. The leaf
statements are the leaves of the hierarchy tree. An individual hierarchy of
statements, which starts at the trunk of the hierarchy tree, is called a statement
path. Figure 14 illustrates the hierarchy tree, showing a statement path for the
portion of the protocol configuration hierarchy that configures the hello interval on
an interface in an OSPF area.
The CLI represents the statement path shown in Figure 14 on page 79 as [protocols
ospf area area-number interface interface-name], and displays the configuration as
follows:
protocols {
ospf {
area 0.0.0.0 {
interface so-0/0/0 {
hello-interval 5;
}
interface so-0/0/1 {
hello-interval 5;
}
}
}
}
The CLI indents each level in the hierarchy to indicate each statement’s relative
position in the hierarchy and generally sets off each level with braces, using an
open brace at the beginning of each hierarchy level and a closing brace at the end.
If the statement at a hierarchy level is empty, the braces are not printed.
Each leaf statement ends with a semicolon. If the hierarchy does not extend as far
as a leaf statement, the last statement in the hierarchy ends with a semicolon.
user@host> configure
entering configuration mode
[edit]
user@host# ?
Possible completions:
<[Enter]> Execute this command
activate Remove the inactive tag from a statement
annotate Annotate the statement with a comment
commit Commit current set of changes
copy Copy a statement
deactivate Add the inactive tag to a statement
delete Delete a data element
edit Edit a sub-element
exit Exit from this level
help Provide help information
insert Insert a new ordered data element
load Load configuration from an ASCII file
quit Quit from this level
rename Rename a statement
rollback Roll back database to last committed version
Users must have configure permission to view and use the configure command.
When in configuration mode, a user can view and modify only those
statements for which they have access privileges set. For more information,
see the JUNOS System Basics Configuration Guide.
user@host> configure
Entering configuration mode
Current configuration users:
root terminal p3 (pid 1088) on since 1999-05-13 01:03:27 EDT
[edit interfaces so-3/0/0 unit 0 family inet]
The configuration has been changed but not committed
[edit]
user@host>
[edit]
user@host# exit
exiting configuration mode
user@host>
If you try to exit from configuration mode using the exit command and the
configuration contains changes that have not been committed, you see a
message and prompt:
[edit]
user@host# exit
The configuration has been changed but not committed
Exit with uncommitted changes? [yes,no] (yes) <Enter>
Exiting configuration mode
user@host>
[edit]
user@host# exit configuration-mode
The configuration has been changed but not committed
Exiting configuration mode
user@host>
edit <statement-path>
You cannot use the edit command to change the value of identifiers. You must
use the set command.
You also can use the CLI operational mode show configuration command to display
the last committed current configuration, which is the configuration currently
running on the router:
If you have omitted a required statement at a particular hierarchy level, when you
issue the show command in configuration mode, a message indicates which
statement is missing. As long as a mandatory statement is missing, the CLI
continues to display this message each time you issue a show command. For
example:
[edit]
user@host# show
protocols {
pim {
interface so-0/0/0 {
priority 4;
version 2;
# Warning: missing mandatory statement(s): 'mode'
}
}
}
[edit]
user@host# set protocols ospf area 0.0.0.0 interface so-0/0/0 hello-interval 5
[edit]
user@host# show
protocols {
ospf {
area 0.0.0.0 {
interface so-0/0/0 {
hello-interval 5;
}
}
}
}
[edit]
user@host# show protocols ospf area 0.0.0.0
interface so-0/0/0 {
hello-interval 5;
}
[edit]
user@host# edit protocols ospf area 0.0.0.0
[edit protocols ospf area 0.0.0.0]
user@host# show
interface so-0/0/0 {
hello-interval 5;
}
[edit]
user@host# set protocols ospf area 0.0.0.0 interface so-0/0/0 hello-interval 5
[edit]
user@host# commit
commit complete
[edit]
user@host# quit
exiting configuration mode
For example, the following list shows the statements available at the top level of
configuration mode.
user@host# set ?
Possible completions:
> accounting-options Accounting data configuration
+ apply-groups Groups from which to inherit configuration data
> chassis Chassis configuration
> class-of-service Class-of-service configuration
> firewall Define a firewall configuration
> forwarding-options Configure options to control packet sampling
> groups Configuration groups
> interfaces Interface configuration
> policy-options Routing policy option configuration
> protocols Routing protocol configuration
> routing-instances Routing instance configuration
> routing-options Protocol-independent routing option configuration
> snmp Simple Network Management Protocol
> system System parameters
An angle bracket ( > ) before the statement name indicates that it is a container
statement and that you can define other statements at levels below it. If there is no
angle bracket ( > ) before the statement name, the statement is a leaf statement;
you cannot define other statements at hierarchy levels below it.
A plus sign (+) before the statement name indicates that it can contain a set of
values. To specify a set, include the values in brackets. For example:
[edit]
user@host# set policy-options community my-as1-transit members [65535:10
65535:11]
In some statements, you can include an identifier. For some identifiers, such as
interface names, you must specify the identifier in a precise format. For example,
the interface name so-0/0/0 refers to a SONET/SDH interface that is on the Flexible
PIC Concentrator (FPC) in slot 0, in the first PIC location, and in the first port on the
Physical Interface Card (PIC). For other identifiers, such as interface descriptive text
and policy and firewall term names, you can specify any name, including special
characters, spaces, and tabs.
You must enclose in quotation marks (double quotes) identifiers and any strings
that include the following characters: space tab ( ) [ ] { } ! @ # $ % ^ & | ’ = ?
If you do not type an option for a statement that requires one, a message indicates
the type of information expected. In this example, you need to type an area
number to complete the command:
[edit]
user@host# set protocols ospf area<Enter>
^
syntax error, expecting <identifier>.
When you delete a statement, the statement and all its subordinate statements and
identifiers are removed from the configuration.
For statements that can have more than one identifier, when you delete one
identifier, only that identifier is deleted. The other identifiers in the statement
remain.
To delete the entire hierarchy starting at the current hierarchy level, do not specify
a statement or an identifier in the delete command. When you omit the statement
or identifier, you are prompted to confirm the deletion:
[edit]
user@host# delete
Delete everything under this level? [yes, no] (no)?
Possible completions:
no Don't delete everything under this level
yes Delete everything under this level
Delete everything under this level? [yes, no] (no)
[edit]
user@host# set protocols ospf area 0.0.0.0 interface so-0/0/0 hello-interval 5
[edit]
user@host# show
protocols {
ospf {
area 0.0.0.0 {
interface so-0/0/0 {
hello-interval 5;
}
}
}
}
[edit]
user@host# delete protocols ospf
[edit]
user@host# show
[edit]
user@host#
[edit]
user@host# edit protocols ospf area 0.0.0.0
[edit protocols ospf area 0.0.0.0]
user@host# set interface so-0/0/0 hello-interval 5
[edit protocols ospf area 0.0.0.0]
user@host# delete
Delete everything under this level? [yes, no] (no) yes
[edit protocols ospf area 0.0.0.0]
user@host# show
[edit]
user@host#
[edit]
user@host# set interfaces so-3/0/0 speed 100mb
[edit]
user@host# show
interfaces {
so-3/0/0 {
speed 100mb;
}
}
[edit]
user@host# delete interfaces so-3/0/0 speed
[edit]
user@host# show
interfaces {
so-3/0/0;
}
Immediately after you have copied a portion of the configuration, the configuration
might not be valid. You must check the validity of the new configuration, and if
necessary, modify either the copied portion or the original portion for the
configuration to be valid.
[edit interfaces]
user@host# show
at-1/0/0 {
description "PAIX to MAE West"
encapsulation atm-pvc;
unit 61 {
point-to-point;
vci 0.61;
family inet {
address 10.0.1.1/24;
}
}
}
}
[edit interfaces]
user@host# edit at-1/0/0
[edit interfaces at-1/0/0]
user@host# copy unit 61 to unit 62
[edit interfaces at-1/0/0]
user@host# show
description "PAIX to MAE West"
encapsulation atm-pvc;
unit 61 {
point-to-point;
vci 0.61;
family inet {
address 10.0.1.1/24;
}
}
unit 62 {
point-to-point;
vci 0.61;
family inet {
address 10.0.1.1/24;
}
}
}
To issue configuration mode commands from the top of the hierarchy, use the top
command; then specify a configuration command. For example:
Renaming an Identifier
When modifying a configuration, you can rename an identifier that is already in the
configuration. You can do this either by deleting the identifier (using the delete
command) and then adding the renamed identifier (using the set and edit
commands), or you can rename the identifier using the rename configuration mode
command:
[edit]
user@host# rename system network-time server 10.0.0.7 to server 10.0.0.6
For example, in a routing policy or firewall filter, you define terms that are
analyzed sequentially. Also, when you create a named path in dynamic MPLS, you
define an ordered list of the transit routers in the path, starting with the first transit
router and ending with the last one.
To modify a portion of the configuration in which the statement order matters, use
the insert configuration mode command:
If you do not use the insert command, but instead simply configure the identifier, it
is placed at the end of the list of similar identifiers.
[edit]
user@host# show
policy-options {
policy-statement statics {
term term1 {
from {
route-filter 192.168.0.0/16 orlonger;
route-filter 224.0.0.0/3 orlonger;
}
then reject;
}
term term2 {
from protocol direct;
then reject;
}
term term3 {
from protocol static;
then reject;
}
term term4 {
then accept;
}
}
}
[edit]
user@host# rename policy-options policy-statement statics term term4 to term
term6
[edit]
user@host# set policy-options policy-statement statics term term4 from protocol
local
[edit]
user@host# set policy-options policy-statement statics term term4 then reject
[edit]
user@host# set policy-options policy-statement statics term term5 from protocol
aggregate
[edit]
user@host# set policy-options policy-statement statics term term5 then reject
[edit]
user@host# insert policy-options policy-statement statics term term4 after term
term3
[edit]
user@host# insert policy-options policy-statement statics term term5 after term
term4
[edit]
user@host# show policy-options policy-statement statics
term term1 {
from {
route-filter 192.168.0.0/16 orlonger;
route-filter 224.0.0.0/3 orlonger;
}
then reject;
}
term term2 {
from protocol direct;
then reject;
}
term term3 {
from protocol static;
then accept;
}
term term4 {
from protocol local;
then reject;
}
term term5 {
from protocol aggregate;
then reject;
}
term term6 {
then accept;
}
user@host# show
1.1.1.1;
2.2.2.2;
3.3.3.3 loose;
4.4.4.4 strict;
5.5.5.5 strict;
6.6.6.6;
In both commands, the statement or identifier you specify must be at the current
hierarchy level.
[edit interfaces]
user@host# show
at-5/2/0 {
traceoptions {
traceflag all;
}
atm-options {
vpi 0 maximum-vcs 256;
}
unit 0 {
...
[edit interfaces]
user@host# deactivate at-5/2/0
[edit interfaces]
user@host# show
inactive: at-5/2/0 {
traceoptions {
traceflag all;
}
...
[edit interfaces]
user@host# activate at-5/2/0
[edit interfaces]
user@host# show
at-5/2/0 {
traceoptions {
traceflag all;
}
...
When you add comments in configuration mode, they are associated with a
statement at the current level. Each statement can have one single-line comment
associated with it. Before you can associate a comment with a statement, the
statement must exist. The comment is placed on the line preceding the statement.
statement is the configuration statement to which you are attaching the comment; it
must be at the current hierarchy level. If a comment for the specified statement
already exists, it is deleted and replaced with the new comment.
comment-string is the text of the comment. The comment text can be any length,
and you must type it on a single line. If the comment contains spaces, you must
enclose it in quotation marks. In the comment string, you can include the comment
delimiters /* */ or #. If you do not specify any, the comment string is enclosed
with the /* */ comment delimiters.
When you edit the ASCII configuration file and add comments, they can be one or
more lines and must precede the statement they are associated with. If you place
the comments in other places in the file, such as on the same line following a
statement or on a separate line following a statement, they are removed when you
use the load command to open the configuration into the CLI.
When you include comments in the configuration file directly, you can format
comments in the following ways:
! Start the comment with a /* and end it with a */. The comment text can be on
a single line or can span multiple lines.
! Start the comment with a # and end it with a new line (carriage return).
If you add comments with the annotate command, you can view the comments
within the configuration by entering the show configuration mode command or the
show configuration operational mode command.
When configuring interfaces, you can add comments about the interface by
including the description statement at the [edit interfaces interface-name] hierarchy
level. Any comments you include appear in the output of the show interfaces
commands. For more information about the description statement, see the JUNOS
Network Interfaces Configuration Guide.
[edit]
user@host# show
protocols {
ospf {
area 0.0.0.0 {
interface so-0/0/0 {
hello-interval 5;
}
}
}
}
[edit]
user@host# edit protocols ospf
[edit protocols ospf]
user@host# set area 0.0.0.0
user@host# annotate area 0.0.0.0 "Backbone area configuration added June 15,
1998"
[edit protocols ospf]
user@host# edit area 0.0.0.0
[edit protocols ospf area 0.0.0.0]
user@host# annotate interface so0 "Interface from router sj1 to router sj2"
[edit protocols ospf area 0.0.0.0]
user@host# top
[edit]
user@host# show
protocols {
ospf {
/* Backbone area configuration added June 15, 1998 */
area 0.0.0.0 {
/* Interface from router sj1 to router sj2 */
interface so-0/0/0 {
hello-interval 5;
}
}
}
}
[edit]
user@host#
Verifying a Configuration
To verify that the syntax of a configuration is correct, use the configuration mode
commit check command:
[edit]
user@host# commit check
configuration check succeeds
[edit]
user@host#
If the commit check command finds an error, a message indicates the location of
the error.
Committing a Configuration
To save software configuration changes to the configuration database and activate
the configuration on the router, use the commit configuration mode command:
[edit]
user@host# commit
commit complete
[edit]
user@host#
When you enter the commit command, the configuration is first checked for syntax
errors (commit check). Then, if the syntax is correct, the configuration is activated
and becomes the current, operational router configuration.
You can issue the commit command from any hierarchy level.
96 ! Verifying a Configuration
Chapter 6: Using Commands and Statements to Configure the Router
If the configuration contains syntax errors, a message indicates the location of the
error and the configuration is not activated. The error message has the following
format:
[edit edit-path]
‘offending-statement;’
error-message
For example:
You must correct the error before recommitting the configuration. To return
quickly to the hierarchy level where the error is located, copy the path from the first
line of the error and paste it at the configuration mode prompt at the [edit]
hierarchy level.
When you commit a configuration, you commit the entire configuration in its
current form. If more than one user is modifying the configuration, committing it
saves and activates the changes of all the users.
load merge
load replace
load override
load update
For more information, see the Secure Configuration Guide for Common Criteria and
JUNOS-FIPS.
[edit]
user@host# commit and-quit
commit complete
exiting configuration mode
user@host>
Committing a Configuration ! 97
JUNOS 8.1 CLI User Guide
[edit]
user@host# commit confirmed
commit confirmed will be automatically rolled back in 10 minutes unless confirmed
commit complete
Once you have verified that the change works correctly, you can keep the new
configuration active by entering a commit or commit check command within
10 minutes of the commit confirmed command. For example:
[edit]
user@host# commit check
commit confirmed will be automatically rolled back in 10 minutes unless confirmed
commit complete
If the commit is not confirmed within a certain amount of time (10 minutes by
default), the JUNOS software automatically rolls back to the previous configuration
and a broadcast message is sent to all logged-in users.
To show when a rollback is scheduled after a commit confirmed command, enter the
show system commit command. For example:
Like the commit command, the commit confirmed command verifies the
configuration syntax and reports any errors. If there are no errors, the configuration
is activated and begins running on the router.
98 ! Committing a Configuration
Chapter 6: Using Commands and Statements to Configure the Router
1414
(default: 10 minutes)
To change the amount of time before you have to confirm the new configuration,
specify the number of minutes when you issue the command:
[edit]
user@host# commit confirmed minutes
commit complete
[edit]
user@host#
[edit]
user@host # commit at <string>
string is reboot or the future time to activate the configuration changes. You can
specify time in two formats:
! A time value in the form hh:mm [:ss] (hours, minutes, and optionally
seconds)— Commit the configuration at the specified time, which must be in
the future but before 11:59:59 PM on the day the commit at configuration
command is issued. Use 24-hour time for the hh value; for example, 04:30:00
is 4:30:00 AM, and 20:00 is 8:00 PM. The time is interpreted with respect to
the clock and time zone settings on the router.
Committing a Configuration ! 99
JUNOS 8.1 CLI User Guide
! A date and time value in the form yyyy-mm-dd hh:mm [:ss] (year, month, date,
hours, minutes, and, optionally, seconds)—Commit the configuration at the
specified day and time, which must be after the commit at command is issued.
Use 24-hour time for the hh value. For example, 2003-08-21 12:30:00 is 12:30
PM on August 21, 2003. The time is interpreted with respect to the clock and
time zone settings on the router.
Enclose the string value in quotation marks (“). For example, commit at
“18:00:00”. For date and time, include both values in the same set of quotation
marks. For example, commit at "2005-03-10 14:00:00".
NOTE: If the JUNOS software fails before the configuration changes become active,
all configuration changes are lost.
You cannot issue the commit at configuration command after you issue the
request system reboot command.
You cannot issue the request system reboot command once you schedule a
commit operation for a specific time in the future.
For example:
[edit]
user@host# commit | display detail
2003-09-22 15:39:39 PDT: exporting juniper.conf
2003-09-22 15:39:39 PDT: setup foreign files
2003-09-22 15:39:39 PDT: propagating foreign files
2003-09-22 15:39:39 PDT: complete foreign files
2003-09-22 15:39:40 PDT: copying configuration to juniper.data+
2003-09-22 15:39:40 PDT: dropping unchanged foreign files
2003-09-22 15:39:40 PDT: daemons checking new configuration
2003-09-22 15:39:41 PDT: commit wrapup...
2003-09-22 15:39:42 PDT: activating '/var/etc/ntp.conf'
[edit]
user@host # commit comment <comment-string>
NOTE: You cannot include a comment with the commit check command.
To add a comment to the commit command, include the comment statement after
the commit command:
[edit]
user@host# commit comment “add user joe”
commit complete
[edit]
user@host#
[edit]
user@host# commit confirmed comment “add customer to port 27”
commit confirmed will be automatically rolled back in 10 minutes unless confirmed
commit complete
[edit]
user@host#
To view these commit comments, issue the show system commit operational
mode command.
The request system snapshot command backs up the root file system to /altroot,
and /config to /altconfig. The root and /config file systems are on the router’s flash
drive, and the /altroot and /altconfig file systems are on the router’s hard disk (if
available).
NOTE: To back up the file system on a J-series Services Router, you must specify a
media type (primary compact flash drive, removable compact flash drive, or USB
storage device) for backup. For more information, see the J-series Services Router
Administration Guide.
After you issue the request system snapshot command, you cannot return to the
previous version of the software because the running and backup copies of the
software are identical.
When any of the users editing the configuration issues a commit command, all
changes made by all users are checked and activated.
If, when you enter configuration mode, another user is also in configuration mode,
a message shows who the user is and what part of the configuration that user is
viewing or editing:
user@host> configure
Entering configuration mode
Current configuration users:
root terminal p3 (pid 1088) on since 1999-05-13 01:03:27 EDT
[edit interfaces so-3/0/0 unit 0 family inet]
The configuration has been changed but not committed
[edit]
user@host>
If, when you enter configuration mode, the configuration contains changes that
have not been committed, a message appears:
user@host> configure
Entering configuration mode
The configuration has been changed but not committed
[edit]
user@host>
user@host# status
Users currently editing the configuration:
rchen terminal p0 (pid 55691) on since 2006-03-01 13:17:25 PST
[edit interfaces]
The system displays who is editing the configuration (rchen), where the user is
logged in (terminal p0), the date and time the user logged in (2006-03-01 13:17:25
PST), and what level of the hierarchy the user is editing ([edit interfaces]).
If you issue the status configuration mode command and a user has scheduled a
candidate configuration to become active for a future time, the system displays
who scheduled the commit (root), where the user is logged in (terminal d0), the date
and time the user logged in (2002-10-31 14:55:15 PST), and that a commit is
pending (commit at).
[edit]
user@host# status
Users currently editing the configuration:
root terminal d0 (pid 767) on since 2002-10-31 14:55:15 PST, idle 00:03:09
commit at
If you issue the status configuration mode command and a user is editing the
configuration in configure exclusive mode, the system displays who is editing the
configuration (root), where the user is logged in (terminal d0), the date and time the
user logged in (2002-11-01 13:05:11 PST), and that a user is editing the
configuration in configure exclusive mode (exclusive [edit]).
[edit]
user@host# status
Users currently editing the configuration:
root terminal d0 (pid 2088) on since 2002-11-01 13:05:11 PST
exclusive [edit]
For more information about configure exclusive, see “Using the Configure Exclusive
Command” on page 106.
If another user has locked the configuration, and you need to forcibly log him or her
out, enter the operational mode command request system logout pid pid_number.
If you enter configuration mode and another user is also in configuration mode and
has locked the configuration, a message indicates who the user is and what portion
of the configuration that user is viewing or editing:
user@host> configure
Entering configuration mode
Users currently editing the configuration:
root terminal p3 (pid 1088) on since 2000-10-30 19:47:58 EDT, idle
00:00:44
exclusive [edit interfaces so-3/0/0 unit 0 family inet]
In configure exclusive mode, any uncommitted changes are discarded when you
exit:
[edit]
user@host# set system host-name cool
[edit]
user@host# quit
The configuration has been changed but not committed
warning: Auto rollback on exiting 'configure exclusive'
Discard uncommitted changes? [yes,no] (yes)
When you use the yes option to exit configure exclusive mode, the JUNOS software
discards your uncommitted changes and rolls backs your configuration. The no
option allows you to continue editing or to commit your changes in configure
exclusive mode.
When a user exits from configure exclusive mode while another user is in configure
private mode, the JUNOS software will roll back any uncommitted changes.
NOTE: You cannot enter configure private mode when the global configuration has
been modified.
NOTE: You cannot commit changes in configure private mode when another user
is in configure exclusive mode.
If the global configuration has changed, users in configure private mode can issue
the rollback or update command to obtain the most recently committed shared
configuration. For more information about the update command, see “Updating
the Configure Private Configuration” on page 109.
You must issue the commit command from the top of the configuration.
You cannot save a configure private session; uncommitted changes are discarded.
You cannot issue the commit confirmed command when you are in configure
private mode.
If a configure private edit is in session, other users who issue the configure
command can only view the global configuration; a message appears indicating
that these users must use the configure exclusive or configure private commands to
modify the configuration:
[edit]
user@host# set system host-name ipswitch
error: private edits in use. Try 'configure private' or 'configure
exclusive'.
[edit]
user@host#
If the global configuration has been modified, users cannot enter configure private
mode because they cannot commit changes when the global configuration has
been modified. For example:
NOTE: Users in configure private or configure exclusive mode cannot exit the
global configuration with uncommitted changes.
If another user commits a change to the same section of the configuration that the
private user has modified, a merge conflict may result. In this case, the JUNOS
software updates the private user’s configuration with the most recently committed
global configuration, then allows the private user can commit the changes. For
example:
[edit]
user@host# set system host-name foo
[edit]
user@host# show | compare
[edit system]
- host-name host;
+ host-name foo;
[edit]
user@host# commit
[edit system host-name]
'host-name bar'
statement does not match patch; 'bar' != 'host'
load complete (1 errors)
[edit]
user@host# show | compare
[edit system]
- host-name bar;
+ host-name foo;
[edit]
user@host#
In this example, after the JUNOS software detects the merge conflict and fixes it,
the user in configure private mode issues the show | compare command. This
command displays the private user’s database changes against the most recently
committed shared configuration.
[edit]
user@host# update
[edit]
user@host#
NOTE: You can get merge conflicts when you issue the update command.
You can also issue the rollback command to discard your private candidate
configuration changes and obtain the most recently committed configuration:
[edit]
user@host# rollback
[edit]
user@host#
To display the configuration as set commands and search for text matching a
regular expression by filtering output, specify the match option after the pipe:
xe-2/3/0 {
unit 0 {
family inet {
address 192.107.9.106/30;
}
}
}
so-5/1/0 {
unit 0 {
family inet {
address 192.107.9.15/32 {
destination 192.107.9.192;
}
}
}
}
lo0 {
unit 0 {
family inet {
address 127.0.0.1/32;
}
}
}
user@host# show interfaces | display set | match address
set interfaces xe-2/3/0 unit 0 family inet address 192.168.9.106/30
set interfaces so-5/1/0 unit 0 family inet address 192.168.9.15/32 destination
192.168.9.192
set interfaces lo0 unit 0 family inet address 127.0.0.1/32
For example:
[edit]
user@host# show | display detail
##
## version: Software version information
## require: system
##
version "3.4R1 [tlim]";
system {
##
## host-name: Host name for this router
## match: ^[[:alnum:]._-]+$
## require: system
##
host-name router-name;
##
## domain-name: Domain name for this router
## match: ^[[:alnum:]._-]+$
## require: system
##
domain-name isp.net;
##
## backup-router: Address of router to use while booting
##
backup-router 192.168.100.1;
root-authentication {
##
## encrypted-password: Encrypted password string
##
encrypted-password "$1$BYJQE$/ocQof8pmcm7MSGK0"; # SECRET-DATA
}
##
## name-server: DNS name servers
## require: system
##
name-server {
##
## name-server: DNS name server address
##
208.197.1.0;
}
login {
##
## class: User name (login)
## match: ^[[:alnum:]_-]+$
##
class super-user {
##
## permissions: Set of permitted operation categories
##
permissions all;
}
...
##
## services: System services
## require: system
##
services {
## services: Service name
##
ftp;
##
## services: Service name
##
telnet;
##
}
syslog {
##
## file-name: File to record logging data
##
file messages {
##
## Facility type
## Level name
##
any notice;
##
## Facility type
## Level name
##
authorization info;
}
}
}
chassis {
alarm {
sonet {
##
## lol: Loss of light
## alias: loss-of-light
##
lol red;
}
}
}
}
interfaces {
##
## Interface name
##
at-2/1/1 {
atm-options {
##
## vpi: Virtual path index
## range: 0 .. 255
## maximum-vcs: Maximum number of virtual circuits on this VP
##
vpi 0 maximum-vcs 512;
}
##
## unit: Logical unit number
## range: 0 .. 16384
##
unit 0 {
##
## vci: ATM point-to-point virtual circuit identifier ([vpi.]vci)
## match: ^([[:digit:]]+.){0,1}[[:digit:]]+$
##
vci 0.128;
}
}
...
Topics include:
To have a candidate configuration take effect, you commit the changes. At this
point, the candidate file is checked for proper syntax, activated, and marked as the
current, operational software configuration file. If multiple users are editing the
configuration, when you commit the candidate configuration, all changes made by
all the users take effect.
In addition to saving the current configuration, the CLI saves the current
operational version and the previous 49 versions of committed configurations. The
most recently committed configuration is version 0 (the current operational
version, which is the default configuration that the system returns to if you roll back
to a previous configuration), and the oldest saved configuration is version 49.
Figure 16 illustrates the various router configuration states and the configuration
mode commands you use to load, commit, copy, save, or roll back the
configuration.
Figure 16: Commands for Storing and Modifying the Router Configuration
commit Interim
confirmed configuration
load
Configuration Candidate 10 minutes
without
in text file configuration commit committing
copy, save
Active
rollback configuration
49 previous
1413
configurations
[edit]
user@host# rollback
load complete
To activate the configuration to which you rolled back, use the commit command:
[edit]
user@host# rollback
load complete
[edit]
user@host# commit
[edit]
user@host# rollback number
load complete
[edit]
user@host# rollback ?
Possible completions:
<[Enter]> Execute this command
<number> Numeric argument
0 2005-02-27 12:52:10 PST by abc via cli
1 2005-02-26 14:47:42 PST by def via cli
2 2005-02-14 21:55:45 PST by ghi via cli
3 2005-02-10 16:11:30 PST by jkl via cli
4 2005-02-10 16:02:35 PST by mno via cli
5 2005-03-16 15:10:41 PST by pqr via cli
6 2005-03-16 14:54:21 PST by stu via cli
7 2005-03-16 14:51:38 PST by vwx via cli
8 2005-03-16 14:43:29 PST by yzz via cli
9 2005-03-16 14:15:37 PST by abc via cli
10 2005-03-16 14:13:57 PST by def via cli
11 2005-03-16 12:57:19 PST by root via other
12 2005-03-16 10:45:23 PST by root via other
[edit]
user@host# show | compare [filename | rollback n]
filename is the full path to a configuration file. The file must be in the proper format:
a hierarchy of statements.
n is the index into the list of previously committed configurations. The most
recently saved configuration is number 0, and the oldest saved configuration is
number 49. If you do not specify arguments, the candidate configuration is
compared against the active configuration file (/config/juniper.conf).
! Statements that are only in the candidate configuration are prefixed with a plus
sign (+).
! Statements that are only in the comparison file are prefixed with a minus sign
(–).
! Statements that are unchanged are prefixed with a single blank space ( ).
The following example shows various changes, then a comparison of the candidate
configuration with the active configuration, showing only the changes made at the
[edit protocols bgp] hierarchy level:
[edit]
user@host# edit protocols bgp
To return to the rescue configuration, use the rollback rescue configuration mode
command:
[edit]
user@host# rollback rescue
load complete
To activate the rescue configuration that you have loaded, use the commit
command:
[edit]
user@host# rollback rescue
load complete
[edit]
user@host# commit
For more information about the request system configuration rescue delete and
request system configuration rescue save commands, see the JUNOS System Basics
and Services Command Reference.
To save software configuration changes to an ASCII file, use the save configuration
mode command:
[edit]
user@host# save filename
[edit]
user@host#
The contents of the current level of the statement hierarchy (and below) are saved,
along with the statement hierarchy containing it. This allows a section of the
configuration to be saved, while fully specifying the statement hierarchy.
When you issue this command from anywhere in the hierarchy (except the top
level), a replace tag is automatically included at the beginning of the file. You can
use the replace tag to control how a configuration is loaded from a file. (See
Figure 17.) For more information, see “Loading a Configuration from a File” on
page 123.
You can also create a configuration while typing at the terminal and then load it.
Loading a configuration from the terminal is generally useful when you are cutting
existing portions of the configuration and pasting them elsewhere in the
configuration.
To load an existing configuration file that is located on the router, use the load
configuration mode command:
[edit]
user@host# load (merge | override | patch | replace | set | update) filename
<relative>
To load a configuration from the terminal, use the following version of the load
configuration mode command:
[edit]
user@host# load (merge | override | patch | replace | set | update) terminal
<relative>
[Type ^D to end input]
To replace an entire configuration, specify the override option at any level of the
hierarchy.
An override operation discards the current candidate configuration and loads the
configuration in filename or the one that you type at the terminal. When you use the
override option and commit the configuration, all system processes reparse the
configuration. For an example, see Figure 18 on page 126.
To replace only the configuration that has changed, specify the update option at any
level of the hierarchy. An update operation compares the current configuration and
the current candidate configuration, and loads only the changes between these
configurations in filename or the one that you type at the terminal. When you use
the update operation and commit the configuration, the JUNOS software attempts
to notify the smallest set of system processes that are affected by the configuration
change.
To combine the current configuration and the configuration in filename or the one
that you type at the terminal, specify the merge option. A merge operation is useful
when you are adding a new section to an existing configuration. If the existing
configuration and the incoming configuration contain conflicting statements, the
statements in the incoming configuration override those in the existing
configuration. For an example, see Figure 20 on page 127.
To replace portions of a configuration, specify the replace option. For this operation
to work, you must include replace: tags in the file or configuration you type at the
terminal. The software searches for the replace: tags, deletes the existing
statements of the same name, if any, and replaces them with the incoming
configuration. If there is no existing statement of the same name, the replace
operation adds to the configuration the statements marked with the replace: tag.
For an example, see Figure 19 on page 126.
To load a configuration that contains the set configuration mode command, specify
the set option. This option executes the configuration instructions line by line as
they are stored in a file or from a terminal. The instructions can contain any
configuration mode command, such as set, edit, exit, and top. For an example, see
Figure 22 on page 128.
To use the merge, replace, set, or update option without specifying the full hierarchy
level, specify the relative option. For example:
[edit system]
user@host# show static-host-mapping
bob sysid 987.654.321ab
[edit system]
user@host# load replace terminal relative
{Type ^D at a new line to end input]
replace: static-host-mapping {
bob sysid 0123.456.789bc;
}
load complete
[edit system]
user@host# show static-host-mapping
bob sysid 0123.456.789bc;
To change part of the configuration with a patch file and mark only those parts as
changed, specify the patch option. For an example, see Figure 21 on page 127.
If, in an override or merge operation, you specify a file or type text that contains
replace: tags, the replace: tags are ignored, and the override or merge operation
is performed.
If you are performing a replace operation and the file you specify or text you type
does not contain any replace: tags, the replace operation is effectively equivalent to
a merge operation. This might be useful if you are running automated scripts and
cannot know in advance whether the scripts need to perform a replace or a merge
operation. The scripts can use the replace operation to cover either case.
For information about specifying the filename, see “Specifying Filenames and
URLs” on page 64.
To copy a configuration file from another network system to the local router, you
can use the SSH and Telnet utilities, as described in the JUNOS System Basics and
Services Command Reference.
load merge
load replace
load override
load update
For more information, see the Secure Configuration Guide for Common Criteria and
JUNOS-FIPS.
1628
}
1705
Figure 21: Example 4: Load a Configuration from a File
File contents:
edit access
set profile p1 client cl ike
edit profile p1 client cl ike
set pre-shared-key ascii-text "abcd"
set allowed-proxy-pair local 1.1.1.1 remote 2.2.2.2
exit
deactivate profile p1
top
edit system
set radius-server 1.1.1.1
load set
New contents:
system {
radius-server {
1.1.1.1;
}
}
access {
inactive: profile p1 {
client cl {
ike {
allowed-proxy-pair local 1.1.1.1/32 remote 2.2.2.2/32;
pre-shared-key ascii-text "$9$Ydg4ZDjqf5FVw"; ## SECRET-DATA
}
}
}
}
Specifying Statements
Statements are shown one of two ways, either with braces or without:
! identifier [value1 value 2 value3 ...]—The identifier is a set that accepts multiple
values. The brackets are required when you specify a set of identifiers; however,
they are optional when you specify only one identifier.
The following examples illustrate how statements and identifiers are specified in the
configuration:
When you create an ASCII configuration file, you can specify statements and
identifiers in one of the following ways. However, each statement has a preferred
style, and the CLI uses that style when displaying the configuration in response to a
configuration mode show command.
statement-name {
identifier-name;
[...]
identifier-name value;
[...]
}
! For some repeating identifiers, you can use one set of braces for all the
statements:
statement-name {
identifier-name value1;
identifier-name value2;
}
For example, if you are logged in to re1 (requesting Routing Engine) and you want
re0 (responding Routing Engine) to have the same configuration as re1, issue the
commit synchronize command on re1. re1 copies and loads its candidate
configuration to re0. Both Routing Engines then perform a syntax check on the
candidate configuration file being committed. If no errors are found, re1's
candidate configuration is activated and becomes the current operational
configuration on both Routing Engines.
NOTE: When you issue the commit synchronize command, you must use the groups
re0 and re1. For information about how to use the apply groups statement, see
“Applying a Configuration Group” on page 165.
The responding Routing Engine must be running JUNOS Release 5.0 or higher.
[edit]
user@host# commit synchronize
commit complete
[edit]
user@host#
NOTE: You can also add the commit synchronize statement at the [edit system]
hierarchy level so that a commit command automatically invokes a commit
synchronize command by default. For more information, see the JUNOS System
Basics Configuration Guide.
re0 {
system {
host-name my_router_RE0;
}
interfaces {
fxp0 {
unit 0 {
family inet {
address 192.168.15.49/24;
}
family iso;
}
}
}
}
re1 {
system {
host-name my_router_RE1;
}
interfaces {
fxp0 {
unit 0 {
family inet {
address 192.168.15.50/24;
}
family iso;
}
}
}
}
[edit]
user@host# set apply-groups [re0 re1]
[edit]
user@host#
For commands that display output, such as the show commands, you can filter the
output. This chapter provides information about the following topics:
As soon as the command-line interface (CLI) can determine the length of the output
(typically by the second screen), it displays the percentage of the output that has
been displayed so far above the ---(more)--- prompt.
The output buffer for the prompt is restricted to 32 megabytes (MB). Any new data
that exceeds the buffer limit replaces the oldest data in the memory buffer. When
the buffer limit is exceeded, attempts to search backward or navigate to the
beginning of the output generate a warning indicating that the output is truncated.
Because of the buffer size restriction, use of the scroll and search functions might
be limited.
Table 15 lists the keyboard sequences you can use at the ---(more)--- prompt.
Search for a text string. You are prompted for the string to match. m or M
(Same as specifying the | match filter when entering command
using the pipe symbol. See “Displaying Output That Matches a
Regular Expression” on page 142.)
Search, ignoring a text string. You are prompted for the string to e or E
not match. (Same as specifying the | except filter when entering
command using the pipe symbol. See “Ignoring Output That Does
Not Match a Regular Expression” on page 141.)
Interrupt or End Output, Interrupt the display of output. Ctrl+c, q, Q, or Ctrl+k
Redraw the Output, and
Save the Output to a File
Do not redisplay the CLI prompt immediately after displaying the H
output, but remain at the ---(more)--- prompt. (Same as specifying
the | hold command.)
Clear any match conditions and display the complete output. c or C
Redraw the output on the screen. Ctrl+l
The following example lists the filters that can be used with the pipe symbol:
For the show configuration command only, an additional compare filter is available:
You can enter any of the pipe filters in conjunction. For example:
user@host> command | match regular-expression | save filename
See “Pipe Filter Functions” on page 139 for a description of each type of filter.
NOTE: This section describes only the filters that can be used for operational mode
command output. For information about filters that can be used in configuration
mode, see the JUNOS System Basics Configuration Guide.
Operator Function
| Indicates that a match can be one of the two terms on either side of the pipe.
^ Used at the beginning of an expression, denotes where a match should begin.
$ Used at the end of an expression, denotes that a term must be matched exactly
up to the point of the $ character.
[] Specifies a range of letters or digits to match. To separate the start and end of a
range, use a hyphen ( - ).
() Specifies a group of terms to match.
12
22
321
4
12
22
321
22
4
NOTE: See the following sections for more examples of using regular expressions:
! Ignoring Output That Does Not Match a Regular Expression on page 141
! Displaying Output from the First Match of a Regular Expression on page 141
! Ignoring Output That Does Not Match a Regular Expression on page 141
! Displaying Output from the First Match of a Regular Expression on page 141
Comparing Configurations
The compare filter compares the candidate configuration with either the current
committed configuration or a configuration file and displays the differences
between the two configurations. To compare configurations, enter compare after
the pipe symbol:
[edit]
user@host# show | compare [filename | rollback n]
n is the index into the list of previously committed configurations. The most
recently saved configuration is 0. If you do not specify arguments, the candidate
configuration is compared against the active configuration file (/config/juniper.conf).
! Statements that are only in the candidate configuration are prefixed with a plus
sign (+).
! Statements that are only in the comparison file are prefixed with a minus sign
(–).
! Statements that are unchanged are prefixed with a single blank space ( ).
For example:
The following example displays the show cli directory command output as XML tags:
The following example displays all users who are logged in to the router, except for
the user root:
The following example displays the routes in the routing table starting at IP address
208.197.169.0:
47.0005.80ff.f800.0000.0108.0001.1921.6800.4015.00/160
*[Direct/0] 1d 13:22:12
> via lo0.0
The following example displays the first CCC entry in the forwarding table:
This filter is useful when you want to scroll or search through output.
This filter is useful for viewing log files in which the end of the file contains the most
recent entries.
The following example matches all the Asynchronous Transfer Mode (ATM)
interfaces in the configuration:
To prevent the output from being paginated, enter no-more after the pipe symbol.
The following example displays output from the show configuration command all
at once:
This feature is useful, for example, if you want to copy the entire output and paste it
into an e-mail.
If you are troubleshooting your router and, for example, talking with a customer
service representative on the phone, you can use the request message command to
send your representative the command output you are currently viewing on
your terminal.
The following example sends the output from the show interfaces command you
enter on your terminal to the terminal of the user root@ttyp1:
The user root@ttyp1 sees the following output appear on the terminal screen:
Resolving IP Addresses
If the output of a command displays an unresolved IP address, you can enter
| resolve after the command to display the name associated with the IP address.
The resolve filter enables the system to perform a reverse DNS lookup of the IP
address. If DNS is not enabled, the lookup fails and no substitution is performed.
To save command output to a file, enter save filename after the pipe symbol.
The following example saves the output from the request support information
command to a file named my-support-info.txt:
The following example displays output from the show system storage command,
filtering out the first 10 columns:
NOTE: When you use SSH to log in to the router or log in from the console when its
terminal type is already configured (as described in the JUNOS System Basics
Configuration Guide), your terminal type, screen length, and screen width are
already set.
The terminal type can be one of the following: ansi, vt100, small-xterm, or xterm.
Setting the screen length to 0 lines disables the display of output one screen at a
time. Disabling this UNIX more-type interface can be useful when you are issuing
CLI commands from scripts.
If you do not specify a timestamp format, the default format is Mmm dd hh:mm:ss
(for example, Feb 08 17:20:49). Enclose the format in single quotation marks (‘).
To have the CLI allow only a tab to complete a command, use the set cli
complete-on-space off command:
To re-enable the use of both spaces and tabs for command completion, use the set
cli complete-on-space on command:
This chapter provides information on how to use keyboard shortcuts, wildcards, and
other advanced techniques to save time when entering commands and
configuration statements.
pattern pattern1 is a text string or regular expression that defines the identifiers and
values you want to replace in the configuration.
pattern2 is a text string or regular expression that replaces the identifiers and values
located with pattern1.
Juniper Networks uses standard UNIX-style regular expression syntax (as defined in
POSIX 1003.2). If the regular expression contains spaces, operators, or wildcard
characters, enclose the expression in quotation marks. Greedy qualifiers (match as
much as possible) are supported. Lazy qualifiers (match as little as possible) are not.
upto n specifies the number of objects replaced. The value of n controls the total
number of objects that are replaced in the configuration (not the total number of
times the pattern occurs). Objects at the same hierarchy level (siblings) are replaced
first. Multiple occurrences of a pattern within a given object are considered a single
replacement. For example, if a configuration contains a 010101 text string, the
following command:
If you do not specify an upto option, all identifiers and values in the configuration
that match pattern1 are replaced.
The replace command is available in configuration mode at any hierarchy level. All
matches are case-sensitive.
Table 19 shows some common regular expressions you can use with the replace
command. Table 20 provides some examples of pattern replacement.
Operator Function
| Indicates that a match can be one of the two terms on either side of the pipe.
^ Used at the beginning of an expression, denotes where a match should begin.
$ Used at the end of an expression, denotes that a term must be matched exactly
up to the point of the $ character.
[] Specifies a range of letters or digits to match. To separate the start and end of a
range, use a hyphen ( - ).
() Specifies a group of terms to match. Stored as numbered variables. Use for back
references as \1 \2 .... \9.
* 0 or more terms.
+ One or more terms.
. Any character except for a space " ".
\ A backslash escapes special characters to suppress their special meaning. For
example, \. matches . (period symbol).
\n Back reference. Matches the nth group.
& Back reference. Matches the entire match.
Command Result
replace pattern myrouter with router1 Match: myrouter
Result: router1
replace pattern “192\.168\.(.*)/24” with “10.2.\1/28” Match: 192.168.3.4/24
Result: 10.2.3.4/28
replace pattern “1.\1” with “abc&def” Match: 1.1
Result: abc1.1def
replace pattern 1.1 with “abc\&def” Match: 1#1
Result: abc&def
[edit]
user@host# show
protocols {
ospf {
area 0.0.0.0 {
interface so-0/0/0 {
hello-interval 5;
}
}
}
}
[edit]
user@host# replace so-0/0/0 with so-1/1/0
[edit]
user@host# show
protocols {
ospf {
area 0.0.0.0 {
interface so-1/1/0 {
hello-interval 5;
}
}
}
}
[edit]
user@host# show interfaces
xe-0/0/0 {
unit 0;
}
fe-3/0/1 {
vlan-tagging;
unit 0 {
description "inet6 configuration. IP: 2000::c0a8::1bf5";
vlan-id 100;
family inet {
address 17.10.1.1/24;
}
family inet6 {
address 2000::c0a8:1bf5/3;
}
}
}
[edit]
user@host# replace pattern "(.*):1bf5" with "\11bf5"
[edit]
user@host# show interfaces
xe-0/0/0 {
unit 0;
}
fe-3/0/1 {
vlan-tagging;
unit 0 {
description "inet6 configuration. IP: 2000::c0a8:1bf5";
vlan-id 100;
family inet {
address 17.10.1.1/24;
}
family inet6 {
address 2000::c0a8:1bf4/3;
}
}
}
[edit]
user@host# show interfaces
xe-0/0/0 {
description “mkt 020202”; #1st instance in the hierarchy
unit 0 {
description “mkt 010101”; #3rd instance in the hierarchy (child of the 1st
instance)
}
}
fe-0/0/1 {
description “mkt 020202”; #2nd instance in the hierarchy (sibling of the 1st
instance)
unit 0 {
family inet {
address 200.200.20.2/24;
}
}
}
Current Configuration:
Interfaces
ge-0/0/0 fe-0/0/1
description “mkt 010101” description “mkt 010101”
ge-0/0/0.0
description “mkt 010101”
Resulting Configuration:
Interfaces
ge-0/0/0.0
g017228
description “mkt 010101”
You can only delete several parts of the configuration where you normally put
multiple items; for example, interfaces. However, you cannot delete “groups” of
different items; for example:
[edit]
user@host# wildcard delete system services *
^
syntax error.
When you delete a statement, the statement and all its subordinate statements and
identifiers are removed from the configuration.
NOTE: When you use the wildcard command to delete related configuration items,
the regular expression must be the final statement.
If the JUNOS software matches more than eight related items, the CLI displays
only the first eight items.
Overview
Configuration groups allow you to create a group containing configuration
statements and to direct the inheritance of that group’s statements in the rest of the
configuration. The same group can be applied to different sections of the
configuration, and different sections of one group’s configuration statements can
be inherited in different places in the configuration.
You can also use wildcards in a configuration group to allow configuration data to
be inherited by any object that matches a wildcard expression.
Inheritance Model
Configuration groups use true inheritance, which involves a dynamic, ongoing
relationship between the source of the configuration data and the target of that
data. Data values changed in the configuration group are automatically inherited by
the target. The target need not contain the inherited information, although the
inherited values can be overridden in the target without affecting the source from
which they were inherited.
This inheritance model allows you to see only the instance-specific information
without seeing the inherited details. A command pipe in configuration mode allows
you to display the inherited data.
162 ! Overview
Chapter 11: Configuration Groups
[edit]
groups {
group-name {
configuration-data;
}
}
[edit]
groups {
group-name {
configuration-data;
}
lccn-re0 {
configuration-data;
}
lccn-re1 {
configuration-data;
}
}
group-name is the name of a configuration group. You can configure more than one
configuration group by specifying multiple group-name statements. However, you
cannot use the prefix junos- in a group name because it is reserved for use by the
JUNOS software.
One reason for the naming restriction is a configuration group called junos-defaults.
This preset configuration group is applied to the configuration automatically. You
cannot modify or remove the junos-defaults configuration group. For more
information about the JUNOS default configuration group, see “Using JUNOS
Default Groups” on page 184.
On routers that support multiple Routing Engines, you can also specify two special
group names:
The configuration specified in group re0 is only applied if the current Routing
Engine is in slot 0; likewise, the configuration specified in group re1 is only applied
if the current Routing Engine is in slot 1. Therefore, both Routing Engines can use
the same configuration file, each using only the configuration statements that apply
to it. Each re0 or re1 group contains at a minimum the configuration for the
hostname and the management interface (fxp0). If each Routing Engine uses a
different management interface, the group also should contain the configuration for
the backup router and static routes.
In addition, the TX Matrix platform supports group names for the Routing Engines
in each T640 routing node attached to the routing matrix. Providing special group
names for all Routing Engines in the routing matrix allows you to configure the
individual Routing Engines in each T640 routing node differently. Parameters that
are not configured at the [edit groups] hierarchy level apply to all Routing Engines in
the routing matrix.
The group names for Routing Engines on the TX Matrix platform have the following
formats:
n identifies the T640 routing node and can be from 0 through 3. For example, to
configure Routing Engine 1 properties for lcc3, you include statements at the
[edit groups lcc3–re1] hierarchy level. For information about the TX Matrix platform
and routing matrix, see the JUNOS System Basics Configuration Guide.
apply-groups [ group-names ];
If you specify more than one group name, list them in order of inheritance priority.
The configuration data in the first group takes priority over the data in subsequent
groups.
For routers that support multiple Routing Engines, you can specify re0 and re1
group names. The configuration specified in group re0 is only applied if the current
Routing Engine is in slot 0; likewise, the configuration specified in group re1 is only
applied if the current Routing Engine is in slot 1. Therefore, both Routing Engines
can use the same configuration file, each using only the configuration statements
that apply to it. Each re0 or re1 group contains at a minimum the configuration for
the hostname and the management interface (fxp0). If each Routing Engine uses a
different management interface, the group also should contain the configuration for
the backup router and static routes.
You can include only one apply-groups statement at each specific level of the
configuration hierarchy. The apply-groups statement at a specific hierarchy level lists
the configuration groups to be added to the containing statement’s list of
configuration groups.
Values specified at the specific hierarchy level override values inherited from the
configuration group.
Groups listed in nested apply-groups statements take priority over groups in outer
statements. In the following example, the BGP neighbor 10.0.0.1 inherits
configuration data from group one first, then from groups two and three.
Configuration data in group one overrides data in any other group. Data from group
ten is used only if a statement is not contained in any other group.
In addition, setting a contact for a specific box is now possible because the group
data would be hidden by the router-specific data.
[edit]
groups {
basic { # User-defined group name
snmp { # This group contains some SNMP data
contact "My Engineering Group";
community BasicAccess {
authorization read-only;
}
}
}
}
apply-groups basic; # Enable inheritance from group "basic"
snmp { # Some normal (non-group) configuration
location "West of Nowhere";
}
[edit]
snmp {
location "West of Nowhere";
contact "My Engineering Group";
community BasicAccess {
authorization read-only;
}
}
apply-groups-except [ group-names ];
This useful when you use the apply-group statement at a specific hierarchy level but
also want to override the values inherited from the configuration group for a
specific parameter.
[edit]
groups { # "groups" is a top-level statement
global { # User-defined group name
interfaces {
<*> {
hold-time down 640;
link-mode full-duplex;
}
}
}
apply-groups global;
interfaces {
so-1/1/0 {
apply-groups-except global; # Disables inheritance from group "global":
} # so-1/1/0 uses default values for “hold-time”
# and “link-mode”
}
[edit]
user@host# show | display inheritance
snmp {
location "West of Nowhere";
##
## ’My Engineering Group’ was inherited from group ’basic’
##
contact "My Engineering Group";
##
## ’BasicAccess’ was inherited from group ’basic’
##
community BasicAccess {
##
## ’read-only’ was inherited from group ’basic’
##
authorization read-only;
}
}
[edit]
user@host# show | display inheritance | except ##
snmp {
location "West of Nowhere";
contact "My Engineering Group";
community BasicAccess {
authorization read-only;
}
}
! Close bracket ( ] )—Indicates the end of a character class. If the close bracket is
missing, the open bracket matches a [ rather than introduce a character class.
! A character class matches any of the characters between the square brackets.
Character classes must be enclosed in quotation marks (“ ”).
Wildcarding in configuration groups follows the same rules, but the wildcard
pattern must be enclosed in angle brackets (<pattern>) to differentiate it from other
wildcarding in the configuration file. For example:
[edit]
groups {
sonet-default {
interfaces {
<so-*> {
sonet-options {
payload-scrambler;
rfc-2615;
}
}
}
}
}
Angle brackets allow you to pass normal wildcarding through without modification.
In all matching within the configuration, whether it is done with or without
wildcards, the first item encountered in the configuration that matches is used. In
the following example, data from the wildcarded BGP groups is inherited in the
order in which the groups are listed. The preference value from <*a*> overrides the
preference in <*b*>, just as the p value from <*c*> overrides the one from <*d*>.
Data values from any of these groups override the data values from abcd.
[edit]
user@host# show
groups {
one {
protocols {
bgp {
group <*a*> {
preference 1;
}
group <*b*> {
preference 2;
}
group <*c*> {
out-delay 3;
}
group <*d*> {
out-delay 4;
}
group abcd {
preference 10;
hold-time 10;
out-delay 10;
}
}
}
}
}
protocols {
bgp {
group abcd {
apply-groups one;
}
}
}
[edit]
user@host# show | display inheritance
protocols {
bgp {
group abcd {
##
## ’1’ was inherited from group ’one’
##
preference 1;
##
## ’10’ was inherited from group ’one’
##
hold-time 10;
##
## ’3’ was inherited from group ’one’
##
out-delay 3;
}
}
}
[edit]
user@host# show
groups {
one {
interfaces {
<so-*> {
sonet-options {
rfc-2615;
}
}
<so-0/*> {
sonet-options {
fcs 32;
}
}
<so-*/0/*> {
sonet-options {
fcs 16;
}
}
<so-*/*/0> {
sonet-options {
payload-scrambler;
}
}
}
}
}
apply-groups one;
interfaces {
so-0/0/0 {
unit 0 {
family inet {
address 10.0.0.1/8;
}
}
}
}
[edit]
user@host# show | display inheritance
interfaces {
so-0/0/0 {
##
## ’sonet-options’ was inherited from group ’one’
##
sonet-options {
##
## ’32’ was inherited from group ’one’
##
fcs 32;
##
## ’payload-scrambler’ was inherited from group ’one’
##
payload-scrambler;
##
## ’rfc-2615’ was inherited from group ’one’
##
rfc-2615;
}
unit 0 {
family inet {
address 10.0.0.1/8;
}
}
}
}
[edit]
user@host# show
groups {
basic {
snmp {
interface so-1/1/1.0;
}
}
}
apply-groups basic;
snmp {
interface so-0/0/0.0;
}
[edit]
user@host# show | display inheritance
snmp {
##
## ’so-1/1/1.0’ was inherited from group ’basic’
##
interface [ so-0/0/0.0 so-1/1/1.0 ];
}
For sets that are not displayed within brackets, all values are also inherited. For
example:
[edit]
user@host# show
groups {
worldwide {
system {
name-server {
10.0.0.100;
10.0.0.200;
}
}
}
}
apply-groups worldwide;
system {
name-server {
10.0.0.1;
10.0.0.2;
}
}
[edit]
user@host# show | display inheritance
system {
name-server {
##
## ’10.0.0.100’ was inherited from group ’worldwide’
##
10.0.0.100;
##
## ’10.0.0.200’ was inherited from group ’worldwide’
##
10.0.0.200;
}
}
Configuring Interfaces
You can use configuration groups to separate the common interface media
parameters from the interface-specific addressing information. The following
example places configuration data for ATM interfaces into a group called
atm-options:
[edit]
user@host# show
groups {
atm-options {
interfaces {
<at-*> {
atm-options {
vpi 0 maximum-vcs 1024;
}
unit <*> {
encapsulation atm-snap;
point-to-point;
family iso;
}
}
}
}
}
apply-groups atm-options;
interfaces {
at-0/0/0 {
unit 100 {
vci 0.100;
family inet {
address 10.0.0.100/30;
}
}
unit 200 {
vci 0.200;
family inet {
address 10.0.0.200/30;
}
}
}
}
[edit]
user@host# show | display inheritance
interfaces {
at-0/0/0 {
##
## "atm-options" was inherited from group "atm-options"
##
atm-options {
##
## "1024" was inherited from group "atm-options"
##
vpi 0 maximum-vcs 1024;
}
unit 100 {
##
## "atm-snap" was inherited from group "atm-options"
##
encapsulation atm-snap;
##
## "point-to-point" was inherited from group "atm-options"
##
point-to-point;
vci 0.100;
family inet {
address 10.0.0.100/30;
}
##
## "iso" was inherited from group "atm-options"
##
family iso;
}
unit 200 {
##
## "atm-snap" was inherited from group "atm-options"
##
encapsulation atm-snap;
##
## "point-to-point" was inherited from group "atm-options"
##
point-to-point;
vci 0.200;
family inet {
address 10.0.0.200/30;
}
##
## "iso" was inherited from group "atm-options"
##
family iso;
}
}
}
[edit]
user@host# show | display inheritance | except ##
interfaces {
at-0/0/0 {
atm-options {
vpi 0 maximum-vcs 1024;
}
unit 100 {
encapsulation atm-snap;
point-to-point;
vci 0.100;
family inet {
address 10.0.0.100/30;
}
family iso;
}
unit 200 {
encapsulation atm-snap;
point-to-point;
vci 0.200;
family inet {
address 10.0.0.200/30;
}
family iso;
}
}
}
Optionally, for consistent access to the master Routing Engine, you can configure an
additional IP address and use this address for the management interface regardless
of which Routing Engine is active. This additional IP address is active only on the
management interface for the master Routing Engine. During switchover, the
address moves to the new master Routing Engine.
This feature is available on all platforms that include dual Routing Engines. On the
TX Matrix platform, this feature is applicable to the switch-card chassis (SCC) only.
[edit]
user@host# show
groups {
some-isp {
interfaces {
<xe-*> {
gigether-options {
flow-control;
}
}
}
protocols {
bgp {
group <*> {
neighbor <*> {
remove-private;
}
}
}
pim {
interface <*> {
version 1;
}
}
}
}
}
interfaces {
xe-0/0/0 {
apply-groups some-isp;
unit 0 {
family inet {
address 10.0.0.1/24;
}
}
}
}
protocols {
bgp {
group main {
neighbor 10.254.0.1 {
apply-groups some-isp;
}
}
}
pim {
interface xe-0/0/0.0 {
apply-groups some-isp;
}
}
}
[edit]
user@host# show | display inheritance
interfaces {
xe-0/0/0 {
##
## "gigether-options" was inherited from group "some-isp"
##
gigether-options {
##
## "flow-control" was inherited from group "some-isp"
##
flow-control;
}
unit 0 {
family inet {
address 10.0.0.1/24;
}
}
}
}
protocols {
bgp {
group main {
neighbor 10.254.0.1 {
##
## "remove-private" was inherited from group "some-isp"
##
remove-private;
}
}
}
pim {
interface xe-0/0/0.0 {
##
## "1" was inherited from group "some-isp"
##
version 1;
}
}
}
[edit]
user@host# show
groups {
standard {
interfaces {
<t3-*> {
t3-options {
compatibility-mode larscom subrate 10;
idle-cycle-flag ones;
}
}
}
}
northwest {
interfaces {
<t3-*> {
t3-options {
long-buildout;
compatibility-mode kentrox;
}
}
}
}
}
apply-groups standard;
interfaces {
t3-0/0/0 {
apply-groups northwest;
}
}
[edit]
user@host# show | display inheritance
interfaces {
t3-0/0/0 {
##
## "t3-options" was inherited from group "northwest"
##
t3-options {
##
## "long-buildout" was inherited from group "northwest"
##
long-buildout;
##
[edit]
user@host# show
groups {
mpls-conf {
protocols {
mpls {
label-switched-path <*-major> {
retry-timer 5;
bandwidth 155m;
optimize-timer 60;
}
label-switched-path <*-minor> {
retry-timer 15;
bandwidth 64k;
optimize-timer 120;
}
}
}
}
}
apply-groups mpls-conf;
protocols {
mpls {
label-switched-path metro-major {
to 10.0.0.10;
}
label-switched-path remote-minor {
to 10.0.0.20;
}
}
}
[edit]
user@host# show | display inheritance
protocols {
mpls {
label-switched-path metro-major {
to 10.0.0.10;
##
## "5" was inherited from group "mpls-conf"
##
retry-timer 5;
#
## "155m" was inherited from group "mpls-conf"
##
bandwidth 155m;
##
## "60" was inherited from group "mpls-conf"
##
optimize-timer 60;
}
label-switched-path remote-minor {
to 10.0.0.20;
##
## "15" was inherited from group "mpls-conf"
##
retry-timer 15;
##
## "64k" was inherited from group "mpls-conf"
##
bandwidth 64k;
##
## "120" was inherited from group "mpls-conf"
##
optimize-timer 120;
}
}
}
To view the full set of available preset statements from the JUNOS default group,
issue the show groups junos-defaults configuration mode command at the top level
of the configuration. The following example displays a partial list of JUNOS default
groups:
application junos-rpc-portmap-tcp {
application-protocol rpc-portmap;
protocol tcp;
destination-port 111;
}
#
# RPC port mapper on UDP
#
}
}
[edit]
groups {
junos-defaults {
applications {
application junos-ftp { # Use FTP default configuration
application-protocol ftp;
protocol tcp;
destination-port 21;
}
}
}
}
To reference a preset JUNOS default statement from the JUNOS defaults group,
include the junos- default-name statement at the applicable hierarchy level. For
example, to reference the JUNOS default statement for FTP in a stateful firewall,
include the junos-ftp statement at the [edit services stateful-firewall rule rule-name
term term-name from applications] hierarchy level:
[edit]
services {
stateful-firewall {
rule my-rule {
term my-term {
from {
applications junos-ftp; #Reference predefined statement, junos-ftp,
} #for FTP in the stateful firewall configuration
}
}
}
}
Example: Viewing Default Statements That Have Been Applied to the Configuration
To view the JUNOS defaults that have been applied to the configuration, issue the
show | display inheritance defaults command. For example, to view the inherited
JUNOS defaults at the [edit system ports] hierarchy level:
If you choose not to use existing JUNOS default statements, you can create your
own configuration groups manually. For more information about manually creating
of configuration groups, see “Overview” on page 162 and “Configuration Groups
Configuration Statements” on page 163.
The following sections explain each of the configuration group statements. The
statements are organized alphabetically.
apply-groups
You can specify more than one group name. You must list them in order of
inheritance priority. The configuration data in the first group takes priority over the
data in subsequent groups.
For routers that support multiple Routing Engines, you can specify re0 and re1 as
group names. The configuration specified in group re0 is applied only if the current
Routing Engine is in slot 0; likewise, the configuration specified in group re1 is
applied only if the current Routing Engine is in slot 1. Therefore, both Routing
Engines can use the same configuration file, each using only the configuration
statements that apply to it. Each re0 or re1 group contains at a minimum the
configuration for the hostname and the management interface (fxp0). If each
Routing Engine uses a different management interface, the group also should
contain the configuration for the backup router and static routes.
For the TX Matrix platform, you can specify lccn-re0 and lccn-re1 as group names
where n identifies the T640 routing node that is connected to a TX Matrix platform
and can be from 0 through 3.
You can include the apply-groups statement at any level of the configuration
hierarchy.
You can include only one apply-groups statement at each specific level of the
configuration hierarchy. The apply-groups statement at a specific hierarchy level lists
the configuration groups to be added to the containing statement’s list of
configuration groups.
Required Privilege Level configure—To enter configuration mode; other required privilege levels depend on
where the statement is located in the configuration hierarchy.
apply-groups-except
Required Privilege Level configure—To enter configuration mode; other required privilege levels depend on
where the statement is located in the configuration hierarchy.
groups
Syntax groups {
group-name {
configuration-data;
}
lccn-re0 {
configuration-data;
}
lccn-re1 {
configuration-data;
}
}
188 ! apply-groups-except
Chapter 12: Summary of Configuration Group Statements
The configuration specified in group re0 is applied only if the current Routing
Engine is in slot 0; likewise, the configuration specified in group re1 is applied
only if the current Routing Engine is in slot 1. Therefore, both Routing Engines
can use the same configuration file, each using only the configuration
statements that apply to it. Each re0 or re1 group contains at a minimum the
configuration for the hostname and the management interface (fxp0). If each
Routing Engine uses a different management interface, the group also should
contain the configuration for the backup router and static routes.
(Routing matrix only) The TX Matrix platform supports group names for the Routing
Engines in each connected T640 routing node in the following formats:
groups ! 189
JUNOS 8.1 CLI User Guide
190 ! groups
Part 4
CLI Command Summaries
Description Set the CLI to complete a partial command entry when you type a space or a tab.
This is the default behavior of the CLI.
Sample Output In the following example, pressing the Spacebar changes the partial command
entry from com to complete-on-space. The example shows how adding the keyword
off at the end of the command disables command completion.
Description Set the maximum time that an individual session can be idle before the user is
logged off the router.
Options string—CLI prompt string. To include spaces in the prompt, enclose the string in
quotation marks. By default, the string is username@hostname.
Description For an individual session, set the CLI to prompt you to restart the router after
upgrading the software.
Usage Guidelines See “Setting the CLI to Prompt After a Software Upgrade” on page 147.
Options length—Number of lines of text that the terminal screen displays. The range of
values, in number of lines, is 24 through 100,000. The default is 24.
The point at which the ---(more)--- prompt appears on the screen is a function of
this setting and the settings for the set cli screen-width and set cli terminal
commands.
The point at which the ---(more)--- prompt appears on the screen is a function of
this setting and the settings for the set cli screen-length and set cli terminal
commands.
Options format timestamp-format—Set the data and time format for the timestamp. The
timestamp format you specify can include the following placeholders in any
order:
! %m—Two-digit month
! %d—Two-digit date
Enclose the format in single quotation marks ( ‘ ). Do not use spaces. Use a
hyphen ( - ) or similar character to separate placeholders.
set date
Options date-time—Date and time. Enter this string inside quotation marks.
ntp—Use a Network Time Protocol (NTP) server to synchronize the current date and
time setting on the router.
show cli
activate
Description Remove the inactive: tag from a statement, effectively adding the statement or
identifier back to the configuration. Statements or identifiers that have been
activated take effect when you next issue the commit command.
Options identifier—Identifier from which you are removing the inactive tag. It must be an
identifier at the current hierarchy level.
statement—Statement from which you are removing the inactive tag. It must be a
statement at the current hierarchy level.
Usage Guidelines See “Deactivating and Reactivating Statements and Identifiers” on page 92.
Required Privilege configure—To enter configuration mode; other required privilege levels depend on
Level where the statement is located in the configuration hierarchy.
annotate
Description Add comments to a configuration. You can add comments only at the current
hierarchy level.
Any comments you add appear only when you view the configuration by entering
the show command in configuration mode or the show configuration command in
operational mode.
Required Privilege Level configure—To enter configuration mode; other required privilege levels depend on
where the statement is located in the configuration hierarchy.
See Also See the description statement in the JUNOS Network Interfaces Configuration Guide.
commit
Description Commit the set of changes to the database and cause the changes to take
operational effect.
string is reboot or the future time to activate the configuration changes. Enclose
the string value (including reboot) in quotation marks (“). You can specify time
in two formats:
! A time value in the form hh:mm [:ss] (hours, minutes, and optionally
seconds)— Commit the configuration at the specified time, which must be
in the future but before 11:59:59 PM on the day the commit at configuration
command is issued. Use 24-hour time for the hh value; for example,
04:30:00 is 4:30:00 AM, and 20:00 is 8:00 PM. The time is interpreted
with respect to the clock and time zone settings on the router.
202 ! annotate
Chapter 14: Summary of CLI Configuration Mode Commands
! A date and time value in the form yyyy-mm-dd hh:mm [:ss] (year, month,
date, hours, minutes, and, optionally, seconds)—Commit the configuration
at the specified day and time, which must be after the commit at command
is issued. Use 24-hour time for the hh value. For example,
2003-08-21 12:30:00 is 12:30 PM on August 21, 2003. The time is
interpreted with respect to the clock and time zone settings on the router.
For example, commit at “18:00:00”. For date and time, include both values in
the same set of quotation marks. For example, commit at "2005-03-10
14:00:00".
A commit check is performed when you issue the commit at configuration mode
command. If the result of the check is successful, then the current user is
logged out of configuration mode, and the configuration data is left in a
read-only state. No other commit can be performed until the scheduled commit
is completed.
NOTE: If the JUNOS software fails before the configuration changes become active,
all configuration changes are lost.
You cannot issue the commit at configuration command when there is a pending
reboot.
You cannot issue the request system reboot command once you schedule a
commit operation for a specific time in the future.
check—(Optional) Verify the syntax of the configuration, but do not activate it.
commit ! 203
JUNOS 8.1 CLI User Guide
synchronize—(Optional) If your router has two Routing Engines, you can manually
direct one Routing Engine to synchronize its configuration with the other by
issuing the commit synchronize command. The Routing Engine on which you
execute this command (request Routing Engine) copies and loads its candidate
configuration to the other (responding Routing Engine). Both Routing Engines
then perform a syntax check on the candidate configuration file being
committed. If no errors are found, the configuration is activated and becomes
the current operational configuration on both Routing Engines. The commit
synchronize command does not work if the responding Routing Engine has
uncommitted configuration changes.
NOTE: When you issue the commit synchronize command, you must use the
apply-groups re0 and re1 commands. For information about how to use groups,
see “Applying a Configuration Group” on page 165.
The responding Routing Engine must use JUNOS Release 5.0 or later.
load merge
load replace
load override
load update
For more information, see the Secure Configuration Guide for Common Criteria and
JUNOS-FIPS.
204 ! commit
Chapter 14: Summary of CLI Configuration Mode Commands
copy
Required Privilege Level configure—To enter configuration mode; other required privilege levels depend on
where the statement is located in the configuration hierarchy.
deactivate
Description Add the inactive: tag to a statement, effectively commenting out the statement or
identifier from the configuration. Statements or identifiers marked as inactive do
not take effect when you issue the commit command.
Options identifier—Identifier to which you are adding the inactive: tag. It must be an
identifier at the current hierarchy level.
Usage Guidelines See “Deactivating and Reactivating Statements and Identifiers” on page 92.
Required Privilege Level configure—To enter configuration mode; other required privilege levels depend on
where the statement is located in the configuration hierarchy.
copy ! 205
JUNOS 8.1 CLI User Guide
delete
If you do not specify statement-path or identifier, the entire hierarchy starting at the
current hierarchy level is removed.
Usage Guidelines See “Deleting a Statement from the Configuration” on page 86.
Required Privilege Level configure—To enter configuration mode; other required privilege levels depend on
where the statement is located in the configuration hierarchy.
edit
Description Move inside the specified statement hierarchy. If the statement does not exist, it is
created.
You cannot use the edit command to change the value of identifiers. You must use
the set command.
Required Privilege Level configure—To enter configuration mode; other required privilege levels depend on
where the statement is located in the configuration hierarchy.
206 ! delete
Chapter 14: Summary of CLI Configuration Mode Commands
exit
Description Exit the current level of the statement hierarchy, returning to the level prior to the
last edit command, or exit from configuration mode. The quit and exit commands
are synonyms.
Options none—Return to the previous edit level. If you are at the top of the statement
hierarchy, exit configuration mode.
Required Privilege Level configure—To enter configuration mode; other required privilege levels depend on
where the statement is located in the configuration hierarchy.
help
Description Display help about available configuration statements or general information about
getting help.
Options apropos string—(Optional) Display statement names and help text that matches the
string specified. If the string contains spaces, enclose it in quotation marks (“).
You can also specify a regular expression for the string, using standard
UNIX-style regular expression syntax.
tip cli number—(Optional) Display a tip about using the CLI. Specify the number of
the tip you want to view.
exit ! 207
JUNOS 8.1 CLI User Guide
insert
identifier1—Existing identifier.
Required Privilege Level configure—To enter configuration mode; other required privilege levels depend on
where the statement is located in the configuration hierarchy.
load
Syntax load (patch | merge | override | replace | set | update) (filename | terminal) <relative>
Description Load a configuration from an ASCII configuration file or from terminal input. Your
current location in the configuration hierarchy is ignored when the load operation
occurs.
Options filename—Name of the file to load. For information about specifying the filename,
see “Specifying Filenames and URLs” on page 64.
merge—Combine the configuration that is currently shown in the CLI and the
configuration in filename.
override—Discard the entire configuration that is currently shown in the CLI and
load the entire configuration in filename. Marks every object as changed.
patch—Change part of the configuration and mark only those parts as changed.
replace—Look for a replace: tag in filename, delete the existing statement of the
same name, and replace it with the configuration in filename.
208 ! insert
Chapter 14: Summary of CLI Configuration Mode Commands
relative—(Optional) Use the merge or replace option without specifying the full
hierarchy level.
terminal—Use the text you type at the terminal as input to the configuration. Type
Ctrl+d to end terminal input.
update—Discard the entire configuration that is currently shown in the CLI, and
load the entire configuration in filename. Marks changed objects only.
load merge
load replace
load override
load update
For more information, see the Secure Configuration Guide for Common Criteria and
JUNOS-FIPS.
Required Privilege Level configure—To enter configuration mode; other required privilege levels depend on
where the statement is located in the configuration hierarchy.
quit
Description Exit the current level of the statement hierarchy, returning to the level prior to the
last edit command, or exit from configuration mode. The quit and exit commands
are synonyms.
Options none—Return to the previous edit level. If you are at the top of the statement
hierarchy, exit configuration mode.
Required Privilege Level configure—To enter configuration mode; other required privilege levels depend on
where the statement is located in the configuration hierarchy.
quit ! 209
JUNOS 8.1 CLI User Guide
rename
Required Privilege Level configure—To enter configuration mode; other required privilege levels depend on
where the statement is located in the configuration hierarchy.
replace
Options pattern1—Text string or regular expression that defines the identifiers or values you
want to match.
pattern2—Text string or regular expression that replaces the identifiers and values
located with pattern1.
upto n—Number of objects replaced. The value of n controls the total number of
objects that are replaced in the configuration (not the total number of times the
pattern occurs). Objects at the same hierarchy level (siblings) are replaced first.
Multiple occurrences of a pattern within a given object are considered a single
replacement. If you do not specify an upto option, all identifiers and values in
the configuration that match pattern1 are replaced.
Required Privilege Level configure—To enter configuration mode; other required privilege levels depend on
where the statement is located in the configuration hierarchy.
210 ! rename
Chapter 14: Summary of CLI Configuration Mode Commands
rollback
Description Return to a previously committed configuration. The software saves the last 50
committed configurations, including the rollback number, date, time, and name of
the user who issued the commit configuration command.
During rollback, the configuration you specify is loaded from the associated file.
Only objects in the rollback configuration that differ from the previously loaded
configuration are marked as changed (equivalent to load update).
Usage Guidelines See “Returning to a Configuration Prior to the Most Recently Committed One” on
page 117 and “Creating and Returning to a Rescue Configuration” on page 120
Required Privilege Level rollback—To roll back to configurations other than the one most recently
committed.
run
Description Run a top-level CLI command without exiting from configuration mode.
rollback ! 211
JUNOS 8.1 CLI User Guide
save
Description Save the configuration to an ASCII file. The contents of the current level of the
statement hierarchy (and below) are saved, along with the statement hierarchy
containing it. This allows a section of the configuration to be saved, while fully
specifying the statement hierarchy.
When saving a file to a remote system, the software uses the scp/ssh protocol.
Options filename—Name of the saved file. You can specify a filename in one of the following
ways:
! filename—File in the user’s home directory (the current directory) on the local
flash drive.
212 ! save
Chapter 14: Summary of CLI Configuration Mode Commands
Usage Guidelines See “Deactivating and Reactivating Statements and Identifiers” on page 92.
set
Description Create a statement hierarchy and set identifier values. This is similar to edit except
that your current level in the hierarchy does not change.
Required Privilege Level configure—To enter configuration mode; other required privilege levels depend on
where the statement is located in the configuration hierarchy.
show
Required Privilege Level configure—To enter configuration mode; other required privilege levels depend on
where the statement is located in the configuration hierarchy.
set ! 213
JUNOS 8.1 CLI User Guide
Description Display the JUNOS software defaults that have been applied to the configuration.
Usage Guidelines See “Displaying set Commands from the Configuration” on page 109.
214 ! show
Chapter 14: Summary of CLI Configuration Mode Commands
Usage Guidelines See “Displaying set Commands from the Configuration” on page 109.
show ! 215
JUNOS 8.1 CLI User Guide
Description Display the full set of available preset statements from the JUNOS software default
group.
216 ! show
Chapter 14: Summary of CLI Configuration Mode Commands
status
Syntax status
Usage Guidelines See “Displaying Users Currently Editing the Configuration” on page 105.
top
Description Return to the top level of configuration command mode, which is indicated by the
[edit] banner.
Usage Guidelines See “Displaying the Current Configuration” on page 83 and “Displaying the Current
Configuration” on page 83.
up
Usage Guidelines See “Displaying the Current Configuration” on page 83 and “Displaying the Current
Configuration” on page 83.
status ! 217
JUNOS 8.1 CLI User Guide
update
Syntax update
Description Update private candidate configuration with a copy of the most recently committed
configuration, including your private changes.
Usage Guidelines See “Updating the Configure Private Configuration” on page 109.
NOTE: The update command is available only when you are in configure private
mode.
wildcard
If you do not specify statement-path or identifier, the entire hierarchy starting at the
current hierarchy level is removed.
Usage Guidelines See “Use the upto option to perform a replacement:” on page 157.
Required Privilege Level configure—To enter configuration mode; other required privilege levels depend on
where the statement is located in the configuration hierarchy.
218 ! update
Chapter 15
Summary of CLI Operational Mode
Commands
The following sections explain each of the command-line interface (CLI) operational
mode commands described in this book. The commands are organized
alphabetically.
configure
Usage Guidelines See “Entering and Exiting Configuration Mode” on page 80.
file
Syntax file (archive | checksum | compare | copy | delete | list | rename | show)
Description Copy files to and from the router, compare files, or delete a file on a local router.
Usage Guidelines See “Viewing Files and Directories” on page 61. See also the JUNOS System Basics
and Services Command Reference.
help
Options apropos string—(Optional) Display command names and help text that matches the
string specified. If the string contains spaces, enclose it in quotation marks (“).
You can also specify a regular expression for the string, using standard
UNIX-style regular expression syntax.
tip cli number—(Optional) Display a tip about using the CLI. Specify the number of
the tip you want to view.
220 ! help
Chapter 15: Summary of CLI Operational Mode Commands
| (pipe)
Options compare (filename | rollback n )—(Configuration mode only, and only with the show
command) Compare configuration changes with another configuration file.
find pattern—Display the output starting at the first occurrence of text matching a
regular expression. If the regular expression contains spaces, operators, or
wildcard characters, enclose it in quotation marks (" ").
last lines—Display the last number of lines you want to view from the end of the
configuration.
| (pipe) ! 221
JUNOS 8.1 CLI User Guide
save filename—Save the output to a file or URL. For information about specifying
the filename, see “Specifying Filenames and URLs” on page 64.
Usage Guidelines See “Filtering Command Output” on page 135 and “Displaying the Current
Configuration” on page 83.
quit
Syntax quit
request
Syntax request <chassis | ipsec switch | message | mpls | routing-engine | security | services |
system | flow-collector | support information>
Description Stop or reboot router components, switch between primary and backup
components, display messages, and display system information.
Usage Guidelines Most request commands are discussed in the JUNOS System Basics and Services
Command Reference. The following request commands are discussed in the JUNOS
Interfaces Command Reference: request ipsec switch and request services.
222 ! quit
Chapter 15: Summary of CLI Operational Mode Commands
restart
Syntax restart
<adaptive-services | chassis-control | class-of-service | disk-monitoring |
ecc-error-logging | firewall | interface-control | kernel-replication | l2tpd-service |
mib-process | network-access-service | pgm | pic-services-logging | pppoe |
remote-operations | routing <logical-router logical-router-name> | sampling |
service-deployment | snmp | web-management>
<gracefully | immediately | soft>
Description Restart router software processes on all platforms (with the exception of routing
matrixes and J-series Services Routers).
Usage Guidelines See the JUNOS System Basics and Services Command Reference.
Syntax restart
<adaptive-services | chassis-control | class-of-service | disk-monitoring |
ecc-error-logging | firewall | interface-control | kernel-replication | l2tpd-service |
link-management | mib-process | network-access-service | pgm | pic-services-logging |
pppoe | remote-operations | routing <logical-router logical-router-name> | sampling |
service-deployment | snmp | web-management>
<all | all-lcc | lcc number>
<gracefully | immediately | soft>
Usage Guidelines See the JUNOS System Basics and Services Command Reference.
restart ! 223
JUNOS 8.1 CLI User Guide
Syntax restart
<adaptive-services | chassis-control | class-of-service | dhcp | firewall |
interface-control | l2tpd-service | mib-process | network-access-service | pgm | pppoe |
remote-operations | routing <logical-router logical-router-name> | sampling |
service-deployment | snmp | usb-control | web-management>
<gracefully | immediately | soft>
Usage Guidelines See the JUNOS System Basics and Services Command Reference.
set
Description Configure chassis, CLI properties, and the router’s date and time.
Usage Guidelines See “Controlling the CLI Environment” on page 145 and “Using the Comment
Character #” on page 72. For information about setting chassis properties, see the
JUNOS System Basics and Services Command Reference.
show
Syntax show (accounting | aps | arp | as-path | bfd | bgp | chassis | class-of-service | cli |
configuration | connections | dvmrp | dynamic-tunnels | firewall | helper | host | igmp |
ike | ilmi | interfaces | ipsec | ipv6 | isis | l2circuit | l2vpn | ldp | link-management | log |
mld | mpls | msdp | multicast | ntp | ospf | ospf3 | passive-monitoring | pfe | pgm | pim |
policer | policy | pppoe | rip | ripng | route | rsvp | sap | services | snmp |
ssh-known-hosts | system | task | ted | version | vpls | vrrp)
Description Show information about all aspects of the software, including interfaces and routing
protocols.
Usage Guidelines Most show commands are discussed in the JUNOS System Basics and Services
Command Reference. The following show commands are discussed in the JUNOS
Interfaces Command Reference: show aps, show ike, show ilmi, show interfaces, show
ipsec, show passive-monitoring, show pppoe, show services, and show vrrp.
Indexes ! 225
JUNOS 8.1 CLI User Guide
226 ! Indexes
Index
Symbols A
! access privilege levels
in interface names ................................................153 entering configuration mode .................................80
regular expression operator .........................138, 154 activate command .......................................................201
wildcard character ................................................170 usage guidelines ................................................76, 92
" ", configuration group wildcards.............................170 active configuration .........................................................4
# addresses
comment character machine name .........................................................14
in commands......................................................72 annotate command ...............................................76, 202
in configuration statements ..............................93 usage guidelines ......................................................93
$ apply-groups statement ..............................................187
regular expression operator .........................138, 154 usage guidelines ....................................................165
() apply-groups-except statement ..................................188
regular expression operator .........................138, 154 usage guidelines ....................................................168
---(more)--- prompt ...............................................135–136 authorization See permissions
*
in interface names ................................................153 C
regular expression operator .................................154 candidate configuration ..................................................4
wildcard character ................................................170 clear command
+ usage guidelines ......................................................49
in statement lists ...............................................33, 85 CLI .....................................................................................5
regular expression operator .................................154 command completion ......................................5, 193
. (period) command history ....................................................36
regular expression operator .................................154 displaying ..........................................................200
/* */, comment delimiters ............................................93 command mode
<> overview ................................................................4
wildcard patterns ..................................................170 comparing configuration versions.......................119
> configuration mode
in statement lists ...............................................32, 85 commands, table ...............................................76
? description ..........................................................75
regular expression operator .................................170 example configuration.......................................80
wildcard ..................................................................170 hierarchy tree, description ................................79
[] navigation commands, table ............................35
in interface names ................................................153 statement path, example ..................................80
regular expression operator .........................138, 154 current working directory
wildcard characters ...............................................170 displaying ..........................................................199
^ setting ................................................................194
regular expression operator .........................138, 154 date
{} setting ................................................................198
specifying statements ...........................................128 editing command line ...........................................152
| (pipe) environment settings ............................................145
command output, filtering ...................137–143, 221 hierarchy of commands ...........................................5
idle timeout, setting ..............................................194
interface elements ...................................................26
keyboard sequences .......................................29, 152
Index ! 227
JUNOS 8.1 CLI User Guide
228 ! Index
Index
Index ! 229
JUNOS 8.1 CLI User Guide
230 ! Index
Index
Index ! 231
JUNOS 8.1 CLI User Guide
232 ! Index
Index
T W
technical support wildcard characters .....................................................170
customer support, contacting ............................. xxiii in interface names ................................................153
telnet command wildcard delete command ..........................................218
usage guidelines ......................................................50 usage guidelines ....................................................159
terminal option ............................................................123 wildcard names ....................................................170, 182
terminal screen length, setting ..................................196 word history
terminal screen width, setting ...................................196 operational mode ....................................................36
terminal type ................................................................146 working directory
setting .....................................................................197 displaying ...............................................................199
test command setting .....................................................................194
usage guidelines ......................................................49
timeout, user, setting...................................................194 X
timestamp, CLI output, setting ..................................197 XML format
top command...............................................................217 displaying command output in............................140
usage guidelines ................................................77, 89
traceroute command
usage guidelines ......................................................49
trim command .............................................................221
TX Matrix platform
configuration groups .............................................164
configuration groups example .............................167
type checking, CLI .......................................................130
typefaces, documentation conventions ..................... xix
Index ! 233
JUNOS 8.1 CLI User Guide
234 ! Index
Index of Statements and Commands
A M
activate command .......................................................201 match command .........................................................221
annotate command .....................................................202
apply-groups statement ..............................................187 N
apply-groups-except statement..................................188 no-more command..............................................221, 221
C P
commit command .......................................................202 pipe ( | ) command ......................................................221
commit synchronize command .................................202
compare command .....................................................221 Q
configure command ....................................................219 quit command ......................................................209, 222
copy command ............................................................205
count command ..........................................................221 R
rename command .......................................................210
D replace command ........................................................210
deactivate command ..................................................205 request chassis command ..........................................222
delete command ..........................................................206 request support information command....................222
resolve command ........................................................221
E restart command .........................................................223
edit command..............................................................206 rollback command.......................................................211
except command .........................................................221 run command ..............................................................211
exit command ..............................................................207
exit configuration-mode command...........................207 S
save command.....................................................212, 221
F set cli complete-on-space command .........................193
file command ...............................................................219 set cli directory command ..........................................194
find command .............................................................221 set cli idle-timeout command ....................................194
set cli prompt command ............................................195
G set cli restart-on-upgrade command .........................195
groups statement .........................................................188 set cli screen-length command ..................................196
set cli screen-width command ...................................196
H set cli terminal command ...........................................197
help command .....................................................207, 220 set cli timestamp command .......................................197
hold command.............................................................221 set command
configuration mode ...............................................213
I operational mode ...................................................224
insert command ..........................................................208 set date command .......................................................198
show | display inheritance defaults command ........214
J show | display set command .....................................214
junos-defaults ...............................................................216 show | display set relative command .......................215
show cli authorization command ..............................199
L show cli command ......................................................198
last command ..............................................................221 show cli directory command......................................199
load command .............................................................208 show cli history command .........................................200
show command
configuration mode ............................................... 213
operational mode .................................................. 224
show configuration command ................................... 224
show groups junos-defaults command ..................... 216
show version command ............................................... 66
status command .......................................................... 217
T
top command .............................................................. 217
trim command ............................................................. 221
U
up command................................................................ 217
update command ........................................................ 218
W
wildcard delete command.......................................... 218