219
Huawei AR150&200 Series Enterprise Routers V200R002C00 Configuration Guide - Basic Configuration Issue 02 Date 2012-03-30 HUAWEI TECHNOLOGIES CO., LTD.

Configuration Guide - Basic Configuration(V200R002C00_02)

Embed Size (px)

DESCRIPTION

Huawei Router AR Family Basic configuration

Citation preview

  • Huawei AR150&200 Series Enterprise RoutersV200R002C00

    Configuration Guide - BasicConfiguration

    Issue 02Date 2012-03-30

    HUAWEI TECHNOLOGIES CO., LTD.

  • 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 writtenconsent 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. NoticeThe purchased products, services and features are stipulated by the contract made between Huawei and thecustomer. All or part of the products, services and features described in this document may not be within thepurchase 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 representationsof any kind, either express or implied.

    The information in this document is subject to change without notice. Every effort has been made in thepreparation of this document to ensure accuracy of the contents, but all statements, information, andrecommendations in this document do not constitute the warranty of any kind, express or implied. Huawei Technologies Co., Ltd.Address: Huawei Industrial Base

    Bantian, LonggangShenzhen 518129People's Republic of China

    Website: http://www.huawei.comEmail: [email protected]

    Issue 02 (2012-03-30) Huawei Proprietary and ConfidentialCopyright Huawei Technologies Co., Ltd.

    i

  • About This Document

    Intended AudienceThis document provides the basic concepts, configuration procedures, and configurationexamples in different application scenarios of the Basic configuration supported by theAR150/200 device.This document describes how to configure the Basic configuration.This document is intended for:l Data configuration engineersl Commissioning engineersl Network monitoring engineersl System maintenance engineers

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

    Symbol Description

    DANGERIndicates a hazard with a high level of risk, which if notavoided, will result in death or serious injury.

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

    CAUTIONIndicates a potentially hazardous situation, which if notavoided, could result in equipment damage, data loss,performance degradation, or unexpected results.

    TIP Indicates a tip that may help you solve a problem or savetime.

    NOTE Provides additional information to emphasize or supplementimportant points of the main text.

    Huawei AR150&200 Series Enterprise RoutersConfiguration Guide - Basic Configuration About This Document

    Issue 02 (2012-03-30) Huawei Proprietary and ConfidentialCopyright Huawei Technologies Co., Ltd.

    ii

  • Command ConventionsThe command conventions that may be found in this document are defined as follows.

    Convention DescriptionBoldface 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 vertical

    bars. A minimum of one item or a maximum of all items can beselected.

    [ x | y | ... ]* Optional items are grouped in brackets and separated by verticalbars. 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 ConventionsInterface numbers used in this manual are examples. In device configuration, use the existinginterface numbers on devices.

    Change HistoryChanges between document issues are cumulative. Therefore, the latest document versioncontains 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

    Changes in Issue 01 (2011-12-30)Initial commercial release.

    Huawei AR150&200 Series Enterprise RoutersConfiguration Guide - Basic Configuration About This Document

    Issue 02 (2012-03-30) Huawei Proprietary and ConfidentialCopyright Huawei Technologies Co., Ltd.

    iii

  • Contents

    About This Document.....................................................................................................................ii1 Logging In to the System for the First Time............................................................................1

    1.1 Introduction........................................................................................................................................................21.2 Logging In to the Device Through the Console Port..........................................................................................2

    1.2.1 Establishing the Configuration Task.........................................................................................................21.2.2 Establishing the Physical Connection........................................................................................................31.2.3 Logging In to the Device...........................................................................................................................3

    1.3 Logging In to a Router Through Telnet..............................................................................................................51.3.1 Establishing the Configuration Task.........................................................................................................51.3.2 Establishing a Physical Connection...........................................................................................................51.3.3 Logging In to the Router...........................................................................................................................6

    2 CLI Overview.................................................................................................................................72.1 CLI Introduction.................................................................................................................................................8

    2.1.1 Command Line Interface...........................................................................................................................82.1.2 Command Levels.......................................................................................................................................82.1.3 Command Line Views.............................................................................................................................11

    2.2 Online Help.......................................................................................................................................................122.2.1 Full Help..................................................................................................................................................122.2.2 Partial Help..............................................................................................................................................132.2.3 Error Messages of the Command Line Interface.....................................................................................13

    2.3 CLI Features.....................................................................................................................................................142.3.1 Editing.....................................................................................................................................................142.3.2 Displaying................................................................................................................................................152.3.3 Regular Expressions................................................................................................................................152.3.4 Previously-Used Commands...................................................................................................................18

    2.4 Shortcut Keys...................................................................................................................................................192.4.1 Classifying Shortcut Keys.......................................................................................................................192.4.2 Defining Shortcut Keys...........................................................................................................................202.4.3 Use of Shortcut Keys...............................................................................................................................21

    2.5 Configuration Examples...................................................................................................................................212.5.1 Example for Using Tab............................................................................................................................212.5.2 Example for Using Shortcut Keys...........................................................................................................23

    Huawei AR150&200 Series Enterprise RoutersConfiguration Guide - Basic Configuration Contents

    Issue 02 (2012-03-30) Huawei Proprietary and ConfidentialCopyright Huawei Technologies Co., Ltd.

    iv

  • 3 Basic Configuration.....................................................................................................................243.1 Configuring the Basic System Environment....................................................................................................25

    3.1.1 Establishing the Configuration Task.......................................................................................................253.1.2 Configuring the Equipment Name...........................................................................................................253.1.3 Setting the System Clock.........................................................................................................................263.1.4 Configuring a Header..............................................................................................................................323.1.5 Configuring Command Levels................................................................................................................333.1.6 Configuring the undo Command to Automatically Match the Higher-Level View................................333.1.7 (Optional) Setting Factory Configurations..............................................................................................34

    3.2 Displaying System Status Messages.................................................................................................................353.2.1 Displaying System Configuration...........................................................................................................353.2.2 Displaying System Status........................................................................................................................353.2.3 Collecting System Diagnostic Information.............................................................................................363.2.4 Displaying Factory Configuration Information.......................................................................................36

    4 Configuring User Interfaces......................................................................................................374.1 User Interface Overview...................................................................................................................................384.2 Configuring the Console User Interface...........................................................................................................39

    4.2.1 Establishing the Configuration Task.......................................................................................................404.2.2 Setting Physical Attributes of the Console User Interface......................................................................404.2.3 Setting Terminal Attributes of the Console User Interface.....................................................................414.2.4 Configuring User Privilege of the Console User Interface......................................................................424.2.5 Configuring the User Authentication Mode of the Console User Interface............................................434.2.6 Checking the Configuration.....................................................................................................................45

    4.3 Configuring the VTY User Interface................................................................................................................464.3.1 Establishing the Configuration Task.......................................................................................................464.3.2 Configuring the Maximum Number of VTY User Interfaces.................................................................474.3.3 (Optional) Setting Restrictions for Incoming and Outgoing Calls on VTY User Interfaces...................474.3.4 Setting Terminal Attributes of the VTY User Interface..........................................................................484.3.5 Setting User Priority of the VTY User Interface.....................................................................................494.3.6 Setting the User Authentication Mode of the VTY User Interface.........................................................504.3.7 Checking the Configuration.....................................................................................................................52

    4.4 Configuration Examples...................................................................................................................................534.4.1 Example for Configuring Console User Interface...................................................................................534.4.2 Example for Configuring a VTY User Interface.....................................................................................55

    5 Configuring User Login.............................................................................................................575.1 Overview of User Login...................................................................................................................................585.2 Logging in to the Devices Through the Console Port......................................................................................60

    5.2.1 Establishing the Configuration Task.......................................................................................................605.2.2 Logging In to the Device Using a Console Port......................................................................................615.2.3 (Optional) Configuring the Console User Interface................................................................................635.2.4 Checking the Configuration.....................................................................................................................64

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

    Huawei AR150&200 Series Enterprise RoutersConfiguration Guide - Basic Configuration Contents

    Issue 02 (2012-03-30) Huawei Proprietary and ConfidentialCopyright Huawei Technologies Co., Ltd.

    v

  • 5.3.1 Establishing the Configuration Task.......................................................................................................655.3.2 Configuring the User Access Level and User Authentication Mode of the VTY User Interface...........665.3.3 Enabling the Telnet Service.....................................................................................................................695.3.4 Logging in to the Device Using Telnet...................................................................................................695.3.5 Checking the Configuration.....................................................................................................................70

    5.4 Logging in to Devices Using STelnet...............................................................................................................715.4.1 Establishing the Configuration Task.......................................................................................................715.4.2 Configuring the User Access Level and User Authentication Mode of the VTY User Interface...........725.4.3 Configuring SSH for the VTY User Interface.........................................................................................755.4.4 Configuring an SSH User and Specifying STelnet as One of Service Types.........................................765.4.5 Enabling the STelnet Server Function.....................................................................................................785.4.6 Logging in to the Device Using STelnet.................................................................................................785.4.7 (Optional) Configuring the STelnet Server Parameters...........................................................................795.4.8 Checking the Configuration.....................................................................................................................81

    5.5 Common Operations After Login.....................................................................................................................825.5.1 Establishing the Configuration Task.......................................................................................................825.5.2 Switching User Levels.............................................................................................................................825.5.3 Locking User Interfaces...........................................................................................................................835.5.4 Sending Messages to Other User Interfaces............................................................................................845.5.5 Displaying Login Users...........................................................................................................................84

    5.6 Configuration Examples...................................................................................................................................855.6.1 Example for Configuring User Login Using a Console Port...................................................................855.6.2 Example for Logging In by Telnet..........................................................................................................875.6.3 Example for Configuring User Login by Using STelnet.........................................................................89

    6 Managing the File System.........................................................................................................926.1 File System Overview......................................................................................................................................93

    6.1.1 File System..............................................................................................................................................936.1.2 Methods of File Management..................................................................................................................93

    6.2 Managing Files Using the File System.............................................................................................................946.2.1 Establishing the Configuration Task.......................................................................................................946.2.2 Managing Storage Devices......................................................................................................................956.2.3 Managing Directories..............................................................................................................................966.2.4 Managing Files........................................................................................................................................96

    6.3 Managing Files Using FTP...............................................................................................................................996.3.1 Establishing the Configuration Task.......................................................................................................996.3.2 Configuring a Local FTP User................................................................................................................996.3.3 (Optional) Specifying a Port Number for the FTP Server.....................................................................1006.3.4 Enabling the FTP Server........................................................................................................................1016.3.5 (Optional) Configuring the FTP Server Parameters..............................................................................1016.3.6 (Optional) Configuring an FTP ACL....................................................................................................1026.3.7 Accessing the System by Using FTP.....................................................................................................1036.3.8 Managing Files Using FTP Commands.................................................................................................104

    Huawei AR150&200 Series Enterprise RoutersConfiguration Guide - Basic Configuration Contents

    Issue 02 (2012-03-30) Huawei Proprietary and ConfidentialCopyright Huawei Technologies Co., Ltd.

    vi

  • 6.3.9 Checking the Configuration...................................................................................................................1066.4 Managing Files Using SFTP...........................................................................................................................106

    6.4.1 Establishing the Configuration Task.....................................................................................................1076.4.2 Configuring VTY User Interface...........................................................................................................1076.4.3 Configuring SSH for the VTY User Interface.......................................................................................1086.4.4 Configuring an SSH User and Specifying SFTP as One of Service Types...........................................1086.4.5 Enabling the SFTP Service....................................................................................................................1116.4.6 Accessing the System Using SFTP.......................................................................................................1116.4.7 Managing Files Using SFTP..................................................................................................................1136.4.8 Checking the Configuration...................................................................................................................114

    6.5 Configuration Examples.................................................................................................................................1156.5.1 Example for Managing Files Using the File System.............................................................................1156.5.2 Example for Performing File Operations by Means of FTP.................................................................1166.5.3 Example for Performing File Operations by Means of SFTP...............................................................119

    7 Configuring System Startup....................................................................................................1227.1 System Startup Overview...............................................................................................................................123

    7.1.1 System Software....................................................................................................................................1237.1.2 Configuration Files and Current Configurations...................................................................................123

    7.2 Managing Configuration Files........................................................................................................................1237.2.1 Establishing the Configuration Task.....................................................................................................1247.2.2 Saving Configuration Files....................................................................................................................1247.2.3 Clearing a Configuration File................................................................................................................1257.2.4 Comparing Configuration Files.............................................................................................................1267.2.5 Checking the Configuration...................................................................................................................126

    7.3 Specifying a File for System Startup..............................................................................................................1277.3.1 Establishing the Configuration Task.....................................................................................................1277.3.2 Configuring System Software for a router to Load for the Next Startup..............................................1287.3.3 Configuring the Configuration File for Router to Load at the Next Startup.........................................1287.3.4 Checking the Configuration...................................................................................................................129

    7.4 Configuration Examples.................................................................................................................................1297.4.1 Example for Configuring System Startup.............................................................................................129

    8 Accessing Another Device.......................................................................................................1328.1 Accessing Another Device.............................................................................................................................133

    8.1.1 Telnet Method........................................................................................................................................1338.1.2 FTP Method...........................................................................................................................................1348.1.3 TFTP Method........................................................................................................................................1358.1.4 SSH Method..........................................................................................................................................135

    8.2 Logging in to Other Devices Using Telnet.....................................................................................................1368.2.1 Establishing the Configuration Task.....................................................................................................1368.2.2 (Optional) Configuring a Source IP Address for a Telnet Client..........................................................1378.2.3 Logging in to Another Device by Using Telnet....................................................................................1388.2.4 Checking the Configuration...................................................................................................................138

    Huawei AR150&200 Series Enterprise RoutersConfiguration Guide - Basic Configuration Contents

    Issue 02 (2012-03-30) Huawei Proprietary and ConfidentialCopyright Huawei Technologies Co., Ltd.

    vii

  • 8.3 Logging in to Another Device Using STelnet................................................................................................1398.3.1 Establishing the Configuration Task.....................................................................................................1398.3.2 Configuring the First Successful Login to Another Device (Enabling the First-Time Authentication onthe SSH Client)...............................................................................................................................................1408.3.3 Configuring the First Successful Login to Another Device (Allocating an Public Key to the SSH Server)........................................................................................................................................................................1418.3.4 Logging in to Another Device by Using STelnet..................................................................................1428.3.5 Checking the Configuration...................................................................................................................142

    8.4 Accessing Files on Another Device Using TFTP...........................................................................................1438.4.1 Establishing the Configuration Task.....................................................................................................1438.4.2 (Optional) Configuring a Source IP Address for a TFTP Client...........................................................1448.4.3 (Optional) Configuring TFTP Access Authority...................................................................................1448.4.4 Downloading Files Using TFTP............................................................................................................1458.4.5 Uploading Files Using TFTP.................................................................................................................1468.4.6 Checking the Configuration...................................................................................................................146

    8.5 Accessing Files on Another Device Using FTP.............................................................................................1478.5.1 Establishing the Configuration Task.....................................................................................................1478.5.2 (Optional) Configuring the Source IP Address and Interface of the FTP Client...................................1478.5.3 Connecting to Other Devices by Using FTP Commands......................................................................1488.5.4 Managing Files Using FTP Commands.................................................................................................1498.5.5 Changing Login Users...........................................................................................................................1518.5.6 Disconnecting from the FTP Server......................................................................................................1528.5.7 Checking the Configuration...................................................................................................................152

    8.6 Accessing Files on Another Device Using SFTP...........................................................................................1538.6.1 Establishing the Configuration Task.....................................................................................................1538.6.2 (Optional) Configuring a Source IP Address for an SFTP Client.........................................................1548.6.3 Configuring the First Successful Login to Another Device (Enabling the First-Time Authentication onthe SSH Client)...............................................................................................................................................1548.6.4 Configuring the First Successful Login to Another Device (Allocating an Public Key to the SSH Server)........................................................................................................................................................................1558.6.5 Connecting to Other Devices by Using SFTP.......................................................................................1568.6.6 Managing Files Using SFTP Commands..............................................................................................1578.6.7 Checking the Configuration...................................................................................................................158

    8.7 Configuration Examples.................................................................................................................................1588.7.1 Example for Configuring Telnet Services.............................................................................................1598.7.2 Example for Configuring the Device as the STelnet Client to Connect to the SSH Server..................1618.7.3 Example for Configuring TFTP............................................................................................................1658.7.4 Example for Connecting the SFTP Client to the SSH Server...............................................................1688.7.5 Example for Authenticating SSH Through RADIUS............................................................................172

    9 Upgrade and Maintenance.......................................................................................................1789.1 Upgrade and Maintenance Overview.............................................................................................................179

    9.1.1 License Authorization............................................................................................................................1799.1.2 Software Upgrade..................................................................................................................................179

    Huawei AR150&200 Series Enterprise RoutersConfiguration Guide - Basic Configuration Contents

    Issue 02 (2012-03-30) Huawei Proprietary and ConfidentialCopyright Huawei Technologies Co., Ltd.

    viii

  • 9.1.3 Patch Management................................................................................................................................1799.1.4 CPU and Memory Usage Thresholds....................................................................................................1809.1.5 Device Restart........................................................................................................................................180

    9.2 Activating a GTL License File.......................................................................................................................1809.2.1 Establishing the Configuration Task.....................................................................................................1819.2.2 Uploading a GTL License File..............................................................................................................1829.2.3 Activating the GTL License File...........................................................................................................1829.2.4 (Optional) Enabling the Emergency State of the GTL License Module...............................................1839.2.5 Checking the Configuration...................................................................................................................183

    9.3 Upgrading System Software...........................................................................................................................1849.3.1 Establishing the Configuration Task.....................................................................................................1849.3.2 Checking the System Before the Upgrade.............................................................................................1859.3.3 Downloading a System File...................................................................................................................1869.3.4 Specifying the System Software to Be Used at the Next Startup..........................................................1929.3.5 Configuring a Backup Startup File........................................................................................................1939.3.6 (Optional) Upgrading the BootROM of the LPU..................................................................................1939.3.7 Restarting a Device................................................................................................................................1949.3.8 Checking the Configuration...................................................................................................................194

    9.4 Managing Patches...........................................................................................................................................1959.4.1 Establishing the Configuration Task.....................................................................................................1959.4.2 Installing a Patch...................................................................................................................................1969.4.3 Specifying a Patch File to Be Used at the Next Startup........................................................................1979.4.4 Uninstalling a Patch...............................................................................................................................1979.4.5 Checking the Configuration...................................................................................................................198

    9.5 Monitoring CPU and Memory Usage.............................................................................................................1989.5.1 Establishing the Configuration Task.....................................................................................................1989.5.2 Setting CPU Usage Thresholds.............................................................................................................1999.5.3 Setting a Memory Usage Threshold......................................................................................................1999.5.4 Checking the Configuration...................................................................................................................200

    9.6 Restarting the Device......................................................................................................................................2029.6.1 Establishing the Configuration Task.....................................................................................................2029.6.2 Restarting the Device Immediately.......................................................................................................2039.6.3 Configuring the Device to Restart as Scheduled...................................................................................2039.6.4 Checking the Configuration...................................................................................................................204

    9.7 Configuration Examples.................................................................................................................................2049.7.1 Example for Upgrading System Software.............................................................................................2049.7.2 Example for Installing a Patch File.......................................................................................................208

    Huawei AR150&200 Series Enterprise RoutersConfiguration Guide - Basic Configuration Contents

    Issue 02 (2012-03-30) Huawei Proprietary and ConfidentialCopyright Huawei Technologies Co., Ltd.

    ix

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

    You can log in to a new router through the console port, or connect to a LAN port of therouter and use Telnet to configure the router.

    1.1 IntroductionYou can configure a device that is powered on for the first time by logging in through the consoleport or Telnet.1.2 Logging In to the Device Through the Console PortThis section describes how to establish the configuration environment by using the console portto connect a terminal to a router.1.3 Logging In to a Router Through TelnetTo configure the network environment, use Telnet to log in to the router from a terminal.

    Huawei AR150&200 Series Enterprise RoutersConfiguration Guide - Basic Configuration 1 Logging In to the System for the First Time

    Issue 02 (2012-03-30) Huawei Proprietary and ConfidentialCopyright Huawei Technologies Co., Ltd.

    1

  • 1.1 IntroductionYou can configure a device that is powered on for the first time by logging in through the consoleport or Telnet.A main control board provides a console port and multiple LAN ports. To configure a device,connect the user terminal serial port to the device console port or log in to the device throughTelnet after connecting the network port of the terminal to a LAN port of the device.

    1.2 Logging In to the Device Through the Console PortThis section describes how to establish the configuration environment by using the console portto connect a terminal to a router.

    1.2.1 Establishing the Configuration TaskBefore logging in to the router through the console port, familiarize yourself with the applicableenvironment, complete the pre-configuration tasks, and obtain any data required for theconfiguration. This will help you complete the configuration task quickly and correctly.

    Applicable EnvironmentWhen the router is powered on for the first time, you could use the console port to log in to therouter to configure and manage the router.

    Pre-configuration TasksBefore 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 PreparationTo log in to the router through the console port, you need the following data.

    No. Data1 Terminal communication parameters

    l Baud ratel Data bitl Parityl Stop bitl Flow-control mode

    Huawei AR150&200 Series Enterprise RoutersConfiguration Guide - Basic Configuration 1 Logging In to the System for the First Time

    Issue 02 (2012-03-30) Huawei Proprietary and ConfidentialCopyright Huawei Technologies Co., Ltd.

    2

  • NOTEThe 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.

    ProcedureStep 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 consoleport.

    ContextPC terminal attributes, including the transmission rate, data bit, parity bit, stop bit, and flowcontrol mode must be configured to match those configured for the console port. Default valuesfor terminal attributes are used during the first login to the device.

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

    Figure 1-1 Connection creation

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

    Huawei AR150&200 Series Enterprise RoutersConfiguration Guide - Basic Configuration 1 Logging In to the System for the First Time

    Issue 02 (2012-03-30) Huawei Proprietary and ConfidentialCopyright Huawei Technologies Co., Ltd.

    3

  • Figure 1-2 Interface settings

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

    Figure 1-3 Communication parameter settings

    Huawei AR150&200 Series Enterprise RoutersConfiguration Guide - Basic Configuration 1 Logging In to the System for the First Time

    Issue 02 (2012-03-30) Huawei Proprietary and ConfidentialCopyright Huawei Technologies Co., Ltd.

    4

  • 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 AR150/200 that does not have a startup configuration file, thesystem displays "Auto-Config is working. Before configuring the device, stop Auto-Config. If you performconfigurations when Auto-Config is running, the DHCP, routing, DNS, and VTY configurations will belost. Do you want to stop Auto-Config? [y/n]:"l To continue Auto-Config, enter n and press Enter.l To stop Auto-Config, choose y and press Enter.

    CAUTIONIf you choose n but 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 a Router Through TelnetTo configure the network environment, use Telnet to log in to the router from a terminal.

    1.3.1 Establishing the Configuration TaskBefore configuring a router through Telnet, familiarize yourself with the applicableenvironment, complete the pre-configuration tasks, and obtain the data required for theconfiguration. This will help you complete the configuration task quickly and accurately.

    Applicable EnvironmentTo configure and manage a router that is powered on for the first time, log in to the router throughTelnet.By default, the IP addresses of all LAN ports are 192.168.1.1, and the user name and passwordare admin. You can log in to the router using Telnet by connecting the PC network adapter toany LAN port of the router with the twisted pair.

    Pre-configuration TasksBefore configuring a router through Telnet, complete the following tasks:l Obtaining the twisted pair that is used to connect to a LAN port of the router

    Data PreparationNone.

    1.3.2 Establishing a Physical ConnectionTo establish a physical connection between a PC and a router, use a twisted pair to connect thenetwork port of the PC to a LAN port of the device.

    Huawei AR150&200 Series Enterprise RoutersConfiguration Guide - Basic Configuration 1 Logging In to the System for the First Time

    Issue 02 (2012-03-30) Huawei Proprietary and ConfidentialCopyright Huawei Technologies Co., Ltd.

    5

  • ProcedureStep 1 Power on all the devices and ensure a successful self-check.Step 2 Use the twisted pair to connect a LAN port of the router to the network port of a PC.Step 3 Configure an IP address and subnet mask for the network port of the PC. The IP address must

    be within the network segment 192.168.1.0/24 (recommended: 192.168.1.100), and the subnetmask is 255.255.255.0.

    Step 4 Check the physical connection. Ping 192.168.1.1 on the PC. If 192.168.1.1 can be pinged, thephysical connection has been established.

    NOTE

    l If the ping operation fails, check whether the PC IP address is correct ore replace the network cable.

    ----End

    1.3.3 Logging In to the RouterTo configure and manage the router that is powered on for the first time, log in to the routerthrough Telnet.

    ContextAfter the physical connection is established successfully, log in to the router through Telnet.

    ProcedureStep 1 Open the command-line window of Windows.Step 2 Run the telnet 192.168.1.1 command to log in to the router.

    telnet 192.168.1.1

    Step 3 Enter the initial user name (admin) and password (admin). The command-line prompt of theuser view is displayed, for example, . Then, you enter the configurationenvironment of the user view.Username:adminPassword:-------------------------------------------------------------------------------------

    User last login information:-------------------------------------------------------------------------------------Access Type: TelnetIP-Address : 192.168.1.100Time : 2011-09-07 17:27:17+00:00-------------------------------------------------------------------------------------

    ----End

    Huawei AR150&200 Series Enterprise RoutersConfiguration Guide - Basic Configuration 1 Logging In to the System for the First Time

    Issue 02 (2012-03-30) Huawei Proprietary and ConfidentialCopyright Huawei Technologies Co., Ltd.

    6

  • 2 CLI OverviewAbout This Chapter

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

    2.1 CLI IntroductionAfter 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 HelpWhen inputting command lines or configuring services, you can use the online help to obtainreal-time help.2.3 CLI FeaturesThe CLI provides several features to help users flexibly use it.2.4 Shortcut KeysSystem or user-defined shortcut keys make it easier to enter commands.2.5 Configuration ExamplesThis section provides several examples that illustrate the use of command lines.

    Huawei AR150&200 Series Enterprise RoutersConfiguration Guide - Basic Configuration 2 CLI Overview

    Issue 02 (2012-03-30) Huawei Proprietary and ConfidentialCopyright Huawei Technologies Co., Ltd.

    7

  • 2.1 CLI IntroductionAfter 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 InterfaceYou 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 telnet command 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 unauthorizedusers 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 andcorrectly.

    l Network test commands such as tracert and ping for 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 haveto be entered in full, as long as the part of the command entered is unique within the system. Forexample, to use the display current-configuration command, entering d cu, di cu, or dis cu will runthe command. Entering d c or dis c will not run the command, because these entries are not unique tothe command.

    l The system saves the complete form of incomplete commands to configuration files. Saved commandsmay have more than 512 characters. When the system is restarted, incomplete commands cannot berestored. Therefore, pay attention to the full length of incomplete commands before saving them.

    2.1.2 Command LevelsThe system structures access to command functions hierarchically to protect system security.The system administrator sets user access levels that grant specific users access to specificcommand levels.

    Huawei AR150&200 Series Enterprise RoutersConfiguration Guide - Basic Configuration 2 CLI Overview

    Issue 02 (2012-03-30) Huawei Proprietary and ConfidentialCopyright Huawei Technologies Co., Ltd.

    8

  • By default, the command level of a user is a value ranging from 0 to 3, and the user access levelis a value ranging from 0 to 15. Table 2-1 lists the association between user access levels andcommand levels.

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

    CommandLevel

    LevelName

    Description

    0 0 Visitlevel

    This level gives access to commands that run network diagnostictools (such as ping and tracert) and commands that start from alocal device, visit external devices (such as Telnet client side ),and a part of display commands.

    1 0 and1

    Monitoringlevel

    This level gives access to commands, like the display command,that are used for system maintenance and fault diagnosis.NOTE

    Some display commands are not at this level. For example, the displaycurrent-configuration and display saved-configuration commandsare at level 3. For details about command level, see Huawei AR150&200Series Enterprise Routers Command Reference.

    2 0, 1,and 2

    Configurationlevel

    This level gives access to commands that configure networkservices provided directly to users, including routing andnetwork layer commands.

    3-15 0, 1,2, and3

    Managementlevel

    This level gives access to commands that control basic systemoperations and provide support for services. These commandsinclude file system commands, FTP commands, TFTPcommands, configuration file switching commands, powersupply control commands, backup board control commands,user management commands, level setting commands, systeminternal parameter setting commands, and debugging commandsfor fault diagnosis.

    NOTE

    l The default command level may be higher than the command level defined according to the commandrules 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 privilege level level command sets the user level.

    Searching Commands Based on Command LevelsYou 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 AR150&200 Series Enterprise RoutersConfiguration Guide - Basic Configuration 2 CLI Overview

    Issue 02 (2012-03-30) Huawei Proprietary and ConfidentialCopyright Huawei Technologies Co., Ltd.

    9

  • Figure 2-1 Entering the search window

    3. Enter the command level you want in the "Type in the word(s) to search for" textbox andclick "List Topics". All commands of the specified level will be displayed as shown inFigure 2-2.

    Huawei AR150&200 Series Enterprise RoutersConfiguration Guide - Basic Configuration 2 CLI Overview

    Issue 02 (2012-03-30) Huawei Proprietary and ConfidentialCopyright Huawei Technologies Co., Ltd.

    10

  • Figure 2-2 Searching commands based on a specific level

    2.1.3 Command Line ViewsThe command line interface has different command views. Each command is registered to runin one or more command views. You can run a command only after you enter an appropriatecommand 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-view command to enter the system view. system-view[Huawei]

    # Run the aaa command in the system view to enter the AAA view.[Huawei] aaa[Huawei-aaa]

    Huawei AR150&200 Series Enterprise RoutersConfiguration Guide - Basic Configuration 2 CLI Overview

    Issue 02 (2012-03-30) Huawei Proprietary and ConfidentialCopyright Huawei Technologies Co., Ltd.

    11

  • 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 HelpWhen inputting command lines or configuring services, you can use the online help to obtainreal-time help.

    2.2.1 Full HelpWhen inputting a command, you can use the full help function to obtain keywords or parametersfor the command.

    Procedurel 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 andtheir descriptions for all commands of that view. ?User view commands: arp-ping ARP-ping autosave autosave command group backup Backup information cd Change current directory clock Specify the system clock cls Clear screen ......

    Enter a command and a question mark (?) separated by a space. All keywords associatedwith this command, as well as simple descriptions, are displayed. For example:[Huawei] interface ?Bridge-if Bridge-if interface Cellular Cellular interface ......Bridge-if and Cellular are keywords; Bridge-if interface and Cellular interfacedescribe 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 35In this command output, INTEGER describes the parameter value and Thevalue of FTP timeout, the default value is 30 minutes is a simple description of what

    Huawei AR150&200 Series Enterprise RoutersConfiguration Guide - Basic Configuration 2 CLI Overview

    Issue 02 (2012-03-30) Huawei Proprietary and ConfidentialCopyright Huawei Technologies Co., Ltd.

    12

  • the parameter sets. A display of indicates that no parameters are associated withthis command. The command is repeated in the next command line. You can pressEnter to run the command.

    ----End

    2.2.2 Partial HelpIf you enter only the first or first several characters of a command, partial help provides keywordsthat begin with this character or character string.

    Procedurel 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 commandsthat begin with this character string. d?debugging debugging command group delete Delete a file dialer Dialer dir List files on a filesystem display Display information

    Enter a command and a character string followed directly by a question mark (?) todisplay all key words that begin with this character string. display b? bfd Specify BFD(Bidirectional Forwarding Detection ) configuration information bgp BGP information bootp Bootstrap Protocol bridge bridge command group

    Enter the first several letters of a key word in the command and then press Tab to displaya complete key word. A complete keyword is displayed only if the partial string of lettersuniquely identifies a specific key word. If they do not identify a specific key work,continuing to press Tab will display different key words. You can select the needed keyword.

    ----End

    2.2.3 Error Messages of the Command Line InterfaceIf a command is entered and passes the syntax check, the system executes it. Otherwise, thesystem reports an error message.Table 2-2 lists common error messages.

    Huawei AR150&200 Series Enterprise RoutersConfiguration Guide - Basic Configuration 2 CLI Overview

    Issue 02 (2012-03-30) Huawei Proprietary and ConfidentialCopyright Huawei Technologies Co., Ltd.

    13

  • Table 2-2 Common error messages of the command lineError messages Cause of the errorError: Unrecognized commandfound at '^' position.

    The command cannot be foundThe key word cannot be found

    Error: Wrong parameter foundat '^' position.

    Parameter type errorParameter value out of range

    Error:Incomplete commandfound at '^' position.

    Incomplete command entered

    Error: Too many parametersfound at "^" position.

    Too many parameters entered

    Error:Ambiguous commandfound at '^' position.

    Ambiguous parameters entered

    2.3 CLI FeaturesThe CLI provides several features to help users flexibly use it.

    2.3.1 EditingThe command line editing function allows you to edit command lines or obtain help by usingcertain keys.The command line of AR150/200 supports multi-line edition. The maximum length of eachcommand is 512 characters.Keys for editing that are often used are shown in Table 2-3.

    Table 2-3 Keys for editingKey FunctionCommon key Inserts a character at the current position of the cursor if the editing

    buffer is not full. The cursor then moves to the right. If the bufferis full, an alarm is generated.

    Backspace Moves the cursor to the left and deletes the character at thatposition. When the cursor reaches the head of the command, analarm is generated.

    Left cursor key orCtrl_B

    Moves the cursor to the left a single space at a time. When thecursor reaches the head of the command, an alarm is generated.

    Right cursor key orCtrl_F

    Moves the cursor to the right a single space at a time. When thecursor reaches the end of the command, an alarm is generated.

    Huawei AR150&200 Series Enterprise RoutersConfiguration Guide - Basic Configuration 2 CLI Overview

    Issue 02 (2012-03-30) Huawei Proprietary and ConfidentialCopyright Huawei Technologies Co., Ltd.

    14

  • Key FunctionTab Press Tab after typing a partial key word and the system runs

    partial help:l If the matching key word is unique, the system replaces the

    typed character string with a complete key word and displaysit 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 displaysthe prefix first. Then you can press Tab to view any matchingkey words one at a time. The cursor directly follows the end ofthe word. You can press the spacebar to enter the next word.

    l If a non-existent or incorrect key word is entered, press Taband the word is displayed on a new line.

    2.3.2 DisplayingCommand lines have a feature to control how they are displayed. You can set the command linedisplay 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-4 Display keysKey FunctionCtrl_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 ExpressionsA regular expression describes a set of strings. It consists of common characters (such as lettersfrom "a" to "z") and special characters (called metacharacters). The regular expression is atemplate upon which you can base searches for required strings. Users can use regularexpressions 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 ExpressionA regular expression consists of common characters and special characters.

    Huawei AR150&200 Series Enterprise RoutersConfiguration Guide - Basic Configuration 2 CLI Overview

    Issue 02 (2012-03-30) Huawei Proprietary and ConfidentialCopyright Huawei Technologies Co., Ltd.

    15

  • l Common charactersCommon characters, including all upper-case and lower-case letters, digits, punctuationmarks, and special symbols, match themselves in a string. For example, "a" matches theletter "a" in "abc", "202" matches the digit "202" in "202.113.25.155", and "@" matchesthe symbol "@" in "[email protected]".

    l Special charactersSpecial characters are used together with common characters to match complex or specialstring combination. Table 2-5 describes special characters and their syntax.

    Table 2-5 Description of special charactersSpecialcharacter

    Syntax Example

    \ Defines an escape character, whichis used to mark the next character(common or special) as the commoncharacter.

    \* matches "*".

    ^ Matches the starting position of thestring.

    ^10 matches "10.10.10.1" instead of"20.10.10.1".

    $ Matches the ending position of thestring.

    1$ matches "10.10.10.1" instead of"10.10.10.2".

    * Matches the preceding element zeroor more times.

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

    + Matches the preceding element oneor more times

    10+ matches "10", "100", and"1000".(10)+ matches "10", "1010", and"101010".

    ? Matches the preceding element zeroor 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 canbe null. Both the expression and thesubexpression 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 AR150&200 Series Enterprise RoutersConfiguration Guide - Basic Configuration 2 CLI Overview

    Issue 02 (2012-03-30) Huawei Proprietary and ConfidentialCopyright Huawei Technologies Co., Ltd.

    16

  • Specialcharacter

    Syntax Example

    [xyz] Matches any single character in theregular expression.

    [123] matches the character 2 in"255".

    [^xyz] Matches any character that is notcontained within the brackets.

    [^123] matches any character exceptfor "1", "2", and "3".

    [a-z] Matches any character within thespecified range.

    [0-9] matches any character rangingfrom 0 to 9.

    [^a-z] Matches any character beyond thespecified range.

    [^0-9] matches all non-numericcharacters.

    _ Matches a comma "," left brace "{",right brace "}", left parenthesis "(",and right parenthesis ")".Matches the starting position of theinput string.Matches the ending position of theinput string.Matches a space.

    _2008_ matches "2008", "space2008 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 regular

    expression. 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 aresubexpressions within parentheses.

    l Combinations of common and special charactersIn actual usage, regular expressions combine multiple common and special characters tomatch certain strings.

    Huawei AR150&200 Series Enterprise RoutersConfiguration Guide - Basic Configuration 2 CLI Overview

    Issue 02 (2012-03-30) Huawei Proprietary and ConfidentialCopyright Huawei Technologies Co., Ltd.

    17

  • Specifying a Filtering Mode in a Command

    CAUTIONThe Huawei AR150&200 Series uses a regular expression to implement the pipe characterfiltering function. A display command supports the pipe character only when there is excessiveoutput information.When filtering conditions are set to query output, the first line of the command output starts withinformation containing the regular expression.

    Some commands can carry the parameter | count to display the number of matching entries. Theparameter | count can 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 match regular

    expression.NOTE

    The value of regular-expression is a string of 1 to 255 characters.regular-expression cannot containunderlines (_).

    2.3.4 Previously-Used CommandsThe CLI provides a function similar to DosKey that automatically saves any command used onthe device. If you need to run a command that has been previously executed, you can use thisfunction to call up the command.

    By default, the system saves 10 previously-used commands for each user. You can run thehistory-command max-size size-value command in the user view to set the number ofpreviously-used commands saved by the system. A maximum of 256 previously-used commandscan be saved.

    NOTESetting the number of saved previously-used commands to a reasonably low value is recommended. If alarge number of previously-used commands are saved, locating a command can be time-consuming andaffect efficiency.

    The operations are shown in Table 2-6

    Huawei AR150&200 Series Enterprise RoutersConfiguration Guide - Basic Configuration 2 CLI Overview

    Issue 02 (2012-03-30) Huawei Proprietary and ConfidentialCopyright Huawei Technologies Co., Ltd.

    18

  • Table 2-6 Access the previously-used commandsAction Key or Command ResultDisplaypreviously-usedcommands.

    display history-command

    Display previously-used commands entered byusers.

    Access the lastpreviously-usedcommand.

    Up cursor key () orCtrl_P

    Display the last previously-used command if thereis an earlier previously-used command. Otherwise,an alarm is generated.

    Access the nextpreviously-usedcommand.

    Down cursor key() or Ctrl_N

    Display the next previously-used command if thereis a later previously-used command. Otherwise, thecommand is cleared and an alarm is generated.

    NOTE

    Windows 9X defines keys differently and the cursor key is cannot be used with Windows 9XHyperTerminals. You may use Ctrl_P instead.

    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 a

    command is entered in different forms or with different parameters, each entry is consideredto be a different command.For example, if the display ip routing-table command is run several times, only onepreviously-used command is saved. If the display current-configuration command andthe display ip routing-table command are run, two previously-used commands are saved.

    2.4 Shortcut KeysSystem or user-defined shortcut keys make it easier to enter commands.

    2.4.1 Classifying Shortcut KeysThere 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 systemautomatically runs the assigned command. For details about defining the shortcut keys, see2.4.2 Defining Shortcut Keys.

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

    Huawei AR150&200 Series Enterprise RoutersConfiguration Guide - Basic Configuration 2 CLI Overview

    Issue 02 (2012-03-30) Huawei Proprietary and ConfidentialCopyright Huawei Technologies Co., Ltd.

    19

  • NOTE

    Different terminal software defines these keys differently. The shortcut keys on your terminal may bedifferent than those listed in this section.

    Table 2-7 System-defined shortcut keysKey FunctionCTRL_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 KeysIf 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 therights to define shortcut keys.Configure these shortcut keys in the system view.

    Action CommandDefine shortcut keys hotkey { CTRL_G | CTRL_L | CTRL_O | CTRL_U }

    command-text

    Huawei AR150&200 Series Enterprise RoutersConfiguration Guide - Basic Configuration 2 CLI Overview

    Issue 02 (2012-03-30) Huawei Proprietary and ConfidentialCopyright Huawei Technologies Co., Ltd.

    20

  • 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-timeoutl CTRL_O: undo debugging allBy default, CTRL_U is not assigned to any command.When defining shortcut keys, mark the command with double quotation marks if the commandconsists of several words or the command includes spaces, and do not mark the command withdouble quotation marks if the command consists of only one word or the command includes nospace.

    NOTE

    To restore the defaults, run the undo hotkey command.

    2.4.3 Use of Shortcut KeysYou can use a shortcut key at any position where a command can be entered. The system executesan entered shortcut key and displays the corresponding command on the screen exactly as if youhad 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 thesame 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 bufferand logged for fault location and querying.

    NOTE

    The terminal in use may affect the functions of shortcut keys. For example, if customized shortcut keysfor the terminal conflict with those for the router, the input shortcut keys are captured by the terminalprogram and hence the shortcut keys do not function.

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

    Action CommandCheck the usage of shortcut keys. display hotkey

    2.5 Configuration ExamplesThis section provides several examples that illustrate the use of command lines.

    2.5.1 Example for Using TabThis example shows how to use the Tab key. After inputting an incomplete keyword, you canpress Tab and obtain all related keywords or check the accuracy of the input keyword.

    Huawei AR150&200 Series Enterprise RoutersConfiguration Guide - Basic Configuration 2 CLI Overview

    Issue 02 (2012-03-30) Huawei Proprietary and ConfidentialCopyright Huawei Technologies Co., Ltd.

    21

  • ContextYou do not always need to input complete keywords. Instead, input one or more of the firstcharacters of a keyword and press Tab to complete the keyword. The Tab key helps search forand use commands.

    Procedurel Tab can be used in three ways as shown in the following example.

    After the incomplete key word is input and the Tab key is pressed, a unique matchingkey word is displayed.1. Input the incomplete key word.

    [Huawei] info-

    2. Press Tab.The system replaces the incomplete input with a single key word and displays itin a new line with the cursor leaving a space behind.[Huawei] info-center

    After the incomplete key word is input and the Tab key is pressed, several matches aredisplayed or no match is displayed.# Several prefixes beginning with log can follow the keyword info-center.[Huawei] info-center log? logbuffer Setting of log buffer configuration logfile logfile command group loghost Setting of logging host configuration

    1. Input the incomplete key word.[Huawei] info-center log

    2. Press Tab.The system first displays the prefix log.[Huawei] info-center logbuffer

    Press Tab repeatedly to select the keywords one at a time. The cursor is placeddirectly after the end of each keyword.[Huawei] info-center logfile[Huawei] info-center loghost

    Stop pressing Tab after the keyword logfile that you need is displayed.3. Input a space to enter the next word path.

    [Huawei] info-center logfile path

    Input an incorrect keyword and press Tab to check the correctness of the keyword.1. Input a wrong keyword loglog.

    [Huawei] info-center loglog

    2. Press Tab.[Huawei] info-center loglog

    The system displays information in a new line, but the keyword loglog remainsunchanged and there is no space between the cursor and the keyword, indicatingthat this keyword is non-existent.

    ----End

    Huawei AR150&200 Series Enterprise RoutersConfiguration Guide - Basic Configuration 2 CLI Overview

    Issue 02 (2012-03-30) Huawei Proprietary and ConfidentialCopyright Huawei Technologies Co., Ltd.

    22

  • 2.5.2 Example for Using Shortcut KeysIn this example, shortcut keys are assigned to frequently-used commands. You can press theshortcut keys instead of inputting the commands. This facilitates user operations and improvesefficiency.

    ContextIf the login router supports shortcut keys, any user regardless of user level can use these shortcutkeys.

    ProcedureStep 1 Correlate Ctrl_U with the display local-user command and run the shortcut keys.

    system-view[Huawei] hotkey ctrl_u "display local-user"

    NOTE

    When defining shortcut keys for a command, use double quotation marks to quote the command if thecommand consisting of multiple words, which are separated by spaces. No double quotation marks arerequired for single-word commands.

    Step 2 Press Ctrl_U when the prompt [Huawei] appears.[Huawei] display local-user---------------------------------------------------------------------------- User-name State AuthMask AdminLevel ---------------------------------------------------------------------------- admin A H - root A A - ---------------------------------------------------------------------------- Total 2 user(s)

    ----End

    Huawei AR150&200 Series Enterprise RoutersConfiguration Guide - Basic Configuration 2 CLI Overview

    Issue 02 (2012-03-30) Huawei Proprietary and ConfidentialCopyright Huawei Technologies Co., Ltd.

    23

  • 3 Basic ConfigurationAbout This Chapter

    This chapter describes how to configure the router to work properly in the network environmentand to suit your needs.

    3.1 Configuring the Basic System EnvironmentThis section describes how to configure the basic system environment.3.2 Displaying System Status MessagesThis section describes how to use display commands to check basic system configurations.

    Huawei AR150&200 Series Enterprise RoutersConfiguration Guide - Basic Configuration 3 Basic Configuration

    Issue 02 (2012-03-30) Huawei Proprietary and ConfidentialCopyright Huawei Technologies Co., Ltd.

    24

  • 3.1 Configuring the Basic System EnvironmentThis section describes how to configure the basic system environment.

    3.1.1 Establishing the Configuration TaskBefore configuring the basic system environment, familiarize yourself with the applicableenvironment, complete the pre-configuration tasks, and obtain any data required for theconfiguration. This will help you complete the configuration task quickly and correctly.

    Applicable EnvironmentBefore configuring services, you need to configure the basic system environment (such as timeand device name) to meet the environment requirement.

    Pre-configuration TasksBefore configuring the basic system environment, complete the following task:l Powering on the router

    Data PreparationTo configure the basic system environment, you need the following data.

    No. Data1 System time2 Host name3 Login information4 Command level

    3.1.2 Configuring the Equipment NameIf multiple devices on a network need to be managed, set equipment names to identify eachdevice.

    ContextNew equipment names take effect immediately.

    ProcedureStep 1 Run:

    system-view

    Huawei AR150&200 Series Enterprise RoutersConfiguration Guide - Basic Configuration 3 Basic Configuration

    Issue 02 (2012-03-30) Huawei Proprietary and ConfidentialCopyright Huawei Technologies Co., Ltd.

    25

  • The system view is displayed.Step 2 Run:

    sysname host-name

    The equipment name is set.By default, the equipment name of the router is Huawei.You can change the name of the router that appears in the command prompt.----End

    3.1.3 Setting the System ClockThe system clock must be correctly set to ensure synchronization with other devices.

    ContextThe system clock is the time indicated by the system timestamp. Because the rules governinglocal time differ in different regions, the system clock can be configured to comply with therules of any given region.The system clock is calculated using the following formula: System clock = CoordinatedUniversal Time (UTC) + Time zone offset + Daylight saving time offset.Set the system clock to the correct time to ensure that the device operates properly with otherdevices.Perform the following steps in the user view to set the system clock:

    ProcedureStep 1 Run:

    clock datetime HH:MM:SS YYYY-MM-DD

    The current date and time is set.NOTEIf the time zone has not been configured or is set to 0, the date and time set by this command are consideredto be UTC. Set the time zone and UTC correctly.

    Step 2 Run:clock timezone time-zone-name { add | minus } offset

    The time zone is set.l If add is configured, the current time is the UTC time plus the time offset. That is, the default

    UTC time plus offset is equal to the time of time-zone-name.l If minus is configured, the current time is the UTC time minus the time offset. That is, the

    default UTC time minus offset is equal to the time of time-zone-name.Step 3 Run:

    clock daylight-saving-time time-zone-name one-year start-time start-date end-time end-date offset

    orclock daylight-saving-time time-zone-name repeating start-time { { first | second | third | fourth | last } weekday month | start-date } end-time { { first |

    Huawei AR150&200 Series Enterprise RoutersConfiguration Guide - Basic Configuration 3 Basic Configuration

    Issue 02 (2012-03-30) Huawei Proprietary and ConfidentialCopyright Huawei Technologies Co., Ltd.

    26

  • second | third | fourth | last } weekday month | end-date } offset [ start-year [ end-year ] ]

    Daylight saving time is set.By default, daylight saving time is not set.Use one of these modes to configure the starting date and ending date for daylight saving time:date+date, week+week, date+week, and week+date. For details, see clock daylight-saving-time.

    NOTEIf the daylight saving time is used, the clock timezone time-zone-name { add | minus } offset commandcan be executed to set the time zone name. The display clock command displays the daylight saving timename. After the daylight saving time is complete, the original time zone name is displayed.

    ----End

    System Clock DisplayThe system clock is determined by the clock datetime, clock timezone, and clock daylight-saving-time commands.l If none of the preceding three commands have been run, the original system time will be

    displayed after running the display clock command.l The preceding three commands can also be run in combination with one another to

    configure the system clock, as listed in Table 3-1.In the following examples, the original system time is 08:00:00 January 1, 2010.l 1: The clock datetime command is run to set the current date and time to date-time.l 2: The clock timezone command is run to configure the time zone with the time zone offset

    zone-offset.l 3: The clock daylight-saving-time command is run to configure the daylight saving time

    with the offset offset.l [1]: The clock datetime command configuration is optional.

    Table 3-1 System clock configuration examplesOperation Configured System

    TimeExample

    1 date-time Run the clock datetime 8:0:0 2011-11-12command.Configured system time:2011-11-12 08:00:03SaturdayTime Zone(DefaultZoneName): UTC

    2 Original system time +/-zone-offset

    Run the clock timezone BJ add 8 command.Configured system time:2010-01-01 16:00:20+08:00FridayTime Zone(BJ): UTC+08:00

    Huawei AR150&200 Series Enterprise RoutersConfiguration Guide - Basic Configuration 3 Basic Configuration

    Issue 02 (2012-03-30) Huawei Proprietary and ConfidentialCopyright Huawei Technologies Co., Ltd.

    27

  • Operation Configured SystemTime

    Example

    1, 2 date-time +/- zone-offset Run the clock datetime 8:0:0 2011-11-12 andclock timezone BJ add 8 commands.Configured system time:2011-11-12 16:00:13+08:00SaturdayTime Zone(BJ): UTC+08:00

    [1], 2, 1 date-time Run the lock timezone NJ add 8 and clockdatetime 9:0:0 2011-11-12 commands.Configured system time:2011-11-12 09:00:02+08:00SaturdayTime Zone(NJ): UTC+08:00

    3 Original system time ifthe original system timeis not during theconfigured dayli