Junos OS CLI User Guide - Juniper Networks - Network ... Show command-line interface settings •

  • View
    231

  • Download
    7

Embed Size (px)

Text of Junos OS CLI User Guide - Juniper Networks - Network ... Show command-line interface settings •

  • JunosOS

    CLI User Guide

    Modified: 2018-03-19

    Copyright 2018, Juniper Networks, Inc.

  • Juniper Networks, Inc.1133 InnovationWaySunnyvale, California 94089USA408-745-2000www.juniper.net

    Juniper Networks, the Juniper Networks logo, Juniper, and Junos are registered trademarks of Juniper Networks, Inc. and/or its affiliates inthe United States and other countries. All other trademarks may be 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 Guide

    Copyright 2018 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 athttps://www.juniper.net/support/eula/. By downloading, installing or using such software, you agree to the terms and conditions of thatEULA.

    Copyright 2018, Juniper Networks, Inc.ii

    https://www.juniper.net/support/eula/

  • Table of Contents

    About the Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xvii

    Documentation and Release Notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xvii

    Supported Platforms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xvii

    Using the Examples in This Manual . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xvii

    Merging a Full Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xviii

    Merging a Snippet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xviii

    Documentation Conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xix

    Documentation Feedback . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxi

    Requesting Technical Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxi

    Self-Help Online Tools and Resources . . . . . . . . . . . . . . . . . . . . . . . . . . . xxi

    Opening a Case with JTAC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxii

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

    Introducing the Junos OS Command-Line Interface . . . . . . . . . . . . . . . . . . . . . . . . 23

    Key Features of the CLI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24

    Understanding the Junos OS CLI Modes, Commands, and Statement

    Hierarchies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25

    Junos OS CLI Command Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25

    CLI Command Hierarchy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26

    Configuration Statement Hierarchy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26

    Moving Among Hierarchy Levels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27

    Overview of Navigating the CLI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28

    CLI Command Hierarchy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28

    CLI Configuration Statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28

    Moving Among Hierarchy Levels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29

    Other Tools to Configure and Monitor Devices Running Junos OS . . . . . . . . . . . . . 29

    Commands and Configuration Statements for Junos-FIPS . . . . . . . . . . . . . . . . . . 30

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

    Getting Started with the Junos OS Command-Line Interface . . . . . . . . . . . . . . . . 31

    Switching Between Junos OS CLI Operational and Configuration Modes . . . . . . . 33

    Configuring a User Account on a Device Running Junos OS . . . . . . . . . . . . . . . . . . 35

    Using the CLI Editor in Configuration Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37

    Checking the Status of a Device Running Junos OS . . . . . . . . . . . . . . . . . . . . . . . . 38

    Understanding Character Encoding on Devices Running Junos OS . . . . . . . . . . . . 41

    Example: Configuring a Routing Protocol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42

    Shortcut . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42

    Longer Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43

    Making Changes to a Routing Protocol Configuration . . . . . . . . . . . . . . . . . . . 45

    Rolling Back Junos OS Configuration Changes . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48

    iiiCopyright 2018, Juniper Networks, Inc.

  • Chapter 3 Getting Online Help . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51

    Getting Online Help from the Junos OS Command-Line Interface . . . . . . . . . . . . . 51

    Getting Help About Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51

    Getting Help About a String in a Statement or Command . . . . . . . . . . . . . . . 52

    Getting Help About Configuration Statements . . . . . . . . . . . . . . . . . . . . . . . . 53

    Getting Help About System Log Messages . . . . . . . . . . . . . . . . . . . . . . . . . . . 53

    Junos OS CLI Online Help Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54

    Help for Omitted Statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54

    Using CLI Command Completion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54

    Using Command Completion in Configuration Mode . . . . . . . . . . . . . . . . . . . 55

    Displaying Tips About CLI Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55

    CLI Explorer Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56

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

    Understanding Junos OS CLI Configuration Mode . . . . . . . . . . . . . . . . . . . . . . . . . 58

    Configuration Mode Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59

    Configuration Statements and Identifiers . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60

    Configuration Statement Hierarchy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62

    Entering and Exiting the Junos OS CLI Configuration Mode . . . . . . . . . . . . . . . . . . 64

    Notational Conventions Used in Junos OS Configuration Hierarchies . . . . . . . . . . 66

    Forms of the configure Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67

    Using the configure Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69

    Using the configure exclusive Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70

    Modifying the Junos OS Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71

    Adding Junos OS Configuration Statements and Identifiers . . . . . . . . . . . . . . . . . . 72

    Deleting a Statement from a Junos OS Configuration . . . . . . . . . . . . . . . . . . . . . . 73

    Example: Deleting a Statement from the Junos OS Configuration . . . . . . . . . . . . 74

    Copying a Junos OS Statement in the Configuration . . . . . . . . . . . . . . . . . . . . . . . 76

    Example: Copying a Statement in the Junos Configuration . . . . . . . . . . . . . . . . . . 76

    Issuing Relative Junos OS Configuration Mode Commands . . . . . . . . . . . . . . . . . . 78

    Examples: Re-Using Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79

    Inserting a New Identifier in a Junos OS Configuration . . . . . . . . . . . . . . . . . . . . . . 84

    Renaming an Identifier in a Junos OS Configuration . . . . . . . . . . . . . . . . . . . . . . . 85

    Example: Inserting a New Identifier in a Junos Configuration . . . . . . . . . . . . . . . . 85

    Example: Using the Wildcard Command with the Range Option . . . . . . . . . . . . . 88

    Deactivating and Reactivating Statements and Identifiers in a Junos OS

    Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93

    Example: Deactivating and Reactivating Statements and Identifiers in a Junos

    OS Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93

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