ar1200 - basic configuration

Upload: lroqcor

Post on 11-Oct-2015

42 views

Category:

Documents


1 download

TRANSCRIPT

  • 5/20/2018 AR1200 - Basic Configuration

    1/235

    Huawei AR1200-S Series Enterprise Routers

    V200R002C00

    Configuration Guide - Basic

    Configuration

    Issue 02

    Date 2012-03-30

    HUAWEI TECHNOLOGIES CO., LTD.

  • 5/20/2018 AR1200 - Basic Configuration

    2/235

    Copyright Huawei Technologies Co., Ltd. 2012. All rights reserved.

    No part of this document may be reproduced or transmitted in any form or by any means without prior written

    consent of Huawei Technologies Co., Ltd.

    Trademarks and Permissions

    and other Huawei trademarks are trademarks of Huawei Technologies Co., Ltd.

    All other trademarks and trade names mentioned in this document are the property of their respective holders.

    Notice

    The purchased products, services and features are stipulated by the contract made between Huawei and the

    customer. All or part of the products, services and features described in this document may not be within the

    purchase scope or the usage scope. Unless otherwise specified in the contract, all statements, information,and recommendations in this document are provided "AS IS" without warranties, guarantees or representations

    of any kind, either express or implied.

    The information in this document is subject to change without notice. Every effort has been made in the

    preparation of this document to ensure accuracy of the contents, but all statements, information, and

    recommendations in this document do not constitute the warranty of any kind, express or implied.

    Huawei Technologies Co., Ltd.

    Address: Huawei Industrial Base

    Bantian, Longgang

    Shenzhen 518129

    People's Republic of China

    Website: http://www.huawei.com

    Email: [email protected]

    Issue 02 (2012-03-30) Huawei Proprietary and Confidential

    Copyright Huawei Technologies Co., Ltd.

    i

    http://www.huawei.com/
  • 5/20/2018 AR1200 - Basic Configuration

    3/235

    About This Document

    Intended Audience

    This document provides the basic concepts, configuration procedures, and configuration

    examples in different application scenarios of the Basic configuration supported by the AR1200-

    S device.

    This document describes how to configure the Basic configuration.

    This document is intended for:

    l Data configuration engineers

    l Commissioning engineers

    l Network monitoring engineers

    l System maintenance engineers

    Symbol Conventions

    The symbols that may be found in this document are defined as follows.

    Symbol Description

    DANGER

    Indicates a hazard with a high level of risk, which if not

    avoided, will result in death or serious injury.

    WARNING

    Indicates a hazard with a medium or low level of risk, whichif not avoided, could result in minor or moderate injury.

    CAUTION

    Indicates a potentially hazardous situation, which if not

    avoided, could result in equipment damage, data loss,

    performance degradation, or unexpected results.

    TIP Indicates a tip that may help you solve a problem or save

    time.

    NOTE Provides additional information to emphasize or supplement

    important points of the main text.

    Huawei AR1200-S Series Enterprise Routers

    Configuration Guide - Basic Configuration About This Document

    Issue 02 (2012-03-30) Huawei Proprietary and Confidential

    Copyright Huawei Technologies Co., Ltd.

    ii

  • 5/20/2018 AR1200 - Basic Configuration

    4/235

    Command Conventions

    The command conventions that may be found in this document are defined as follows.

    Convention Description

    Boldface The keywords of a command line are in boldface.

    Italic Command arguments are in italics.

    [ ] Items (keywords or arguments) in brackets [ ] are optional.

    { x | y | ... } Optional items are grouped in braces and separated by vertical

    bars. One item is selected.

    [ x | y | ... ] Optional items are grouped in brackets and separated by vertical

    bars. One item is selected or no item is selected.

    { x | y | ... }* Optional items are grouped in braces and separated by verticalbars. A minimum of one item or a maximum of all items can be

    selected.

    [ x | y | ... ]* Optional items are grouped in brackets and separated by vertical

    bars. Several items or no item can be selected.

    & The parameter before the & sign can be repeated 1 to n times.

    # A line starting with the # sign is comments.

    Interface Numbering Conventions

    Interface numbers used in this manual are examples. In device configuration, use the existing

    interface numbers on devices.

    Change History

    Changes between document issues are cumulative. Therefore, the latest document version

    contains all updates made to previous versions.

    Changes in Issue 02 (2012-03-30)

    Based on issue 01 (2011-12-30), the document is updated as follows:

    The following information is modified:

    l 1.2.3 Logging In to the Device

    l 1.3.3 Logging In to the router

    Changes in Issue 01 (2011-12-30)

    Initial commercial release.

    Huawei AR1200-S Series Enterprise Routers

    Configuration Guide - Basic Configuration About This Document

    Issue 02 (2012-03-30) Huawei Proprietary and Confidential

    Copyright Huawei Technologies Co., Ltd.

    iii

  • 5/20/2018 AR1200 - Basic Configuration

    5/235

    Contents

    About This Document.....................................................................................................................ii

    1 Logging In to theSystem for the First Time............................................................................1

    1.1 Introduction........................................................................................................................................................2

    1.2 Logging In tothe Device Through the Console Port..........................................................................................21.2.1 Establishing the Configuration Task.........................................................................................................2

    1.2.2 Establishing the Physical Connection........................................................................................................3

    1.2.3 LoggingIn to the Device...........................................................................................................................3

    1.3 Logging In to the router Through a Mini USB Port...........................................................................................5

    1.3.1 Establishing the Configuration Task.........................................................................................................6

    1.3.2 Installing the router Driver........................................................................................................................6

    1.3.3 LoggingIn to the router...........................................................................................................................10

    2 CLI Overview...............................................................................................................................13

    2.1 CLI Introduction...............................................................................................................................................142.1.1 Command Line Interface.........................................................................................................................14

    2.1.2 Command Levels.....................................................................................................................................14

    2.1.3 Command Line Views.............................................................................................................................17

    2.2 Online Help.......................................................................................................................................................18

    2.2.1 Full Help..................................................................................................................................................18

    2.2.2 Partial Help..............................................................................................................................................19

    2.2.3 Error Messages of the Command Line Interface.....................................................................................19

    2.3 CLI Features.....................................................................................................................................................20

    2.3.1 Editing.....................................................................................................................................................202.3.2 Displaying................................................................................................................................................21

    2.3.3 Regular Expressions................................................................................................................................21

    2.3.4 Previously-Used Commands...................................................................................................................24

    2.4 Shortcut Keys...................................................................................................................................................25

    2.4.1 Classifying Shortcut Keys.......................................................................................................................25

    2.4.2 Defining Shortcut Keys...........................................................................................................................26

    2.4.3 Use of Shortcut Keys...............................................................................................................................27

    2.5 Configuration Examples...................................................................................................................................27

    2.5.1 Example for Using Tab............................................................................................................................27

    2.5.2 Example for Using Shortcut Keys...........................................................................................................29

    Huawei AR1200-S Series Enterprise Routers

    Configuration Guide - Basic Configuration Contents

    Issue 02 (2012-03-30) Huawei Proprietary and Confidential

    Copyright Huawei Technologies Co., Ltd.

    iv

  • 5/20/2018 AR1200 - Basic Configuration

    6/235

    3 Basic Configuration.....................................................................................................................30

    3.1 Configuring the Basic System Environment....................................................................................................31

    3.1.1 Establishing the Configuration Task.......................................................................................................31

    3.1.2 Configuring the Equipment Name...........................................................................................................31

    3.1.3 Setting the System Clock.........................................................................................................................32

    3.1.4 Configuring a Header..............................................................................................................................38

    3.1.5 Configuring Command Levels................................................................................................................39

    3.1.6 Configuring the undo Command to Automatically Match the Higher-Level View................................39

    3.2 Displaying System Status Messages.................................................................................................................40

    3.2.1 Displaying System Configuration...........................................................................................................40

    3.2.2 Displaying System Status........................................................................................................................41

    3.2.3 Collecting System Diagnostic Information.............................................................................................41

    4 Configuring User Interfaces......................................................................................................42

    4.1 User InterfaceOverview...................................................................................................................................43

    4.2 Configuring the Console User Interface...........................................................................................................45

    4.2.1 Establishing the Configuration Task.......................................................................................................45

    4.2.2 Setting Physical Attributes of the Console User Interface......................................................................45

    4.2.3 Setting Terminal Attributes of the Console User Interface.....................................................................47

    4.2.4 Configuring User Privilege of the Console User Interface......................................................................48

    4.2.5 Configuring the User Authentication Mode of the Console User Interface............................................48

    4.2.6 Checking the Configuration.....................................................................................................................50

    4.3 Configuring the VTY User Interface................................................................................................................51

    4.3.1 Establishing the Configuration Task.......................................................................................................51

    4.3.2 Configuring the Maximum Number of VTY User Interfaces.................................................................52

    4.3.3 (Optional) Setting Restrictions for Incoming and Outgoing Calls on VTY User Interfaces...................53

    4.3.4 Setting Terminal Attributes of the VTY User Interface..........................................................................54

    4.3.5 Setting User Priority of the VTY User Interface.....................................................................................55

    4.3.6 Setting the User Authentication Mode of the VTY User Interface.........................................................55

    4.3.7 Checking the Configuration.....................................................................................................................57

    4.4 Configuring aTTY User Interface...................................................................................................................58

    4.4.1 Establishing the Configuration Task.......................................................................................................58

    4.4.2 Setting Physical Attributes of a TTY User Interface...............................................................................594.4.3 Setting Terminal Attributes of a TTY User Interface..............................................................................60

    4.4.4 Configuring User Priority of a TTY User Interface................................................................................61

    4.4.5 Checking the Configuration.....................................................................................................................62

    4.5 Configuration Examples...................................................................................................................................63

    4.5.1 Example for Configuring Console User Interface...................................................................................63

    4.5.2 Examplefor Configuring a VTY User Interface.....................................................................................64

    4.5.3 Example for Configuring a TTY User Interface......................................................................................66

    5 Configuring User Login.............................................................................................................68

    5.1 Overview of User Login...................................................................................................................................69

    5.2 Logging in to the Devices Through the Console Port......................................................................................71

    Huawei AR1200-S Series Enterprise Routers

    Configuration Guide - Basic Configuration Contents

    Issue 02 (2012-03-30) Huawei Proprietary and Confidential

    Copyright Huawei Technologies Co., Ltd.

    v

  • 5/20/2018 AR1200 - Basic Configuration

    7/235

    5.2.1 Establishing the Configuration Task.......................................................................................................71

    5.2.2 Logging In to the Device Using a Console Port......................................................................................72

    5.2.3 (Optional) Configuring the Console User Interface................................................................................74

    5.2.4 Checking the Configuration.....................................................................................................................75

    5.3 Logging in to Devices Using Telnet.................................................................................................................76

    5.3.1 Establishing the Configuration Task.......................................................................................................76

    5.3.2 Configuring the User Access Level and User Authentication Mode of the VTY User Interface...........77

    5.3.3 Enabling the Telnet Service.....................................................................................................................79

    5.3.4 Loggingin to the Device Using Telnet...................................................................................................80

    5.3.5 Checking the Configuration.....................................................................................................................81

    5.4 Logging in to Devices Using STelnet...............................................................................................................82

    5.4.1 Establishing the Configuration Task.......................................................................................................82

    5.4.2 Configuring the User Access Level and User Authentication Mode of the VTY User Interface...........83

    5.4.3 Configuring SSH for the VTY User Interface.........................................................................................86

    5.4.4 Configuring an SSH User and Specifying STelnet as One of Service Types.........................................86

    5.4.5 Enabling the STelnet Server Function.....................................................................................................89

    5.4.6 Loggingin to the Device Using STelnet.................................................................................................89

    5.4.7 Checking the Configuration.....................................................................................................................90

    5.5 Common Operations After Login.....................................................................................................................91

    5.5.1 Establishing the Configuration Task.......................................................................................................91

    5.5.2 Switching User Levels.............................................................................................................................92

    5.5.3 Locking User Interfaces...........................................................................................................................93

    5.5.4 Sending Messages to Other User Interfaces............................................................................................935.5.5 Displaying Login Users...........................................................................................................................94

    5.6 Configuration Examples...................................................................................................................................94

    5.6.1 Example for Configuring User Login Using a Console Port...................................................................94

    5.6.2 Example for Logging In by Telnet..........................................................................................................97

    5.6.3 Example for Configuring User Login by Using STelnet.........................................................................98

    6 Managing theFile System.......................................................................................................101

    6.1 File System Overview....................................................................................................................................102

    6.1.1 File System............................................................................................................................................102

    6.1.2 Methodsof File Management................................................................................................................1026.2 Managing Files Using the File System...........................................................................................................103

    6.2.1 Establishing the Configuration Task.....................................................................................................103

    6.2.2 Managing Storage Devices....................................................................................................................104

    6.2.3 Managing Directories............................................................................................................................105

    6.2.4 Managing Files......................................................................................................................................105

    6.3 Managing Files Using FTP.............................................................................................................................108

    6.3.1 Establishing the Configuration Task.....................................................................................................108

    6.3.2 Configuring a Local FTP User..............................................................................................................108

    6.3.3 (Optional) Specifying a Port Number for the FTP Server.....................................................................109

    6.3.4 Enabling the FTP Server........................................................................................................................110

    Huawei AR1200-S Series Enterprise Routers

    Configuration Guide - Basic Configuration Contents

    Issue 02 (2012-03-30) Huawei Proprietary and Confidential

    Copyright Huawei Technologies Co., Ltd.

    vi

  • 5/20/2018 AR1200 - Basic Configuration

    8/235

    6.3.5 (Optional) Configuring the FTP Server Parameters..............................................................................110

    6.3.6 (Optional) Configuring an FTP ACL....................................................................................................111

    6.3.7 Accessing the System by Using FTP.....................................................................................................112

    6.3.8 Managing Files Using FTP Commands.................................................................................................113

    6.3.9 Checking the Configuration...................................................................................................................115

    6.4 ManagingFiles Using SFTP...........................................................................................................................115

    6.4.1 Establishing the Configuration Task.....................................................................................................116

    6.4.2 Configuring VTY User Interface...........................................................................................................116

    6.4.3 Configuring SSH for the VTY User Interface.......................................................................................117

    6.4.4 Configuring an SSH User and Specifying SFTP as One of Service Types...........................................117

    6.4.5 Enabling the SFTP Service....................................................................................................................120

    6.4.6 Accessing the System Using SFTP.......................................................................................................120

    6.4.7 Managing Files Using SFTP..................................................................................................................122

    6.4.8 Checking the Configuration...................................................................................................................123

    6.5 Configuration Examples.................................................................................................................................124

    6.5.1 Example for Managing Files Using the File System.............................................................................124

    6.5.2 Example for Performing File Operations by Means of FTP.................................................................125

    6.5.3 Example for Performing File Operations by Means of SFTP...............................................................128

    7 Configuring System Startup....................................................................................................131

    7.1 System Startup Overview...............................................................................................................................132

    7.1.1 System Software....................................................................................................................................132

    7.1.2 Configuration Files and Current Configurations...................................................................................132

    7.2 Managing Configuration Files........................................................................................................................132

    7.2.1 Establishing the Configuration Task.....................................................................................................133

    7.2.2 Saving Configuration Files....................................................................................................................133

    7.2.3 Clearinga Configuration File................................................................................................................134

    7.2.4 Comparing Configuration Files.............................................................................................................135

    7.2.5 Checking the Configuration...................................................................................................................135

    7.3 Specifying a File for System Startup..............................................................................................................136

    7.3.1 Establishing the Configuration Task.....................................................................................................136

    7.3.2 Configuring System Software for a router to Load for the Next Startup..............................................137

    7.3.3 Configuring the Configuration File for Router to Load at the Next Startup.........................................137

    7.3.4 Checking the Configuration...................................................................................................................138

    7.4 Configuration Examples.................................................................................................................................138

    7.4.1 Example for Configuring System Startup.............................................................................................138

    8 Accessing Another Device.......................................................................................................141

    8.1 Accessing Another Device.............................................................................................................................142

    8.1.1 Telnet Method........................................................................................................................................142

    8.1.2 FTP Method...........................................................................................................................................144

    8.1.3 TFTP Method........................................................................................................................................144

    8.1.4 SSH Method..........................................................................................................................................145

    8.2 Logging in to Other Devices Using Telnet.....................................................................................................146

    Huawei AR1200-S Series Enterprise Routers

    Configuration Guide - Basic Configuration Contents

    Issue 02 (2012-03-30) Huawei Proprietary and Confidential

    Copyright Huawei Technologies Co., Ltd.

    vii

  • 5/20/2018 AR1200 - Basic Configuration

    9/235

    8.2.1 Establishing the Configuration Task.....................................................................................................146

    8.2.2 (Optional) Configuring a Source IP Address for a Telnet Client..........................................................147

    8.2.3 Logging in to Another Device by Using Telnet....................................................................................147

    8.2.4 Checking the Configuration...................................................................................................................148

    8.3 Using the Redirection Function to Connect to a Remote Device...................................................................148

    8.3.1 Establishing the Configuration Task.....................................................................................................148

    8.3.2 Configuring the Redirection Function...................................................................................................151

    8.3.3 Checking the Configuration...................................................................................................................152

    8.4 Logging in to Another Device Using STelnet................................................................................................152

    8.4.1 Establishing the Configuration Task.....................................................................................................152

    8.4.2 Configuring the First Successful Login to Another Device (Enabling the First-Time Authentication on

    the SSH Client)...............................................................................................................................................153

    8.4.3 Configuring the First Successful Login to Another Device (Allocating an Public Key to the SSH Server)

    ........................................................................................................................................................................1548.4.4 Loggingin to Another Device by Using STelnet..................................................................................155

    8.4.5 Checking the Configuration...................................................................................................................156

    8.5 AccessingFiles on Another Device Using TFTP...........................................................................................156

    8.5.1 Establishing the Configuration Task.....................................................................................................156

    8.5.2 (Optional) Configuring a Source IP Address for a TFTP Client...........................................................157

    8.5.3 (Optional) Configuring TFTP Access Authority...................................................................................158

    8.5.4 Downloading Files Using TFTP............................................................................................................159

    8.5.5 Uploading Files Using TFTP.................................................................................................................159

    8.5.6 Checking the Configuration...................................................................................................................159

    8.6 Accessing Files on Another Device Using FTP.............................................................................................160

    8.6.1 Establishing the Configuration Task................................................................................... ..................160

    8.6.2 (Optional) Configuring the Source IP Address and Interface of the FTP Client...................................161

    8.6.3 Connecting to Other Devices by Using FTP Commands......................................................................161

    8.6.4 Managing Files Using FTP Commands.................................................................................................162

    8.6.5 Changing Login Users...........................................................................................................................164

    8.6.6 Disconnecting from the FTP Server......................................................................................................165

    8.6.7 Checking the Configuration...................................................................................................................165

    8.7 AccessingFiles on Another Device Using SFTP...........................................................................................166

    8.7.1 Establishing the Configuration Task.....................................................................................................166

    8.7.2 (Optional) Configuring a Source IP Address for an SFTP Client.........................................................167

    8.7.3 Configuring the First Successful Login to Another Device (Enabling the First-Time Authentication on

    the SSH Client)...............................................................................................................................................167

    8.7.4 Configuring the First Successful Login to Another Device (Allocating an Public Key to the SSH Server)

    ........................................................................................................................................................................168

    8.7.5 Connecting to Other Devices by Using SFTP.......................................................................................169

    8.7.6 Managing Files Using SFTP Commands..............................................................................................170

    8.7.7 Checking the Configuration...................................................................................................................171

    8.8 ConfigurationExamples.................................................................................................................................172

    8.8.1 Examplefor Configuring Telnet Services.............................................................................................172

    Huawei AR1200-S Series Enterprise Routers

    Configuration Guide - Basic Configuration Contents

    Issue 02 (2012-03-30) Huawei Proprietary and Confidential

    Copyright Huawei Technologies Co., Ltd.

    viii

  • 5/20/2018 AR1200 - Basic Configuration

    10/235

    8.8.2 Example for Configuring the Device as the STelnet Client to Connect to the SSH Server..................174

    8.8.3 Example for Configuring the Redirection Function for Remote Device Management.........................179

    8.8.4 Example for Configuring TFTP............................................................................................................181

    8.8.5 Example for Connecting the SFTP Client to the SSH Server...............................................................183

    8.8.6 Example for Authenticating SSH Through RADIUS............................................................................187

    9 Upgrade and Maintenance.......................................................................................................193

    9.1 Upgrade and Maintenance Overview.............................................................................................................194

    9.1.1 License Authorization............................................................................................................................194

    9.1.2 Software Upgrade..................................................................................................................................194

    9.1.3 Patch Management................................................................................................................................194

    9.1.4 CPU and Memory Usage Thresholds....................................................................................................195

    9.1.5 Device Restart........................................................................................................................................195

    9.2 Activating a GTL License File.......................................................................................................................195

    9.2.1 Establishing the Configuration Task.....................................................................................................195

    9.2.2 Uploading a GTL License File..............................................................................................................197

    9.2.3 Activating the GTL License File...........................................................................................................197

    9.2.4 (Optional) Enabling the Emergency State of the GTL License Module...............................................198

    9.2.5 Checking the Configuration...................................................................................................................198

    9.3 Upgrading System Software...........................................................................................................................199

    9.3.1 Establishing the Configuration Task.....................................................................................................199

    9.3.2 Checking the System Before the Upgrade.............................................................................................200

    9.3.3 Downloading a System File...................................................................................................................201

    9.3.4 Specifying the System Software to Be Used at the Next Startup..........................................................207

    9.3.5 Configuring a Backup Startup File........................................................................................................207

    9.3.6 (Optional) Upgrading the BootROM of the LPU..................................................................................208

    9.3.7 Restarting a Device................................................................................................................................208

    9.3.8 Checking the Configuration...................................................................................................................209

    9.4 Managing Patches...........................................................................................................................................210

    9.4.1 Establishing the Configuration Task.....................................................................................................210

    9.4.2 Installing a Patch...................................................................................................................................210

    9.4.3 Specifying a Patch File to Be Used at the Next Startup........................................................................211

    9.4.4 Uninstalling a Patch...............................................................................................................................2129.4.5 Checking the Configuration...................................................................................................................212

    9.5 Monitoring CPU and Memory Usage.............................................................................................................213

    9.5.1 Establishing the Configuration Task.....................................................................................................213

    9.5.2 Setting CPU Usage Thresholds.............................................................................................................213

    9.5.3 Setting aMemory Usage Threshold......................................................................................................214

    9.5.4 Checking the Configuration...................................................................................................................215

    9.6 Restarting theDevice......................................................................................................................................217

    9.6.1 Establishing the Configuration Task.....................................................................................................217

    9.6.2 Restarting the Device Immediately.......................................................................................................217

    9.6.3 Configuring the Device to Restart as Scheduled...................................................................................218

    Huawei AR1200-S Series Enterprise Routers

    Configuration Guide - Basic Configuration Contents

    Issue 02 (2012-03-30) Huawei Proprietary and Confidential

    Copyright Huawei Technologies Co., Ltd.

    ix

  • 5/20/2018 AR1200 - Basic Configuration

    11/235

    9.6.4 Checking the Configuration...................................................................................................................218

    9.7 Configuration Examples.................................................................................................................................219

    9.7.1 Example for Upgrading System Software.............................................................................................219

    9.7.2 Example for Installing a Patch File.......................................................................................................223

    Huawei AR1200-S Series Enterprise Routers

    Configuration Guide - Basic Configuration Contents

    Issue 02 (2012-03-30) Huawei Proprietary and Confidential

    Copyright Huawei Technologies Co., Ltd.

    x

  • 5/20/2018 AR1200 - Basic Configuration

    12/235

    1Logging In to the System for the First TimeAbout This Chapter

    You can log in to a new router through the console port, mini USB port to configure the

    router.

    1.1 Introduction

    You can configure a device that is powered on for the first time by logging in through the console

    port, mini USB port.

    1.2 Logging In to the Device Through the Console Port

    This section describes how to establish the configuration environment by using the console port

    to connect a terminal to a router.

    1.3 Logging In to the router Through a Mini USB Port

    This section describes how to connect a terminal to the router through a mini USB port.

    Huawei AR1200-S Series Enterprise Routers

    Configuration Guide - Basic Configuration 1 Logging In to the System for the First Time

    Issue 02 (2012-03-30) Huawei Proprietary and Confidential

    Copyright Huawei Technologies Co., Ltd.

    1

  • 5/20/2018 AR1200 - Basic Configuration

    13/235

    1.1 Introduction

    You can configure a device that is powered on for the first time by logging in through the console

    port, mini USB port.

    A main control board provides a console port , a mini USB port To configure a device, connect

    the user terminal serial port to the device console port or connect the user terminal USB port to

    the mini USB port of the device.

    NOTE

    l Before using the mini USB port to log in to a device, install the mini USB port driver on the user

    terminal.

    l The mini USB port and console port cannot be used together.

    1.2 Logging In to the Device Through the Console PortThis section describes how to establish the configuration environment by using the console port

    to connect a terminal to a router.

    1.2.1 Establishing the Configuration Task

    Before logging in to the router through the console port, familiarize yourself with the applicable

    environment, complete the pre-configuration tasks, and obtain any data required for the

    configuration. This will help you complete the configuration task quickly and correctly.

    Applicable Environment

    When the router is powered on for the first time, you could use the console port to log in to the

    router to configure and manage the router.

    Pre-configuration Tasks

    Before logging in to the router through the console port, complete the following tasks:

    l Installing terminal emulation program on the PC (for example, Windows XP

    HyperTerminal)

    l Preparing the console cable

    Data Preparation

    To log in to the router through the console port or mini USB port, you need the following data.

    Huawei AR1200-S Series Enterprise Routers

    Configuration Guide - Basic Configuration 1 Logging In to the System for the First Time

    Issue 02 (2012-03-30) Huawei Proprietary and Confidential

    Copyright Huawei Technologies Co., Ltd.

    2

  • 5/20/2018 AR1200 - Basic Configuration

    14/235

    No. Data

    1 Terminal communication parameters

    l Baud rate

    l Data bit

    l Parity

    l Stop bit

    l Flow-control mode

    NOTE

    The system automatically uses default parameter values for the first login.

    1.2.2 Establishing the Physical ConnectionYou can use a cable to connect the console port of the router to the COM port of a terminal.

    Procedure

    Step 1 Power on all devices to perform a self-check.

    Step 2 Use a cable to connect the console port of the router to the COM port of a PC.

    ----End

    1.2.3 Logging In to the DeviceTo manage a router that is powered on for the first time, you can log in to it using the console

    port.

    Context

    PC terminal attributes, including the transmission rate, data bit, parity bit, stop bit, and flow

    control mode must be configured to match those configured for the console port. Default values

    for terminal attributes are used during the first login to the device.

    Procedure

    Step 1 Start a terminal emulator on the PC and create a connection, as shown in Figure 1-1.

    Huawei AR1200-S Series Enterprise Routers

    Configuration Guide - Basic Configuration 1 Logging In to the System for the First Time

    Issue 02 (2012-03-30) Huawei Proprietary and Confidential

    Copyright Huawei Technologies Co., Ltd.

    3

  • 5/20/2018 AR1200 - Basic Configuration

    15/235

    Figure 1-1Connection creation

    Step 2 Set an interface, as shown in Figure 1-2.

    Figure 1-2Interface settings

    Step 3 Set communication parameters to match the router defaults, as shown in Figure 1-3.

    Huawei AR1200-S Series Enterprise Routers

    Configuration Guide - Basic Configuration 1 Logging In to the System for the First Time

    Issue 02 (2012-03-30) Huawei Proprietary and Confidential

    Copyright Huawei Technologies Co., Ltd.

    4

  • 5/20/2018 AR1200 - Basic Configuration

    16/235

    Figure 1-3Communication parameter settings

    Step 4 Press Enter. At the command-line prompt such as , enter a command to configurethe router or enter a question mark (?) if you need help.

    NOTE

    When you connect to the console port of a AR1200-S that does not have a startup configuration file, the

    system displays "Auto-Config is working. Before configuring the device, stop Auto-Config. If you perform

    configurations when Auto-Config is running, the DHCP, routing, DNS, and VTY configurations will be

    lost. Do you want to stop Auto-Config? [y/n]:"

    l To continue Auto-Config, enter nand press Enter.

    l To stop Auto-Config, choose yand press Enter.

    CAUTION

    If you choose nbut still perform configurations through the console port, the DHCP, routing, DNS,

    and VTY configurations that you have performed will be lost.

    ----End

    1.3 Logging In to the router Through a Mini USB Port

    This section describes how to connect a terminal to the router through a mini USB port.

    Huawei AR1200-S Series Enterprise Routers

    Configuration Guide - Basic Configuration 1 Logging In to the System for the First Time

    Issue 02 (2012-03-30) Huawei Proprietary and Confidential

    Copyright Huawei Technologies Co., Ltd.

    5

  • 5/20/2018 AR1200 - Basic Configuration

    17/235

    1.3.1 Establishing the Configuration Task

    Before logging in to the router through a mini USB port, familiarize yourself with the applicable

    environment, complete the pre-configuration tasks, and obtain the data required for the

    configuration. This will help you complete the configuration task quickly and accurately.

    Applicable Environment

    When the router is powered off for the first time, log in to the router through a mini USB port

    to configure and manage the router.

    Pre-Configuration Tasks

    Before logging in to the router through a mini USB port, complete the following tasks:

    l Installing the terminal emulation program such as the HyperTerminal in the Windows XP

    operating system on the PCl Preparing mini USB cables

    Data Preparation

    To log in to the router through a mini USB port, you need the following data.

    No. Data

    1 Terminal communication parameters including the baud rate, data bit, parity bit, stop

    bit, and flow control mode

    1.3.2 Installing the router Driver

    This section describes how to install the router driver on a PC so that the PC can discover and

    identify the AR1200-S.

    Context

    The router driver supports only the Windows XP, Windows Vista, and Windows 7 operating

    systems.

    Procedure

    Step 1 Double-click the diver installation file on the PC and click Next, as shown in Figure 1-4.

    Huawei AR1200-S Series Enterprise Routers

    Configuration Guide - Basic Configuration 1 Logging In to the System for the First Time

    Issue 02 (2012-03-30) Huawei Proprietary and Confidential

    Copyright Huawei Technologies Co., Ltd.

    6

  • 5/20/2018 AR1200 - Basic Configuration

    18/235

    Figure 1-4Running a driver on the PC

    Step 2 Select I accept the terms in the license agreementand click Next, as shown in Figure 1-5.

    Huawei AR1200-S Series Enterprise Routers

    Configuration Guide - Basic Configuration 1 Logging In to the System for the First Time

    Issue 02 (2012-03-30) Huawei Proprietary and Confidential

    Copyright Huawei Technologies Co., Ltd.

    7

  • 5/20/2018 AR1200 - Basic Configuration

    19/235

    Figure 1-5Accepting the terms in the license agreement

    Step 3 Click Changeto change the driver directory, and click Next, as shown in Figure 1-6.

    Huawei AR1200-S Series Enterprise Routers

    Configuration Guide - Basic Configuration 1 Logging In to the System for the First Time

    Issue 02 (2012-03-30) Huawei Proprietary and Confidential

    Copyright Huawei Technologies Co., Ltd.

    8

  • 5/20/2018 AR1200 - Basic Configuration

    20/235

    Figure 1-6Specifying the driver directory

    Step 4 Click Installand decompress the driver. When the system finishes decompressing the driver,click Finish, as shown in Figure 1-7.

    Huawei AR1200-S Series Enterprise Routers

    Configuration Guide - Basic Configuration 1 Logging In to the System for the First Time

    Issue 02 (2012-03-30) Huawei Proprietary and Confidential

    Copyright Huawei Technologies Co., Ltd.

    9

  • 5/20/2018 AR1200 - Basic Configuration

    21/235

    Figure 1-7Finishing decompressing the driver

    Step 5 Find the DISK1 folder in the specified driver directory, and double-click setup.exe.

    Step 6 Click Next. Select I accept the terms in the license agreementand click Nextto install thedriver.

    Step 7 Click Finishto finish installing the driver.

    Step 8 Right-click My Computer, and choose Manage-> Device Manager-> Ports(COM&LPT).The TUSB3410 Device (COM3) is displayed, indicating an router.

    NOTE

    If there is no TUSB3410 device (COM3) in the device manager, reinstall the driver or use another mini

    USB cable to connect the AR1200-S to the PC.

    ----End

    1.3.3 Logging In to the router

    You can log in to the router from a PC through a mini USB port to configure and manage the

    router that is powered on for the first time.

    Procedure

    Step 1 Run the terminal emulation program such as the HyperTerminal of Windows XP on the PC and

    establish a connection, as shown in Figure 1-8.

    Huawei AR1200-S Series Enterprise Routers

    Configuration Guide - Basic Configuration 1 Logging In to the System for the First Time

    Issue 02 (2012-03-30) Huawei Proprietary and Confidential

    Copyright Huawei Technologies Co., Ltd.

    10

  • 5/20/2018 AR1200 - Basic Configuration

    22/235

    Figure 1-8Establishing a connection

    Step 2 Specify a connection port. If the connection port is a mini USB port, select COM3, as shownin Figure 1-9.

    Figure 1-9Configuring the connection port

    Step 3 Set parameters for the connection port. Click RestoreDefaultsto restore parameters to defaultsettings, as shown in Figure 1-10.

    Huawei AR1200-S Series Enterprise Routers

    Configuration Guide - Basic Configuration 1 Logging In to the System for the First Time

    Issue 02 (2012-03-30) Huawei Proprietary and Confidential

    Copyright Huawei Technologies Co., Ltd.

    11

  • 5/20/2018 AR1200 - Basic Configuration

    23/235

    Figure 1-10Setting communication parameters

    Step 4 Press Enteron the subsequent dialog boxes until the command line prompt of the user view,such as , is displayed.

    You can run commands to configure the AR1200-S. Enter a question mark (?) whenever you

    need help.

    NOTE

    When you connect to the console port of a AR1200-S that does not have a startup configuration file, the

    system displays "Auto-Config is working. Before configuring the device, stop Auto-Config. If you perform

    configurations when Auto-Config is running, the DHCP, routing, DNS, and VTY configurations will be

    lost. Do you want to stop Auto-Config? [y/n]:"

    l To continue Auto-Config, enter nand press Enter.

    l To stop Auto-Config, choose yand press Enter.

    CAUTION

    If you choose nbut still perform configurations through the console port, the DHCP, routing, DNS,

    and VTY configurations that you have performed will be lost.

    ----End

    Huawei AR1200-S Series Enterprise Routers

    Configuration Guide - Basic Configuration 1 Logging In to the System for the First Time

    Issue 02 (2012-03-30) Huawei Proprietary and Confidential

    Copyright Huawei Technologies Co., Ltd.

    12

  • 5/20/2018 AR1200 - Basic Configuration

    24/235

    2CLI OverviewAbout This Chapter

    The command line interface (CLI) is used to configure and maintain devices.

    2.1 CLI Introduction

    After you log in to the router, a prompt is displayed and you can use the command line interface

    (CLI). Users can interact with the router through the CLI.

    2.2 Online Help

    When inputting command lines or configuring services, you can use the online help to obtain

    real-time help.

    2.3 CLI Features

    The CLI provides several features to help users flexibly use it.

    2.4 Shortcut Keys

    System or user-defined shortcut keys make it easier to enter commands.

    2.5 Configuration Examples

    This sectionprovides several examples that illustrate the use of command lines.

    Huawei AR1200-S Series Enterprise Routers

    Configuration Guide - Basic Configuration 2 CLI Overview

    Issue 02 (2012-03-30) Huawei Proprietary and Confidential

    Copyright Huawei Technologies Co., Ltd.

    13

  • 5/20/2018 AR1200 - Basic Configuration

    25/235

    2.1 CLI Introduction

    After you log in to the router, a prompt is displayed and you can use the command line interface(CLI). Users can interact with the router through the CLI.

    2.1.1 Command Line Interface

    You can use CLI commands to configure and manage the router.

    The CLI provides users access to a number of features and capabilities:

    l Local configuration through the console port.

    l Local or remote configuration through Telnet or Secure Shell (SSH).

    l The telnetcommand for directly logging in to and managing other routers.

    l FTP service for file uploads and downloads.

    l A user interface view for specific configuration management.

    l Hierarchical command protection structure giving certain levels of users permission to run

    certain levels of commands.

    l Three authentication modes are supported, namely, none-authentication, password

    authentication, and Authentication, Authorization, and Accounting (AAA) authentication.

    Password and AAA authentication protect system security by prohibiting unauthorized

    users from logging in to the router.

    l Entering "?" for online help at any time.

    l Entering "?" for online help at any time.

    l A command line interpreter provides intelligent text entry methods such as key word fuzzy

    match and context conjunction. These methods help users to enter commands easily and

    correctly.

    l Network test commands such as tracertand pingfor fast network diagnostics.

    l Abundant debugging information to with network diagnostics.

    l Running a command used previously on the device, like DosKey.

    NOTE

    l The system supports commands that contain a maximum of 512 characters. A command does not have

    to be entered in full, as long as the part of the command entered is unique within the system. Forexample, to use the display current-configurationcommand, entering d cu, di cu, or dis cuwill run

    the command. Entering d cor dis cwill not run the command, because these entries are not unique to

    the command.

    l The system saves the complete form of incomplete commands to configuration files. Saved commands

    may have more than 512 characters. When the system is restarted, incomplete commands cannot be

    restored. Therefore, pay attention to the full length of incomplete commands before saving them.

    2.1.2 Command Levels

    The system structures access to command functions hierarchically to protect system security.

    The system administrator sets user access levels that grant specific users access to specific

    command levels.

    Huawei AR1200-S Series Enterprise Routers

    Configuration Guide - Basic Configuration 2 CLI Overview

    Issue 02 (2012-03-30) Huawei Proprietary and Confidential

    Copyright Huawei Technologies Co., Ltd.

    14

  • 5/20/2018 AR1200 - Basic Configuration

    26/235

    By default, the command level of a user is a value ranging from 0 to 3, and the user access level

    is a value ranging from 0 to 15. Table 2-1lists the association between user access levels and

    command levels.

    Table 2-1Association between user access levels and command levels

    UserLevel

    CommandLevel

    LevelName

    Description

    0 0 Visit

    level

    This level gives access to commands that run network diagnostic

    tools (such as ping and tracert) and commands that start from a

    local device, visit external devices (such as Telnet client side ),

    and a part of display commands.

    1 0 and

    1

    Monitor

    inglevel

    This level gives access to commands, like the displaycommand,

    that are used for system maintenance and fault diagnosis.

    2 0, 1,

    and 2

    Configu

    ration

    level

    This level gives access to commands that configure network

    services provided directly to users, including routing and

    network layer commands.

    3-15 0, 1,

    2, and

    3

    Manage

    ment

    level

    This level gives access to commands that control basic system

    operations and provide support for services. These commands

    include file system commands, FTP commands, TFTP

    commands, configuration file switching commands, power

    supply control commands, backup board control commands,

    user management commands, level setting commands, systeminternal parameter setting commands, and debugging commands

    for fault diagnosis.

    NOTE

    l The default command level may be higher than the command level defined according to the command

    rules in application.

    l The level of the command that a user can run is determined by the level of this user.

    l Login users have 16 levels. The login users can use only the command of the levels that are equal to

    or lower than their own levels. The user privilegelevellevelcommand sets the user level.

    Searching Commands Based on Command Levels

    You can search for all commands at a specific level simultaneously. The procedure is as follows:

    1. Open the command reference (.chm.) file.

    2. Click the "Search" tab. The search window will be displayed as shown in Figure 2-1.

    Huawei AR1200-S Series Enterprise Routers

    Configuration Guide - Basic Configuration 2 CLI Overview

    Issue 02 (2012-03-30) Huawei Proprietary and Confidential

    Copyright Huawei Technologies Co., Ltd.

    15

  • 5/20/2018 AR1200 - Basic Configuration

    27/235

    Figure 2-1Entering the search window

    3. Enter the command level you want in the "Type in the word(s) to search for" textbox and

    click "List Topics". All commands of the specified level will be displayed as shown in

    Figure 2-2.

    Huawei AR1200-S Series Enterprise Routers

    Configuration Guide - Basic Configuration 2 CLI Overview

    Issue 02 (2012-03-30) Huawei Proprietary and Confidential

    Copyright Huawei Technologies Co., Ltd.

    16

  • 5/20/2018 AR1200 - Basic Configuration

    28/235

    Figure 2-2Searching commands based on a specific level

    2.1.3 Command Line Views

    The command line interface has different command views. Each command is registered to run

    in one or more command views. You can run a command only after you enter an appropriate

    command view.

    The following example uses the user, system, and aaa views:

    # Establish a connection to the router. If the router is using the default configurations, the

    prompt indicates that you have entered the user view.

    # Run the system-viewcommand to enter the system view.

    system-view[Huawei]

    # Run the aaacommand in the system view to enter the AAA view.

    [Huawei] aaa[Huawei-aaa]

    Huawei AR1200-S Series Enterprise Routers

    Configuration Guide - Basic Configuration 2 CLI Overview

    Issue 02 (2012-03-30) Huawei Proprietary and Confidential

    Copyright Huawei Technologies Co., Ltd.

    17

  • 5/20/2018 AR1200 - Basic Configuration

    29/235

    NOTE

    l The command prompt "Huawei" is the default host name.

    l The prompt indicates a specific view. For example, "Huawei" indicates the user view, and

    "[HUAWEI-ui-console0]" indicates the console user interface view.

    Some commands can be used in more than one view, but their effects vary from view to view.

    2.2 Online Help

    When inputting command lines or configuring services, you can use the online help to obtain

    real-time help.

    2.2.1 Full Help

    When inputting a command, you can use the full help function to obtain keywords or parameters

    for the command.

    Procedure

    l Use any of the following methods to obtain full help from a command line.

    Enter a question mark (?) in any command line view to display command names and

    their descriptions for all commands of that view.

    ?User view commands:

    arp-ping ARP-

    pingautosave autosave command

    group

    backup Backupinformation

    cd Change current

    directory

    clock Specify the systemclock

    cls Clear screen

    ...

    ...

    Enter a command and a question mark (?) separated by a space. All keywords associated

    with this command, as well as simple descriptions, are displayed. For example:

    [Huawei] interface ?Bridge-if Bridge-ifinterface

    Cellular Cellular interface

    ...

    ...

    Bridge-ifand Cellularare keywords; Bridge-if interfaceand Cellular interface

    describe the keywords respectively.

    Enter a command and a question mark (?) separated by a space. Parameter names for

    this command, as well as parameter descriptions, are displayed. For example:

    [Huawei] ftp timeout ? INTEGER The value of FTP timeout (in minutes)

    [Huawei] ftp timeout 35?[Huawei] ftp timeout 35

    In this command output, INTEGERdescribes the parameter value and Thevalue of FTP timeout, the default value is 30 minutesis a simple description of what

    Huawei AR1200-S Series Enterprise Routers

    Configuration Guide - Basic Configuration 2 CLI Overview

    Issue 02 (2012-03-30) Huawei Proprietary and Confidential

    Copyright Huawei Technologies Co., Ltd.

    18

  • 5/20/2018 AR1200 - Basic Configuration

    30/235

    the parameter sets. A display of indicates that no parameters are associated with

    this command. The command is repeated in the next command line. You can press

    Enterto run the command.

    ----End

    2.2.2 Partial Help

    If you enter only the first or first several characters of a command, partial help provides keywords

    that begin with this character or character string.

    Procedure

    l Use any of the following methods to obtain partial help from a command line.

    Enter a character string followed directly by a question mark (?) to display all commands

    that begin with this character string.

    d?debugging debugging commandgroup

    delete Delete a

    filedialer

    Dialer

    dir List files on a

    filesystemdisplay Display information

    Enter a command and a character string followed directly by a question mark (?) to

    display all key words that begin with this character string.

    display b? bfd Specify BFD(Bidirectional Forwarding

    Detection

    ) configurationinformation

    bgp BGP

    information

    bootp Bootstrap Protocolbridge bridge command group

    Enter the first several letters of a key word in the command and then press Tabto display

    a complete key word. A complete keyword is displayed only if the partial string of letters

    uniquely identifies a specific key word. If they do not identify a specific key work,

    continuing to press Tabwill display different key words. You can select the needed key

    word.

    ----End

    2.2.3 Error Messages of the Command Line Interface

    If a command is entered and passes the syntax check, the system executes it. Otherwise, the

    system reports an error message.

    Table 2-2lists common error messages.

    Huawei AR1200-S Series Enterprise Routers

    Configuration Guide - Basic Configuration 2 CLI Overview

    Issue 02 (2012-03-30) Huawei Proprietary and Confidential

    Copyright Huawei Technologies Co., Ltd.

    19

  • 5/20/2018 AR1200 - Basic Configuration

    31/235

    Table 2-2Common error messages of the command line

    Error messages Cause of the error

    Error: Unrecognized command

    found at '^' position.

    The command cannot be found

    The key word cannot be found

    Error: Wrong parameter found

    at '^' position.

    Parameter type error

    Parameter value out of range

    Error:Incomplete command

    found at '^' position.

    Incomplete command entered

    Error: Too many parameters

    found at "^" position.

    Too many parameters entered

    Error:Ambiguous command

    found at '^' position.

    Ambiguous parameters entered

    2.3 CLI Features

    The CLI provides several features to help users flexibly use it.

    2.3.1 Editing

    The command line editing function allows you to edit command lines or obtain help by using

    certain keys.

    The command line of AR1200-S supports multi-line edition. The maximum length of each

    command is 512 characters.

    Keys for editing that are often used are shown in Table 2-3.

    Table 2-3Keys for editing

    Key Function

    Common key Inserts a character at the current position of the cursor if the editingbuffer is not full. The cursor then moves to the right. If the buffer

    is full, an alarm is generated.

    Backspace Moves the cursor to the left and deletes the character at that

    position. When the cursor reaches the head of the command, an

    alarm is generated.

    Left cursor keyor

    Ctrl_B

    Moves the cursor to the left a single space at a time. When the

    cursor reaches the head of the command, an alarm is generated.

    Right cursor keyor

    Ctrl_F

    Moves the cursor to the right a single space at a time. When the

    cursor reaches the end of the command, an alarm is generated.

    Huawei AR1200-S Series Enterprise Routers

    Configuration Guide - Basic Configuration 2 CLI Overview

    Issue 02 (2012-03-30) Huawei Proprietary and Confidential

    Copyright Huawei Technologies Co., Ltd.

    20

  • 5/20/2018 AR1200 - Basic Configuration

    32/235

    Key Function

    Tab Press Tabafter typing a partial key word and the system runs

    partial help:

    l If the matching key word is unique, the system replaces thetyped character string with a complete key word and displays

    it in a new line with the cursor placed at the end of the word.

    l If there are several matches or no match, the system displays

    the prefix first. Then you can press Tabto view any matching

    key words one at a time. The cursor directly follows the end of

    the word. You can press the spacebar to enter the next word.

    l If a non-existent or incorrect key word is entered, press Tab

    and the word is displayed on a new line.

    2.3.2 Displaying

    Command lines have a feature to control how they are displayed. You can set the command line

    display mode as required.

    You can control the display of information on the CLI as follows:

    l If output information cannot be displayed on a full screen, you have three viewing options,

    as shown in Table 2-4.

    Table 2-4Display keys

    Key Function

    Ctrl_C Stops the display and the running of a command.

    Space Allows information to be displayed on the next screen.

    Enter Allows information to be displayed on the next line.

    2.3.3 Regular Expressions

    A regular expression describes a set of strings. It consists of common characters (such as letters

    from "a" to "z") and special characters (called metacharacters). The regular expression is a

    template upon which you can base searches for required strings. Users can use regular

    expressions to filter output to locate needed information quickly.

    A regular expression provides the following functions:

    l Search for sub-strings that match a rule in the main string.

    l String substitution based on specific matching rules.

    Formal Language Theory of the Regular Expression

    A regular expression consists of common characters and special characters.

    Huawei AR1200-S Series Enterprise Routers

    Configuration Guide - Basic Configuration 2 CLI Overview

    Issue 02 (2012-03-30) Huawei Proprietary and Confidential

    Copyright Huawei Technologies Co., Ltd.

    21

  • 5/20/2018 AR1200 - Basic Configuration

    33/235

    l Common characters

    Common characters, including all upper-case and lower-case letters, digits, punctuation

    marks, and special symbols, match themselves in a string. For example, "a" matches the

    letter "a" in "abc", "202" matches the digit "202" in "202.113.25.155", and "@" matches

    the symbol "@" in "[email protected]".l Special characters

    Special characters are used together with common characters to match complex or special

    string combination. Table 2-5describes special characters and their syntax.

    Table 2-5Description of special characters

    Specialcharacter

    Syntax Example

    \ Defines an escape character, which

    is used to mark the next character

    (common or special) as the common

    character.

    \* matches "*".

    ^ Matches the starting position of the

    string.

    ^10 matches "10.10.10.1" instead of

    "20.10.10.1".

    $ Matches the ending position of the

    string.

    1$ matches "10.10.10.1" instead of

    "10.10.10.2".

    * Matches the preceding element zero

    or more times.

    10* matches "1", "10", "100", and

    "1000".

    (10)* matches "null", "10", "1010",and "101010".

    + Matches the preceding element one

    or more times

    10+ matches "10", "100", and

    "1000".

    (10)+ matches "10", "1010", and

    "101010".

    ? Matches the preceding element zero

    or one time.

    10? matches "1" and "10".

    (10)? matches "null" and "10".

    . Matches any single character. 0.0 matches "0x0" and "020".

    .oo matches "book", "look", and"tool".

    () Defines a subexpression, which can

    be null. Both the expression and the

    subexpression should be matched.

    100(200)+ matches "100200" and

    "100200200".

    x|y Matches x or y. 100|200 matches "100" or "200".

    1(2|3)4 matches "124" or "134",

    instead of "1234", "14", "1224", and

    "1334".

    Huawei AR1200-S Series Enterprise Routers

    Configuration Guide - Basic Configuration 2 CLI Overview

    Issue 02 (2012-03-30) Huawei Proprietary and Confidential

    Copyright Huawei Technologies Co., Ltd.

    22

  • 5/20/2018 AR1200 - Basic Configuration

    34/235

    Specialcharacter

    Syntax Example

    [xyz] Matches any single character in theregular expression. [123] matches the character 2 in"255".

    [^xyz] Matches any character that is not

    contained within the brackets.

    [^123] matches any character except

    for "1", "2", and "3".

    [a-z] Matches any character within the

    specified range.

    [0-9] matches any character ranging

    from 0 to 9.

    [^a-z] Matches any character beyond the

    specified range.

    [^0-9] matches all non-numeric

    characters.

    _ Matches a comma "," left brace "{",

    right brace "}", left parenthesis "(",and right parenthesis ")".

    Matches the starting position of the

    input string.

    Matches the ending position of the

    input string.

    Matches a space.

    _2008_ matches "2008", "space

    2008 space", "space 2008", "2008space", ",2008,", "{2008}",

    "(2008)", "{2008)", and "(2008}".

    NOTE

    Unless otherwise specified, all characters in the preceding table are displayed on the screen.

    l Degeneration of special characters

    Certain special characters, when placed at certain positions in a regular expression,

    degenerate to common characters.

    The special characters following "\" match special characters themselves.

    The special characters "*", "+", and "?" placed at the starting position of the regular

    expression. For example, +45 matches "+45" and abc(*def) matches "abc*def".

    The special character "^" placed at any position except for the start of the regular

    expression. For example, abc^ matches "abc^".

    The special character "$" placed at any position except for the end of the regularexpression. For example, 12$2 matches "12$2".

    A right parenthesis ")" or right bracket "]" is not paired with a corresponding left

    parenthesis "(" or bracket "[". For example, abc) matches "abc)" and 0-9] matches

    "0-9]".

    NOTE

    Unless otherwise specified, degeneration rules also apply when preceding regular expressions are

    subexpressions within parentheses.

    l Combinations of common and special characters

    In actual usage, regular expressions combine multiple common and special characters to

    match certain strings.

    Huawei AR1200-S Series Enterprise Routers

    Configuration Guide - Basic Configuration 2 CLI Overview

    Issue 02 (2012-03-30) Huawei Proprietary and Confidential

    Copyright Huawei Technologies Co., Ltd.

    23

  • 5/20/2018 AR1200 - Basic Configuration

    35/235

    Specifying a Filtering Mode in a Command

    CAUTION

    The Huawei AR1200-S Series uses a regular expression to implement the pipe character filtering

    function. A display command supports the pipe character only when there is excessive output

    information.

    When filtering conditions are set to query output, the first line of the command output starts with

    information containing the regular expression.

    Some commands can carry the parameter | countto display the number of matching entries. The

    parameter | countcan be used together with other parameters.

    For commands that support regular expressions, three filtering methods are as follows:

    l | begin regular-expression: displays information that begins with the line that matches

    regular expression.

    l | exclude regular-expression: displays information that excludes the lines that match

    regular expression.

    l | include regular-expression: displays information that includes the lines that matchregular

    expression.

    NOTE

    The value of regular-expression is a string of 1 to 255 characters.regular-expression cannot contain

    underlines (_).

    2.3.4 Previously-Used CommandsThe CLI provides a function similar to DosKey that automatically saves any command used on

    the device. If you need to run a command that has been previously executed, you can use this

    function to call up the command.

    By default, the system saves 10 previously-used commands for each user. You can run the

    history-command max-sizesize-valuecommand in the user view to set the number of

    previously-used commands saved by the system. A maximum of 256 previously-used commands

    can be saved.

    NOTE

    Setting the number of saved previously-used commands to a reasonably low value is recommended. If a

    large number of previously-used commands are saved, locating a command can be time-consuming and

    affect efficiency.

    The operations are shown in Table 2-6

    Huawei AR1200-S Series Enterprise Routers

    Configuration Guide - Basic Configuration 2 CLI Overview

    Issue 02 (2012-03-30) Huawei Proprietary and Confidential

    Copyright Huawei Technologies Co., Ltd.

    24

  • 5/20/2018 AR1200 - Basic Configuration

    36/235

    Table 2-6Access the previously-used commands

    Action Key or Command Result

    Display

    previously-used

    commands.

    display history-

    command

    Display previously-used commands entered by

    users.

    Access the last

    previously-

    used

    command.

    Up cursor key () or

    Ctrl_P

    Display the last previously-used command if there

    is an earlier previously-used command. Otherwise,

    an alarm is generated.

    Access the next

    previously-

    used

    command.

    Down cursor key

    () or Ctrl_N

    Display the next previously-used command if there

    is a later previously-used command. Otherwise, the

    command is cleared and an alarm is generated.

    NOTE

    Windows 9X defines keys differently and the cursor key is cannot be used with Windows 9X

    HyperTerminals. You may use Ctrl_Pinstead.

    When you use previously-used commands, note the following points:

    l Previously-used commands are saved exactly as they are entered by users. For example, if

    a user enters an incomplete command, the saved command is also incomplete.

    l A command is saved the first time it is run and subsequent runnings are not saved. If acommand is entered in different forms or with different parameters, each entry is considered

    to be a different command.

    For example, if the display ip routing-tablecommand is run several times, only one

    previously-used command is saved. If the display current-configurationcommand and

    the display ip routing-tablecommand are run, two previously-used commands are saved.

    2.4 Shortcut Keys

    System or user-defined shortcut keys make it easier to enter commands.

    2.4.1 Classifying Shortcut Keys

    There are two types of shortcut keys: system shortcut keys and user-defined shortcut keys.

    Familiarize yourself with shortcut keys so as to use them correctly.

    The shortcut keys in the system are classified into the following types:

    l User-defined shortcut keys: CTRL_G, CTRL_L, CTRL_O, and CTRL_U. The user can

    assign these shortcut keys to any commands. When a shortcut key is pressed, the system

    automatically runs the assigned command. For details about defining the shortcut keys, see

    2.4.2 Defining Shortcut Keys.

    lSystem-defined shortcut keys: The system defines a number of shortcut keys with fixedfunctions. Table 2-7lists the system-defined shortcut keys.

    Huawei AR1200-S Series Enterprise Routers

    Configuration Guide - Basic Configuration 2 CLI Overview

    Issue 02 (2012-03-30) Huawei Proprietary and Confidential

    Copyright Huawei Technologies Co., Ltd.

    25

  • 5/20/2018 AR1200 - Basic Configuration

    37/235

    NOTE

    Different terminal software defines these keys differently. The shortcut keys on your terminal may be

    different than those listed in this section.

    Table 2-7System-defined shortcut keys

    Key Function

    CTRL_A The cursor moves to the beginning of the current line.

    CTRL_B The cursor moves to the left one space at a time.

    CTRL_C Terminates the running function.

    CTRL_D Deletes the character where the cursor lies.

    CTRL_E The cursor moves to the end of the current line.

    CTRL_F The cursor moves to the right one space at a time.

    CTRL_H Deletes one character to the left of the cursor.

    CTRL_N Displays the next command in the previously-used command

    buffer.

    CTRL_P Displays the previous command in the previously-used

    command buffer.

    CTRL_W Deletes a character string or character to the left of the cursor.

    CTRL_X Deletes all the characters to the left of the cursor.

    CTRL_Y Deletes all the characters to the right of the cursor.

    CTRL_Z Returns to the user view.

    CTRL_] Terminates the inbound or redirection connections.

    ESC_B The cursor moves to the left by one word.

    ESC_D Deletes a word to the right of the cursor.

    ESC_F The cursor moves to the right to the end of next word.

    2.4.2 Defining Shortcut Keys

    If you use one or more commands regularly, you can assign shortcut keys to run these commands.

    This facilitates user operations and improves efficiency. Only management-level users have the

    rights to define shortcut keys.

    Configure these shortcut keys in the system view.

    Action Command

    Define shortcut keys hotkey{ CTRL_G| CTRL_L| CTRL_O| CTRL_U}

    command-text

    Huawei AR1200-S Series Enterprise Routers

    Configuration Guide - Basic Configuration 2 CLI Overview

    Issue 02 (2012-03-30) Huawei Proprietary and Confidential

    Copyright Huawei Technologies Co., Ltd.

    26

  • 5/20/2018 AR1200 - Basic Configuration

    38/235

    CTRL_G, CTRL_L and CTRL_O are assigned to run the following commands by default:

    l CTRL_G: display current-configurationl CTRL_L: undo idle-timeout

    l CTRL_O: undo debugging all

    By default, CTRL_U is not assigned to any command.

    When defining shortcut keys, mark the command with double quotation marks if the command

    consists of several words or the command includes spaces, and do not mark the command with

    double quotation marks if the command consists of only one word or the command includes no

    space.

    NOTE

    To restore the defaults, run the undo hotkeycommand.

    2.4.3 Use of Shortcut Keys

    You can use a shortcut key at any position where a command can be entered. The system executes

    an entered shortcut key and displays the corresponding command on the screen exactly as if you

    had entered in the complete command.

    l If you have typed part of a command and have not pressed Enter, you can press the shortcut

    keys to clear what you have entered and display the full command. This operation has the

    same effect as that of deleting a command and then re-entering the complete command.

    l The shortcut keys are run like the commands. The syntax is recorded to the command buffer

    and logged for fault location and querying.

    NOTE

    The terminal in use may affect the functions of shortcut keys. For example, if customized shortcut keys

    for the terminal conflict with those for the router, the input shortcut keys are captured by the terminal

    program and hence the shortcut keys do not function.

    Run the following command in any view to display the use of shortcut keys.

    Action Command

    Check the usage of shortcut keys. display hotkey

    2.5 Configuration Examples

    This section provides several examples that illustrate the use of command lines.

    2.5.1 Example for Using Tab

    This example shows how to use the Tabkey. After inputting an inco