junos-cli 14.2R.pdf

  • View
    226

  • Download
    4

Embed Size (px)

Text of junos-cli 14.2R.pdf

  • JunosOS

    CLI User Guide

    Release

    14.2

    Published: 2014-10-22

    Copyright 2014, Juniper Networks, Inc.

  • Juniper Networks, Inc.1194 North Mathilda AvenueSunnyvale, California 94089USA408-745-2000www.juniper.net

    Juniper Networks, Junos, Steel-Belted Radius, NetScreen, and ScreenOS are registered trademarks of Juniper Networks, Inc. in the UnitedStates and other countries. The Juniper Networks Logo, the Junos logo, and JunosE are trademarks of Juniper Networks, Inc. All othertrademarks, 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.

    JunosOS CLI User Guide14.2Copyright 2014, Juniper Networks, Inc.All rights reserved.

    The information in this document is current as of the date on the title page.

    YEAR 2000 NOTICE

    Juniper Networks hardware and software products are Year 2000 compliant. Junos OS has no known time-related limitations through theyear 2038. However, the NTP application is known to have some difficulty in the year 2036.

    ENDUSER LICENSE AGREEMENT

    The Juniper Networks product that is the subject of this technical documentation consists of (or is intended for use with) Juniper Networkssoftware. Use of such software is subject to the terms and conditions of the End User License Agreement (EULA) posted athttp://www.juniper.net/support/eula.html. By downloading, installing or using such software, you agree to the terms and conditions ofthat EULA.

    Copyright 2014, Juniper Networks, Inc.ii

  • Table of ContentsAbout the Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xv

    Documentation and Release Notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xvSupported Platforms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xvUsing the Examples in This Manual . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xvi

    Merging a Full Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xviMerging a Snippet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xvii

    Documentation Conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xviiDocumentation Feedback . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xixRequesting Technical Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xx

    Self-Help Online Tools and Resources . . . . . . . . . . . . . . . . . . . . . . . . . . . xxOpening a Case with JTAC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xx

    Chapter 1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23

    Introducing the Junos OS Command-Line Interface . . . . . . . . . . . . . . . . . . . . . . . . 23Key Features of the CLI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24

    Understanding the Junos OS CLI Modes, Commands, and StatementHierarchies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25Junos OS CLI Command Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25CLI Command Hierarchy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26Configuration Statement Hierarchy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26Moving Among Hierarchy Levels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27

    Other Tools to Configure and Monitor Devices Running Junos OS . . . . . . . . . . . . . 28Commands and Configuration Statements for Junos-FIPS . . . . . . . . . . . . . . . . . . 28

    Chapter 2 Getting Started: A Quick Tour of the CLI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31

    Getting Started with the Junos OS Command-Line Interface . . . . . . . . . . . . . . . . 31Switching Between Junos OS CLI Operational and Configuration Modes . . . . . . . 33Configuring a User Account on a Device Running Junos OS . . . . . . . . . . . . . . . . . . 34Using the CLI Editor in Configuration Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36Checking the Status of a Device Running Junos OS . . . . . . . . . . . . . . . . . . . . . . . . 38Configuring a Routing Protocol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40

    Shortcut . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41Longer Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41Making Changes to a Routing Protocol Configuration . . . . . . . . . . . . . . . . . . . 43

    Rolling Back Junos OS Configuration Changes . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46

    Chapter 3 Getting Online Help . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49

    Getting Online Help from the Junos OS Command-Line Interface . . . . . . . . . . . . 49Getting Help About Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49Getting Help About a String in a Statement or Command . . . . . . . . . . . . . . . 50Getting Help About Configuration Statements . . . . . . . . . . . . . . . . . . . . . . . . 51

    iiiCopyright 2014, Juniper Networks, Inc.

  • Getting Help About System Log Messages . . . . . . . . . . . . . . . . . . . . . . . . . . . 51Junos OS CLI Online Help Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52

    Help for Omitted Statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52Using CLI Command Completion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52Using Command Completion in Configuration Mode . . . . . . . . . . . . . . . . . . . 53Displaying Tips About CLI Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53

    Examples: Using Command Completion in Configuration Mode . . . . . . . . . . . . . . 53Examples: Using the Junos OS CLI Command Completion . . . . . . . . . . . . . . . . . . 55Displaying the Junos OS CLI Command and Word History . . . . . . . . . . . . . . . . . . 56

    Chapter 4 Using Configuration Statements to Configure a Device . . . . . . . . . . . . . . . . . 57

    Understanding Junos OS CLI Configuration Mode . . . . . . . . . . . . . . . . . . . . . . . . . 58Configuration Mode Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59Configuration Statements and Identifiers . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60Configuration Statement Hierarchy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62

    Entering and Exiting the Junos OS CLI Configuration Mode . . . . . . . . . . . . . . . . . . 64Forms of the configure Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66Using the configure exclusive Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67Using the configure Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68Modifying the Junos OS Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69Adding Junos OS Configuration Statements and Identifiers . . . . . . . . . . . . . . . . . 70Deleting a Statement from a Junos OS Configuration . . . . . . . . . . . . . . . . . . . . . . . 71Example: Deleting a Statement from the Junos OS Configuration . . . . . . . . . . . . 72Copying a Junos OS Statement in the Configuration . . . . . . . . . . . . . . . . . . . . . . . 73Example: Copying a Statement in the Junos Configuration . . . . . . . . . . . . . . . . . . 74Issuing Relative Junos OS Configuration Mode Commands . . . . . . . . . . . . . . . . . . 76Renaming an Identifier in a Junos OS Configuration . . . . . . . . . . . . . . . . . . . . . . . . 77Example: Re-Using a Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77Inserting a New Identifier in a Junos OS Configuration . . . . . . . . . . . . . . . . . . . . . . 81Example: Inserting a New Identifier in a Junos Configuration . . . . . . . . . . . . . . . . . 81Example: Using the Wildcard Command with the Range Option . . . . . . . . . . . . . 83Deactivating and Reactivating Statements and Identifiers in a Junos OS

    Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87Example: Deactivating and Reactivating Statements and Identifiers in a Junos

    OS Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88Adding Comments in a Junos OS Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . 90

    Adding Comments in the CLI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90Adding Comments in a File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91

    Example: Including Comments in a Junos OS Configuration by Using the CLI . . . 92Updating the configure private Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94Displaying the Current Junos OS Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . 95Example: Displaying the Current Junos OS Configuration . . . . . . . . . . . . . . . . . . . 96Displaying Additional Information About the Junos OS Con