Professional Documents
Culture Documents
AR2200 Basic Config Guide PDF
AR2200 Basic Config Guide PDF
V200R001C01
Issue 02
Date 2011-10-15
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.
Website: http://www.huawei.com
Email: support@huawei.com
Intended Audience
This document provides the basic concepts, configuration procedures, and configuration
examples in different application scenarios of the Basic configuration supported by the
AR2200 device.
Symbol Conventions
The symbols that may be found in this document are defined as follows.
Symbol Description
Command Conventions
The command conventions that may be found in this document are defined as follows.
Convention Description
&<1-n> The parameter before the & sign can be repeated 1 to n times.
Change History
Changes between document issues are cumulative. Therefore, the latest document version
contains all updates made to previous versions.
Contents
2 CLI Overview.................................................................................................................................6
2.1 CLI Introduction.................................................................................................................................................7
2.1.1 Command Line Interface...........................................................................................................................7
2.1.2 Command Levels.......................................................................................................................................7
2.1.3 Command Line Views.............................................................................................................................10
2.2 Online Help.......................................................................................................................................................11
2.2.1 Full Help..................................................................................................................................................11
2.2.2 Partial Help..............................................................................................................................................12
2.2.3 Error Messages of the Command Line Interface.....................................................................................12
2.3 CLI Features.....................................................................................................................................................13
2.3.1 Editing.....................................................................................................................................................13
2.3.2 Displaying................................................................................................................................................14
2.3.3 Regular Expressions................................................................................................................................14
2.3.4 Previously-Used Commands...................................................................................................................17
2.4 Shortcut Keys...................................................................................................................................................18
2.4.1 Classifying Shortcut Keys.......................................................................................................................18
2.4.2 Defining Shortcut Keys...........................................................................................................................19
2.4.3 Use of Shortcut Keys...............................................................................................................................20
2.5 Configuration Examples...................................................................................................................................20
2.5.1 Example for Using Tab............................................................................................................................21
2.5.2 Example for Using Shortcut Keys...........................................................................................................22
3 Basic Configuration.....................................................................................................................23
3.1 Configuring the Basic System Environment....................................................................................................24
3.1.1 Establishing the Configuration Task.......................................................................................................24
3.1.2 Configuring the Equipment Name...........................................................................................................24
You can log in to a new router through the console port or mini USB port to configure the
router.
1.1 Introduction
You can log in to the device that is powered on for the first time through the console port or mini
USB port to configure the device.
1.2 Logging In to the Device Through the Console Port or Mini USB Port
This section describes how to connect a terminal to a router through the console port or mini
USB port to establish the configuration environment.
1.1 Introduction
You can log in to the device that is powered on for the first time through the console port or mini
USB port to configure the device.
A main control board provides a console port and a mini USB port. To configure a device,
connect the serial port of your terminal to the console port of the device or connect the USB port
of the user terminal to the mini USB port of the device.
NOTE
l If a device is powered on for the first time, you must log in to it through the console port or mini USB
port before logging in to the device using other login modes. For example, before configuring an IP
address to log in to a device using Telnet, log in to the device through the console port or mini USB
port.
l Before logging in to a device through the mini USB port, install the drive application of the mini USB
port on the user terminal.
l The mini USB port and console port cannot be used together.
Applicable Environment
When the router is powered on for the first time, you need to use the console port or mini USB
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 or mini USB port, complete the following
tasks:
To log in to the device through the mini USB interface, install the drive program on the user terminal.
Data Preparation
To log in to the router through the console port or mini USB port, you need the following data.
No. Data
NOTE
When the router is logged in for the first time, the system automatically uses default parameter values.
Procedure
Step 1 Power on all devices to perform a self-check.
Step 2 Connect the console port of the router to the COM port of a PC, or connect the mini USB port
of the router to the USB port of the PC through cables.
NOTE
The mini USB port and console port cannot be used together.
----End
Context
You need to configure terminal attributes for the PC according to the attributes configured for
the console port, including the transmission rate, data bit, parity bit, stop bit, and flow control
mode. As the router is logged in for the first time, every terminal attribute uses the default value
of the router.
Procedure
Step 1 Start a terminal emulator on the PC, and create a new connection, as shown in Figure 1-1.
Step 3 Set communication parameter, same as the default of router,as shown in Figure 1-3.
Step 4 Press Enter. A command line prompt such as <Huawei> appears, and the system asks you to
configure the router. You can enter a command to configure the router. Enter a question mark
(?) whenever you need help.
NOTE
When you connect to the Console port of a AR2200 that does not have a startup configuration file, the
system displays "Warning: Auto-Config is working. 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.
CAUTION
If 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
2 CLI Overview
The command line interface (CLI) is used to configure and maintain devices.
l The system supports the command with a maximum of 512 characters. The command can be
incomplete. You can enter one or more initial characters of the command to match the whole command.
The incomplete command, however, must be unique in the system. For example, to use the display
current-configuration command, enter d cu, di cu, or dis cu. You cannot enter d c or dis c because
they are not unique in the system.
l The system saves the incomplete command to the configuration files in complete form; therefore, the
command may have more than 512 characters. When the system is restarted, however, the incomplete
command cannot be restored. Therefore, pay attention to the length of the incomplete command.
3 Management level Commands of this level are commands that influence the
basic operation of the system and provide support to the
service. They 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, system internal parameter setting
commands, and debugging commands that are used 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 the same 16 levels as the command 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.
3. Enter a desired command level 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.
The following part uses the user, system, and aaa views as an example:
# Establish connection to the router. If the router adopts the default configuration, you can enter
the user view with the prompt of <Huawei>.
<Huawei>
# Run the aaa command in the system view to enter the AAA view.
[Huawei] aaa
[Huawei-aaa]
NOTE
Some commands can be used in both system and other views, but have different effects.
Procedure
l You can obtain the full help of a command line in the following manners.
Enter a question mark (?) in any command line view to display all the commands and
their simple descriptions.
<Huawei> ?
User view commands:
arp-ping ARP-
ping
autosave <Group> 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. If the key word is at
this position, all key words and their 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 interface
describe the keywords respectively.
Enter a command and a question mark (?) separated by a space, and if a parameter is at
this position, the related parameter names and parameter descriptions are displayed. For
example:
[Huawei] ftp timeout ?
INTEGER<1-35791> The value of FTP timeout (in minutes)
[Huawei] ftp timeout 35 ?
<cr> Please press ENTER to execute command
[Huawei] ftp timeout 35
In the preceding display, INTEGER<1-35791> describes the parameter value; The
value of FTP timeout (in minutes) is a simple description of the parameter usage;
<cr> indicates that no parameter is at this position. The command is repeated in the next
command line. You can press Enter to run the command.
----End
Procedure
l You can obtain the partial help of a command line in the following manners.
Enter a character string with a question mark (?) closely following it to display all
commands that begin with this character string.
<Huawei> d?
debugging <Group> 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 with a question mark (?) closely following it
to display all the key words that begin with this character string.
<Huawei> display b?
bfd Specify BFD(Bidirectional Forwarding
Detection
) configuration
information
bgp BGP
information
bootp Bootstrap Protocol
bridge <Group> bridge command group
Enter the first several letters of a key word in the command and then press Tab to display
the complete key word on the condition that the letters uniquely identify the key word.
Otherwise, if you continue to press Tab, different key words are displayed. You can
select the needed key word.
----End
2.3.1 Editing
The editing function of command lines helps you edit command lines or obtain help by using
certain keys.
The command line 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.
Key Function
Common key Inserts a character in the current position of the cursor if the editing
buffer is not full and the cursor moves to the right. Otherwise, an
alarm is generated.
Backspace Deletes the character on the left of the cursor that moves to the
left. When the cursor reaches the head of the command, an alarm
is generated.
Left cursor key or Moves the cursor to the left by the space of a character. When the
Ctrl_B cursor reaches the head of the command, an alarm is generated.
Right cursor key or Moves the cursor to the right by the space of a character. When
Ctrl_F the cursor reaches the end of the command, an alarm is generated.
Key Function
Tab Press Tab after typing the incomplete key word and the system
runs the partial help:
l If the matching key word is unique, the system replaces the
typed one with the complete key word and displays it in a new
line with the cursor a space behind.
l If there are several matches or no match at all, the system
displays the prefix first. Then you can press Tab to view the
matching key word one by one. In this case, the cursor closely
follows the end of the word and you can type a space to enter
the next word.
l If a wrong key word is entered, press Tab and the word is
displayed in a new line.
2.3.2 Displaying
All command lines have the same displaying feature. You can construct the displaying mode as
required.
l If output information cannot be displayed on a full screen, you have three options to view
the information, as shown in Table 2-4.
Key Function
* Matches the preceding element zero 10* matches "1", "10", "100", and
or more times. "1000".
(10)* matches "null", "10", "1010",
and "101010".
+ Matches the preceding element one 10+ matches "10", "100", and
or more times "1000".
(10)+ matches "10", "1010", and
"101010".
? Matches the preceding element zero 10? matches "1" and "10".
or one time. (10)? matches "null" and "10".
[xyz] Matches any single character in the [123] matches the character 2 in
regular expression. "255".
[^xyz] Matches any character that is not [^123] matches any character except
contained within the brackets. for "1", "2", and "3".
[a-z] Matches any character within the [0-9] matches any character ranging
specified range. from 0 to 9.
[^a-z] Matches any character beyond the [^0-9] matches all non-numeric
specified range. characters.
_ Matches a comma "," left brace "{", _2008_ matches "2008", "space
right brace "}", left parenthesis "(", 2008 space", "space 2008", "2008
and right parenthesis ")". space", ",2008,", "{2008}",
Matches the starting position of the "(2008)", "{2008)", and "(2008}".
input string.
Matches the ending position of the
input string.
Matches a space.
NOTE
Unless otherwise specified, all characters in the preceding table are displayed on the screen.
l Degeneration of particular characters
Certain particular characters, when being placed at the following positions in the regular
expression, degenerate to common characters.
The particular characters following "\" is transferred to match particular characters
themselves.
The particular characters "*", "+", and "?" placed at the starting position of the regular
expression. For example, +45 matches "+45" and abc(*def) matches "abc*def".
The particular character "^" placed at any position except for the start of the regular
expression. For example, abc^ matches "abc^".
The particular character "$" placed at any position except for the end of the regular
expression. For example, 12$2 matches "12$2".
The right bracket such as ")" or "]" being not paired with its corresponding left bracket
"(" or "[". For example, abc) matches "abc)" and 0-9] matches "0-9]".
NOTE
Unless otherwise specified, degeneration rules are applicable when preceding regular expressions
serve as subexpressions within parentheses.
l Combination of common and particular characters
In actual application, a regular expression combines multiple common and particular
characters to match certain strings.
CAUTION
The Huawei AR2200 Series uses a regular expression to implement the filtering function of the
pipe character. A display command supports the pipe character only when there is excessive
output information.
When the output information is queried according to the filtering conditions, the first line of the
command output starts with the information containing the regular expression.
The command can carry the parameter | count to display the number of matching entries. The
parameter | count can be used together with other parameters.
For the commands supporting regular expressions, the three filtering methods are as follows:
l | begin regular-expression: displays the information that begins with the line that matches
regular expression.
l | exclude regular-expression: displays the information that excludes the lines that match
regular expression.
l | include regular-expression: displays the information that includes the lines that match
regular expression.
NOTE
By default, the system saves a maximum of 10 previously-used commands for each user. You
can run the history-command max-size size-value command in the user view to set the number
of previously-used commands saved in the system. A maximum of 256 previously-used
commands can be saved in the system.
NOTE
Setting the number of saved previously-used commands to a proper value is recommended. If a large
number of previously-used commands are saved, it will take a long time to locate a needed previously-
used command, affecting efficiency.
Access the last Up cursor key () or Display the last previously-used command if there
previously- Ctrl_P is an earlier previously-used command. Otherwise,
used an alarm is generated.
command.
Access the next Down cursor key Display the next previously-used command if there
previously- () or Ctrl_N is a later previously-used command. Otherwise, the
used command is cleared and an alarm is generated.
command.
NOTE
On the HyperTerminal of Windows 9X, cursor key is invalid as the HyperTerminals of Windows 9X
define the keys differently. In this case, you can replace the cursor key with Ctrl_P.
l The saved previously-used commands are the same as that those entered by users. For
example, if the user enters an incomplete command, the saved command also is incomplete.
l If the user runs the same command several times, the earliest command is saved. If the
command is entered in different forms, they are considered as different commands.
For example, if the display ip routing-table command is run several times, only one
previously-used command is saved. If the display current-configuration command and
the display ip routing-table command are run, two previously-used commands are saved.
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
correlate these shortcut keys with any commands. When the shortcut keys are pressed, the
system automatically runs the corresponding command. For details of defining the shortcut
keys, see 2.4.2 Defining Shortcut Keys.
l System-defined shortcut keys: These shortcut keys with fixed functions are defined by the
system. Table 2-7 lists the system-defined shortcut keys.
NOTE
Different terminal software defines these keys differently. Therefore, the shortcut keys on the terminal may
be different from those listed in this section.
CTRL_Y Deletes all the characters on the place of the cursor and the right
of the cursor.
ESC_F The cursor moves to the right to the end of next word.
Action Command
NOTE
When defining the shortcut keys, use double quotation marks to define the command if this command
contains several commands words, that is, if spaces exist in the command.
NOTE
Using the undo hotkey command, you can restore the default.
l If you have typed part of a command and have not pressed Enter, you can press the shortcut
keys to clear the entered command and display the full corresponding command. This
operation has the same effect as that of deleting all commands and then re-entering the
complete command.
l The shortcut keys are run as the commands, the syntax is recorded to the command buffer
and log for fault location and querying.
NOTE
The terminal in use may affect the functions of the shortcut keys. For example, if the customized shortcut
keys of the terminal conflict with those of 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
Context
Usually, you do not need to input complete keywords. Instead, you can just input one or a few
beginning characters of a keyword and press Tab to complete the keyword. The Tab key helps
search for and use commands.
Procedure
l Tab can be used in three ways as shown in the following example.
The matching key word is unique after the incomplete key word is input.
1. Input the incomplete key word.
[Huawei] info-
2. Press Tab.
The system replaces the input one with the complete key word and displays it in a
new line with the cursor leaving a space behind.
[Huawei] info-center
There are several matches or no match after the incomplete key word is input.
# The keyword info-center can be followed by the following prefixes beginning with
log.
[Huawei] info-center log?
logbuffer Setting of log buffer configuration
logfile <Group> logfile command
group
loghost Setting of logging host configuration
2. Press Tab.
The system first displays the prefix log.
[Huawei] info-center logbuffer
Press Tab repeatedly to select a keyword. The cursor is closely following the end
of the 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 remains
unchanged and there is no space between the cursor and the keyword, indicating
that this keyword is inexistent.
----End
Context
If the login router is defined with shortcut keys, the shortcut keys can be used by any user
regardless of the user level.
Procedure
Step 1 Correlate Ctrl_U with the display local-user command and run the shortcut keys.
<Huawei> 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 the
command consisting of multiple words, which are separated by spaces. No double quotation marks are
required for single-word commands.
----End
3 Basic Configuration
This chapter describes how to configure the router to follow your using habits and the actual
environment requirements after logging in to the router.
Applicable Environment
Before configuring services, you need to configure the basic system environment (such as time
and device name) to meet the environment requirement.
Pre-configuration Tasks
Before configuring the basic system environment, complete the following task:
Data Preparation
To configure the basic system environment, you need the following data.
No. Data
1 System time
2 Host name
3 Login information
4 Command level
Context
The new equipment name takes effect immediately.
Procedure
Step 1 Run:
system-view
Step 2 Run:
sysname host-name
You can change the name of the router that appears in the command prompt.
----End
Context
The system clock displays the current time and date of the system, time zone to which the system
belongs, and daylight saving time. The AR2200 supports the configurations of the time zone
and the daylight saving time.
Procedure
Step 1 Run:
clock datetime HH:MM:SS YYYY-MM-DD
Step 2 Run:
clock timezone time-zone-name { add | minus } offset
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
or
clock daylight-saving-time time-zone-name repeating start-time { { first | second
| third | fourth | last } weekday month | start-date } end-time { { first |
second | third | fourth | last } weekday month | end-date } offset [ start-year
[ end-year ] ]
During the configuration of the daylight saving time, you can configure the starting time and
ending time in one of the following modes: date+date, week+week, date+week, and week+date.
For details, see clock daylight-saving-time.
NOTE
When the daylight saving time is used, the clock timezone time-zone-name { add | minus } offset command
can be executed to set the time zone name. The display clock command displays the daylight saving time
name. After the daylight saving time is complete, the original time zone name is displayed.
----End
Context
A header text is a message displayed by the system when and after a user is logging in to the
router.
If you need to provide information for login users, you can configure a header that the system
displays during login or after login.
Procedure
Step 1 Run:
system-view
CAUTION
l The header text starts and ends with the same character. After a character is input and
Enter is pressed, an interactive interface is displayed. You can input the required information
ended with the first character. The system then exits from the interactive interface.
l If file is specified, save the file containing the header in the root directory of the default
storage medium. If the file is saved in another directory, specify the full path in the file name;
otherwise, the configuration fails.
l If a user logs in to the router by using SSH1.X, the login header is not displayed during login,
but the shell header is displayed after login.
l If a user logs in to the router by using SSH2.0, both login and shell headers are displayed.
----End
Context
If the user allows the undo command to automatically match the previous view and the user
runs the undo command that is not registered in the current view, the system searches the
undo command in the previous view.
Procedure
Step 1 Run:
system-view
NOTE
l The matched upper-view command is valid for current login users who run this command.
l It is not recommended that you configure the undo command to automatically match the upper level
view, unless necessary.
----End
Context
You can use the display commands to collect information about the system status. The display
commands are classified according to the following functions:
See the related sections for display commands for protocols and interfaces. The following part
only shows the system-level display commands.
Prerequisite
Basic configuration are complete.
Procedure
l Run the display version command to display the system version.
l Run the display clock command to display the system time.
l Run the display saved-configuration command to display the original configuration.
l Run the display current-configuration command to display the current configuration.
NOTE
l The display version command can be used to display the software version of the system, the
chassis type, and the information about the main control board and interface board.
When a user runs the display current-configuration command to display configuration
information, other users cannot run the same command until all the command output is displayed.
l The original configuration refers to information about configuration files used by the device when
the device has been powered on and is being initialized. The current configuration refers to the
configuration files taking effect during the device operation. For details, see the chapter
"Configuring System Startup" in the AR2200 Basic-Configuration.
----End
Prerequisite
Basic configurations are complete.
Procedure
l Run the display this command to display the configuration of the current view.
NOTE
When a user runs the display this command to display system status information, other users cannot
run the same command until all the command output is displayed.
----End
Context
When the system fails to perform routine maintenance, you need to collect a lot of information
to locate faults. Then, you have to run different display commands to collect all information. In
this case, you can use the display diagnostic-information command to collect all information
about the current running modules in the system.
Procedure
l Run:
display diagnostic-information
When a user logs in to the router by using the console port, the TTY port, Telnet, or SSH, the
system manages the session between the user and the router on the corresponding user interface.
Each user interface has a corresponding user interface view. A user interface view is a command
line view provided by the system. It is used to configure and manage all the physical and logical
interfaces in asynchronous mode.
l Relative numbering
The relative numbering is in the format of user interface type + number.
The relative numbering is available for interfaces of a specific type. It is used only to specify
one or a group of user interfaces of a specified type. Relative numbering must comply with
the following rules:
Number of the console port: CON 0
Number of the TTY: TTY 0 for the first line, TTY 1 for the second line, and so on
Number of the VTY: VTY 0 for the first line, VTY 1 for the second line, and so on
l Absolute numbering
The absolute numbering is used to uniquely specify a user interface or a group of user
interfaces.
The number starts with 0. The ports are numbered in the sequence of CON TTY
VTY. There is only one console port and 0-20 VTY interfaces (VTY interfaces 0 to 14 are
provided for Telnet/SSH users and VTY interfaces 16 to 20 are provided for network
management users). You can use the user-interface maximum-vty command to set the
maximum number of user interfaces. The default number is five.
By default, the system supports three types of user interfaces: CON, TTY, and VTY.
Table 4-1 shows the absolute numbers of the user interfaces in this system.
0 CON0
NOTE
The absolute numbers allocated for TTY and VTY interfaces are device-specific.
The numbers from 1 to 32 are reserved for the TTY user interfaces.
Run the display user-interface command to view the absolute number of user interfaces.
There are three user authentication modes: non-authentication, password authentication, and
AAA.
l Non-authentication: In this mode, users can log in to the router without entering usernames
or passwords. For security, this mode is not recommended.
l Password authentication: In this mode, users need to enter passwords, not usernames,
during the login process.
l AAA authentication: In this mode, users need to enter passwords and usernames during the
login process. Telnet users are usually authenticated in this mode.
Similar to command levels, users are classified into 16 levels numbered 0 to 15. The greater the
number, the higher the user level.
The level of the command that a user can run is determined by the level of this user.
l In the case of non-authentication or password authentication, the level of the command that
the user can run is determined by the level of the user interface.
l In the case of AAA authentication, the command that the user can run is determined by the
level of the local user specified in the AAA configuration.
Applicable Environment
If you need to log in to the router for local maintenance by using a console port, you can configure
the corresponding console user interface, including the physical attributes, terminal attributes,
user priority, and user authentication mode. The preceding parameters have default values on
the router and additional configuration is not needed. You can configure these parameters as
needed.
Pre-configuration Tasks
Before configuring a console user interface, complete the following tasks:
Data Preparation
To configure a console user interface, you need the following data.
No. Data
1 Baud rate, flow-control mode, parity, stop bit, and data bit
2 Idle timeout period, number of lines displayed in a terminal screen, and the size of
history command buffer
3 User priority
NOTE
All the default values (excluding the password and username) are stored on the router and do not need
additional configuration.
Context
Physical attributes of a console port have default values on the router and no additional
configuration is needed.
NOTE
When a user logs in to a router through a console port, the physical attributes set for the console port on
the HyperTerminal should be consistent with the attributes of the console user interface on the router.
Otherwise, the user cannot log in to the router.
Procedure
Step 1 Run:
system-view
Step 2 Run:
user-interface console interface-number
Step 3 Run:
speed speed-value
Step 4 Run:
flow-control { hardware | none | software }
The flow control mode is set. By default, the flow-control mode is none.
Step 5 Run:
parity { even | none | odd }
Step 6 Run:
stopbits { 1.5 | 1 | 2 }
Step 7 Run:
databits { 5 | 6 | 7 | 8 }
----End
Context
Terminal attributes of the console user interface have default values on the router and you can
set them as needed.
Procedure
Step 1 Run:
system-view
----End
Context
l Similar to command levels, users are classified into 16 levels numbered 0 to 15. The greater
the number, the higher the user level.
l This process is to set the priority for a user who logs in through the console port. A user
can only use the commands with the level corresponding to the user level.
For details about command levels, see "Command Level" in the chapter "CLI Overview" of
the Configuration Guide - Basic Configuration.
Procedure
Step 1 Run:
system-view
NOTE
l By default, users logging in through the console user interface can use commands at level 15, and users
logging in through other user interfaces can use commands at level 0.
l If the command level is inconsistent with the user level, the user level takes precedence.
----End
Context
By default, the user authentication mode of the console user interface is non-authentication.
Procedure
l Configuring AAA Authentication
1. Run:
system-view
Prerequisite
The configurations of the user management function are complete.
Procedure
l Run the display users [ all ] command to check information about the user interface.
l Run the display user-interface console ui-number1 [ summary ] command to check
physical attributes and configurations of the user interface.
l Run the display local-user command to check the local user list.
----End
Example
Run the display users command, and you can view information about the current user interface.
<Huawei> display users
User-Intf Delay Type Network Address AuthenStatus AuthorcmdFlag
0 CON 0 00:00:44 pass no
Username : Unspecified
Run the display user-interface console ui-number1 [ summary ] command, and you can view
the physical attributes and configurations of the user interface.
<Huawei> display user-interface console 0
Idx Type Tx/Rx Modem Privi ActualPrivi Auth Int
0 CON 0 9600 - 3 - N -
+ : Current UI is active.
F : Current UI is active and work in async mode.
Idx : Absolute index of UIs.
Type : Type and relative index of UIs.
Privi: The privilege of UIs.
ActualPrivi: The actual privilege of user-interface.
Auth : The authentication mode of UIs.
A: Authenticate use AAA.
N: Current UI need not authentication.
P: Authenticate use current UI's password.
Int : The physical location of UIs.
Run the display local-user command, and you can view the local user list.
<Huawei> display local-user
----------------------------------------------------------------------------
User-name State AuthMask AdminLevel
----------------------------------------------------------------------------
admin A H -
ftp A F -
guest A A 15
----------------------------------------------------------------------------
Total 3 user(s)
Applicable Environment
If you need to log in to the router for local or remote maintenance by using Telnet or SSH, you
can configure the corresponding VTY user interface, including the maximum number of VTY
user interfaces, limit of incoming and outgoing calls, user priority, and user authentication mode.
The preceding parameters have default values on the router. You can also set these parameters
as needed.
Pre-configuration Tasks
Before configuring VTY user interface, complete the following tasks:
Data Preparation
To configure a VTY user interface, you need the following data.
No. Data
2 (Optional) ACL code to limit VTY user interface to call in and out
3 Idle timeout period, number of characters in each line displayed in a terminal screen
4 User priority
NOTE
All the preceding parameters (excluding the ACL for limiting incoming and outgoing calls in VTY user
interfaces, password, and user name) have default values on the router, and no additional configuration is
needed.
Context
The maximum number of VTY user interfaces is the total number of users logging in to the
router by using Telnet and SSH.
Procedure
Step 1 Run:
system-view
The maximum VTY user interfaces that can log in to the router is set. By default, the maximum
number of VTY users is 5.
NOTE
When the maximum number of VTY user interfaces is set to zero, any user (including the NMS user) cannot
log in to the router by using a VTY user interface.
If the maximum number of VTY user interfaces to be configured is smaller than the maximum
number of current interfaces, current online users will not be affected and no addition
configuration is needed.
If the maximum number of VTY user interfaces to be configured is larger than the maximum
number of current interfaces, the authentication mode and password need to be configured for
newly added user interfaces.
For newly added user interfaces, the system defaults to password authentication.
For example, a maximum of five users are allowed online. To allow 15 VTY users online at the
same time, you need to run the authentication-mode command and the set authentication
password command to configure authentication modes and passwords for user interfaces from
VTY 5 to VTY 14. The command is run as follows:
<Huawei> system-view
[Huawei] user-interface maximum-vty 15
[Huawei] user-interface vty 5 14
[Huawei-ui-vty5-14] authentication-mode password
[Huawei-ui-vty5-14] set authentication password cipher huawei
----End
Context
Before setting the limit on incoming and outgoing calls of the VTY user interface, run the acl
command in the system view to create an ACL and enter the ACL view. Then, run the rule
command to add rules to the ACL.
NOTE
l The user interface supports the basic ACL ranging from 2000 to 2999 and the advanced ACL ranging
from 3000 to 3999.
l For details of ACL configuration, refer to the Huawei AR2200 Series Enterprise Routers Configuration
Guide - Security.
Procedure
Step 1 Run:
system-view
----End
Context
Terminal attributes of the VTY user interface have default values on the router and you can set
them as needed.
Procedure
Step 1 Run:
system-view
Step 5 Run:
screen-length screen-length [temporary]
The parameter temporary is used to display the number of lines to be temporarily displayed on
a terminal screen.
Step 6 Run:
history-command max-size size-value
By default, a maximum number of 10 commands can be cached in the history command buffer.
----End
Context
l Similar to command levels, users are classified into 16 levels numbered 0 to 15. The greater
the number, the higher the user level.
l This process is to set the priority for a user who logs in through the console port. A user
can only use the commands with the level corresponding to the user level.
For details about command levels, see "Command Level" in the chapter "CLI Overview" of
the Configuration Guide - Basic Configuration.
Procedure
Step 1 Run:
system-view
Step 2 Run:
user-interface vty first-ui-number [ last-ui-number ]
Step 3 Run:
user privilege level level
By default, users logging in through the VTY user interface can use commands at level 0.
NOTE
If the command level configured in the VTY user interface view is inconsistent with the user priority, the
user priority takes effect.
----End
Context
By default, the user authentication mode of the VTY user interface is password authentication.
Procedure
l Configuring AAA Authentication
1. Run:
system-view
authentication-mode password
Prerequisite
The configurations of the VTY user interface are complete.
Procedure
l Run the display users [ all ] command to check information about user interfaces.
l Run the display user-interface maximum-vty command to check the maximum number
of VTY user interfaces.
l Run the display user-interface [ [ ui-type ] ui-number1 | ui-number ] [ summary ]
command to check the physical attributes and configurations of user interfaces.
l Run the display local-user command to check the local user list.
l Run the display vty mode command to check the VTY mode.
----End
Example
Run the display users command, and you can view information about the current user interfaces.
<Huawei> display users
User-Intf Delay Type Network Address AuthenStatus AuthorcmdFlag
34 VTY 0 00:00:12 TEL 10.138.77.38 no
Username : Unspecified
+ 35 VTY 1 00:00:00 TEL 10.138.77.57 no
Username : Unspecified
Run the display user-interface maximum-vty command, and you can view the maximum
number of VTY user interfaces.
<Huawei> display user-interface maximum-vty
Maximum of VTY user:15
Run the display user-interface vty [ ui-number1 | ui-number ] [ summary ] command to check
the physical attributes and configurations of user interfaces.
<Huawei> display user-interface vty 0
Idx Type Tx/Rx Modem Privi ActualPrivi Auth Int
+ 34 VTY 0 - 14 14 N -
+ : Current UI is active.
F : Current UI is active and work in async mode.
Idx : Absolute index of UIs.
Type : Type and relative index of UIs.
Privi: The privilege of UIs.
ActualPrivi: The actual privilege of user-interface.
Auth : The authentication mode of UIs.
A: Authenticate use AAA.
N: Current UI need not authentication.
P: Authenticate use current UI's password.
Int : The physical location of UIs.
Run the display local-user command, and you can view the local user list.
<Huawei> display local-user
----------------------------------------------------------------------------
User-name State AuthMask AdminLevel
----------------------------------------------------------------------------
admin A H -
ftp A F -
guest A A 15
----------------------------------------------------------------------------
Total 3 user(s)
Run the display vty mode command, and you can view the prompt message indicating that the
machine-to-machine interface is enabled. For example:
<Huawei> display vty mode
current VTY mode is Machine-Machine interface
Applicable Environment
If you need to log in to the router for local maintenance by using a asynchronous serial port, you
can configure the corresponding TTY user interface, including the physical attributes, terminal
attributes, and user priority. The preceding parameters have default values on the router and
additional configuration is not needed. You can configure these parameters as needed.
Pre-configuration Tasks
Before configuring a TTY user interface, complete the following tasks:
Data Preparation
To configure a TTY user interface, you need the following data.
No. Data
1 Baud rate, flow-control mode, parity, stop bit, and data bit
2 Idle timeout period, number of lines displayed in a terminal screen, and the size of
history command buffer
3 User priority
NOTE
All the default values (excluding the password and username) are stored on the router and do not need
additional configuration.
Context
Physical attributes of an asynchronous serial port have default values on a router and no
additional configuration is needed.
NOTE
l If you need to log in to a router through an asynchronous serial port, install an SA or SA board on the
router. If an SA board installed, set the interface working mode to asynchronous mode on the SA board.
l The Hyper Terminal and router must use the same physical attributes, including the baud rate, flow
control mode, parity mode, stop bit, and data bit. If values of any attributes are different, you cannot
log in to the router.
Procedure
Step 1 Run:
system-view
Step 2 Run:
user-interface TTY interface-number
After a board registers successfully and a serial port on the board is configured to work in
asynchronous mode, the router generates a random TTY number for the asynchronous serial
port. To view the TTY number, run the display user-interface command.
Step 3 Run:
speed speed-value
The flow control mode is set. By default, the flow-control mode is none.
Step 5 Run:
parity { even | none | odd }
----End
Context
Terminal attributes of the TTY user interface have default values on the router and you can set
them as needed.
Procedure
Step 1 Run:
system-view
----End
Context
l Similar to command levels, users are classified into 16 levels numbered 0 to 15. The greater
the number, the higher the user level.
l This process is to set the priority for a user who logs in through the asynchronous serial
port. A user can only use the commands with the level corresponding to the user level.
For details about command levels, see "Command Level" in the chapter "CLI Overview" of
the Configuration Guide - Basic Configuration.
Procedure
Step 1 Run:
system-view
NOTE
l By default, users logging in through the TTY user interface can use commands at level 3, and users
logging in through other user interfaces can use commands at level 0.
l If the command level is inconsistent with the user level, the user level takes precedence.
----End
Procedure
l Configuring AAA authentication
1. Run:
system-view
2. Run:
user-interface tty first-ui-number [ last-ui-number ]
Prerequisite
The configurations of the user management function are complete.
Procedure
l Run the display users [ all ] command to check information about the user interface.
l Run the display user-interface tty ui-number1 [ summary ] command to check physical
attributes and configurations of the user interface.
----End
Example
Run the display users command, and you can view information about the current user interface.
<Huawei> display users
User-Intf Delay Type Network Address AuthenStatus AuthorcmdFlag
0 TTY 0 00:00:44
Username : Unspecified
Run the display user-interface tty ui-number1 [ summary ] command, and you can view the
physical attributes and configurations of the user interface.
Networking Requirements
To initialize configurations of the router or locally maintain the router, a user can log in to the
router through a console user interface. To allow the user to log in, you can set attributes of the
console user interface as needed (for security reasons, for example).
In the console user interface view, the password authentication mode is set (the password is
huawei).
After a user logs in, if the user takes no action on the router for more than 30 minutes, the
connection between the user and the router is torn down.
Configuration Roadmap
The configuration roadmap is as follows:
1. Enter the interface view and set physical attributes of the console user interface.
2. Set terminal attributes of the console user interface.
3. Set the user priority of the console user interface.
4. Set the user authentication mode and password of the console user interface.
By default, the terminal service is enabled on all the user interfaces. If the terminal service is
disabled, run the shell command to enable the terminal service.
Data Preparation
To complete the configuration, you need the following data:
Procedure
Step 1 Set physical attributes of the console user interface.
<Huawei> system-view
[Huawei] user-interface console 0
[Huawei-ui-console0] speed 4800
[Huawei-ui-console0] flow-control none
[Huawei-ui-console0] parity even
[Huawei-ui-console0] stopbits 2
[Huawei-ui-console0] databits 8
Step 3 Set the user authentication mode in the console user interface to password.
[Huawei-ui-console0] authentication-mode password
[Huawei-ui-console0] set authentication password simple huawei
[Huawei-ui-console0] quit
After the console user interface is configured, a user in password authentication mode can log
in to the router through a console port, implementing local maintenance of the router. For details
on how a user logs in to the router, see the 5 Configuring User Login.
----End
Configuration Files
#
sysname Huawei
#
user-interface con 0
authentication-mode password
user privilege level 15
set authentication password simple huawei
history-command max-size 20
idle-timeout 30 0
screen-length 30
databits 8
parity even
stopbits 2
speed 4800
screen-length 30
#
return
Networking Requirements
A user logs in to the router through a VTY channel by using Telnet or SSH. To allow the user
login, an operator can set attributes of the VTY user interface as needed (for security reasons,
for example).
In the VTY user interface, the user priority is set to 15, the authentication mode is set to password,
with the password of "huawei", and the user with the IP address of 10.1.1.1 is prohibitted from
logging in to the router.
After logging in, if the user takes no action on the router for more than 30 minutes, the connection
between the user and the router is torn down.
Configuration Roadmap
The configuration roadmap is as follows:
1. Enter the interface view and set the maximum number of VTY user interfaces to 15.
2. Set the call-in and call-out limit of the VTY user interface, limiting the access of an IP
address or an IP address segment to the router.
3. Set terminal attributes of the VTY user interface.
4. Set the user priority in the VTY user interface.
5. Set the authentication mode and password in the VTY user interface.
Data Preparation
To complete the configuration, you need the following data:
l Maximum number of VTY user interfaces: 15
l ACL applied to limit call-in in the VTY user interface: 2000
l Timeout period for disconnecting from the VTY user interface: 30 minutes
l Number of lines that a terminal screen displays: 30
l Size of the history command buffer: 20
l User priority: 15
l User authentication mode: password, password: huawei
Procedure
Step 1 Set the maximum number of VTY user interfaces.
<Huawei> system-view
[Huawei] user-interface maximum-vty 15
Step 2 Set the limit on call-in and call-out in the VTY user interface.
[Huawei] acl 2000
Step 5 Set the authentication mode and password in the VTY user interface.
[Huawei-ui-vty0-14] authentication-mode password
[Huawei-ui-vty0-14] set authentication password simple huawei
[Huawei-ui-vty0-14] quit
After the VTY user interface is configured, a user authenticated in password mode can log in to
the router by using Telnet or SSH (Stelnet), implementing local or remote maintenance of the
router. For details on how a user logs in to the router, see the 5 Configuring User Login.
----End
Configuration Files
#
sysname Huawei
#
acl number 2000
rule 5 deny source 10.1.1.1 0
#
user-interface maximum-vty 15
user-interface vty 0 14
acl 2000 inbound
user privilege level 15
set authentication password simple huawei
history-command max-size 20
idle-timeout 30 0
screen-length 30
#
return
Networking Requirements
To initialize configurations of the router or locally maintain the router, a user can log in to the
router through a TTY user interface. To allow the user to log in, you can set attributes of the
TTY user interface.
After a user logs in, if the user takes no action on the router for more than 30 minutes, the
connection between the user and the router is torn down.
Configuration Roadmap
The configuration roadmap is as follows:
1. Enter the interface view and set physical attributes of the TTY user interface.
2. Set terminal attributes of the TTY user interface.
3. Set the user priority of the TTY user interface.
NOTE
By default, the terminal service is enabled on all user interfaces. If the terminal service is disabled, run the
shell command to enable the terminal service.
Data Preparation
To complete the configuration, you need the following data:
l Transmission rate of the TTY user interface: 4800 bit/s
l Flow control mode of the TTY user interface: None
l Parity of the TTY user interface: even
l Stop bit of the TTY user interface: 2
l Data bit of the TTY user interface: 6
l Timeout period for disconnecting from the TTY user interface: 30 minutes
l Number of lines that a terminal screen displays: 30
l Size of the history command buffer: 20
Procedure
Step 1 Set physical attributes of the TTY user interface.
<Huawei> system-view
[Huawei] user-interface tty 0
[Huawei-ui-tty1] speed 4800
[Huawei-ui-tty1] flow-control none
[Huawei-ui-tty1] parity even
[Huawei-ui-tty1] stopbits 2
[Huawei-ui-tty1] databits 6
----End
Configuration Files
#
sysname Huawei
#
user-interface TTY 1
user privilege level 15
history-command max-size 20
idle-timeout 30 0
screen-length 30
databits 6
parity even
stopbits 2
speed 4800
screen-length 30
#
return
A user can log in to the router through a console port, or by using Telnet or SSH (STelnet). After
the login, the user can maintain the router locally or remotely.
To configure, monitor, and maintain the local or remote network devices running AR2200, you
need to configure the user interface, the user management, and the terminal service.
The user interface provides a login plane. The user management guarantees the login security
and the terminal service provides related processes of login protocol.
Console port Users log in to the router through the console port to configure the router
locally. Login through the console port is required when the router is
powered on for the first time.
Telnet Users log in to the router by using Telnet for local and remote maintenance.
Telnet helps users maintain remote devices but brings security threats.
SSH (STelnet) SSH (STelnet) provides security protection for users logging in to the
router to maintain the router locally or remotely.
NOTE
Logins by using Telnet bring security risks because no secure authentication mechanism is available and
data is transmitted by using TCP in plain text mode. Unlike Telnet, SSH guarantees secure data transmission
on a conventional insecure network by authenticating the client and encrypting data in both directions. SSH
supports security Telnet (STelnet).
For detailed information about SSH, see the AR2200 Feature Description - Basic Configurations.
Applicable Environment
A user can log in to the router locally through a console port. If the router is powered on for the
first time, the user has to log in through a console port.
Pre-configuration Tasks
Before configuring user login through a console port, complete the following tasks:
l Configuring the PC/terminal (including the serial port and RS-232 cable)
l Installing the terminal emulator (such as HyperTerminal of Windows XP) to the PC
Data Preparation
To configure user login through a console port, you need the following data.
No. Data
1 l Transmission rate, flow control mode, parity mode, stop bit, data bit
l Number of lines displayed in a terminal screen, size of the history command buffer
l User priority
l User authentication mode, user name, and password
Context
Attributes of an console user interface have default values on the router, and generally need no
additional settings. To meet specific application requirements or ensure network security, you
can set attributes of the console user interface, such as terminal attributes and user authentication
mode.
Context
For details, see Login Through the Console Portrouter.
NOTE
l Communication parameters of the user terminal must be consistent with the physical attribute
parameters of the console user interface on the router.
l If a user authentication mode is specified in the console user interface, a user can log in to the router
only after passing the authentication. This enhances network security.
Prerequisite
Configurations of user login through a console port are complete.
Procedure
l Run the display users [ all ] command to check information about the user interface.
l Run the display user-interface console ui-number1 [ summary ] command to check
physical attributes and configurations of the user interface.
l Run the display local-user command to check the local user list.
----End
Example
Run the display users command, and you can view information about the current user interface.
<Huawei> display users
User-Intf Delay Type Network Address AuthenStatus AuthorcmdFlag
0 CON 0 00:00:44 pass no
Username : Unspecified
Run the display user-interface console ui-number1 [ summary ] command, and you can view
the physical attributes and configurations of the user interface.
<Huawei> display user-interface console 0
Idx Type Tx/Rx Modem Privi ActualPrivi Auth Int
0 CON 0 9600 - 3 - N -
+ : Current UI is active.
F : Current UI is active and work in async mode.
Idx : Absolute index of UIs.
Type : Type and relative index of UIs.
Privi: The privilege of UIs.
ActualPrivi: The actual privilege of user-interface.
Auth : The authentication mode of UIs.
A: Authenticate use AAA.
N: Current UI need not authentication.
P: Authenticate use current UI's password.
Int : The physical location of UIs.
Run the display local-user command, and you can view the local user list.
<Huawei> display local-user
----------------------------------------------------------------------------
User-name State AuthMask AdminLevel
----------------------------------------------------------------------------
admin A H -
ftp A F -
guest A A 15
----------------------------------------------------------------------------
Total 3 user(s)
using Telnet. This implements remote maintenance of the router and greatly facilitates device
management.
Applicable Environment
If you have known the IP address of the router to be accessed, you can log in to the router from
a terminal by using Telnet, and remotely maintain the device. This allows you to maintain
multiple routers on the same terminal, greatly facilitating device management.
Note that IP addresses of the routers need to be preset through console ports.
Pre-configuration Tasks
Before configuring user login in Telnet mode, complete the following tasks:
Data Preparation
Before configuring user login in Telnet mode, you need the following data.
No. Data
2 TCP port number for the remote router to provide Telnet services, VPN instance name
Context
By default, the user authentication mode in the VTY user interface is password. Therefore, before
a user logs in to the router by using Telnet, the user authentication mode in the VTY user interface
must be set. Otherwise, the user cannot log in to the router.
You can log in to the router through a console port to set the user authentication mode in the
VTY user interface.
Other attributes of the VTY user interface in the router, such as terminal attributes and user
priorities, can also be set as needed. These attributes, however, generally do not need to be set
because they have default values.
Context
If the user authentication mode of the VTY user interface is non-authentication or password
authentication, the following configurations are not needed.
By default, a local user can apply for any access type. You can specify an access type to allow
only users configured with the specified access type to log in to the router.
Procedure
Step 1 Run:
system-view
Step 2 Run:
aaa
Step 3 Run:
local-user user-name password { simple | cipher } password
----End
Context
By default, the function of the Telnet server is enabled.
Procedure
Step 1 For the IPv4 network
1. Run:
system-view
l If the undo telnet [ipv6] server enable command is run when a user logs in by using Telnet, the
command does not take effect.
l After the Telnet server function is disabled, you can log in to the device only using SSH or an
asynchronous serial port rather than using Telnet.
----End
Context
If you need to log in to the router by using Telnet, you can use either windows command lines
or a third-party software in the terminal. In this part, the windows command line prompt is used.
Do as follows on the user terminal:
Procedure
Step 1 Use the windows command line.
Step 2 Run the telnet ip-address command to telnet the router.
1. Input the IP address of the Telnet server.
2. Press "Enter" to display the command line prompt of the system view, such as
<HUAWEI>. This indicates that you have accessed the Telnet server.
----End
Prerequisite
Configurations of logins by using Telnet are complete.
Procedure
l Run the display users [ all ] command to check information about logged-in users on user
interfaces.
l Run the display tcp status command to check TCP connections.
l Run the display telnet server status command to check the configuration and status of the
Telnet server.
----End
Example
Run the display users command to view information about the currently-used user interface.
<Huawei> display users
User-Intf Delay Type Network Address AuthenStatus AuthorcmdFlag
34 VTY 0 00:00:12 TEL 10.138.77.38 no
Username : Unspecified
+ 35 VTY 1 00:00:00 TEL 10.138.77.57 no
Username : Unspecified
Run the display tcp status command to view TCP connections. In the command output,
Established indicates that a TCP connection has been established.
Run the display telnet server status command to view the configuration and status of the Telnet
server.
<Huawei> display telnet server status
Telnet IPV4 server :Enable
Telnet server port :23
Applicable Environment
Logins by using Telnet bring security risks because no secure authentication mechanism is
available and data is transmitted by using TCP in plain text mode. Unlike Telnet, SSH guarantees
secure data transmission on a conventional insecure network by authenticating the client and
encrypting data in both directions.
STelnet is a secure Telnet protocol. The SSH user can use the STelnet service in the same manner
as using the Telnet service.
Pre-configuration Tasks
Before configuring users to log in by using STelnet, complete the following task:
Data Preparation
To configure users to log in by using STelnet, you need the following data:
No. Data
1 Maximum number of VTY user interfaces, (optional) ACL for limiting call-in and
call-out in VTY user interfaces, connection timeout period of terminal users, number
of rows displayed in a terminal screen, size of the history command buffer, user
authentication mode, user name, and password
No. Data
2 User name, password, authentication mode, and service type of an SSH user and
remote public RSA key pair allocated to the SSH user
3 (Optional) Name of an SSH server, number of the port monitored by the SSH server,
preferred encryption algorithm from the STelnet client to the SSH server, preferred
encrypted algorithm from the SSH server to the STelnet client, preferred HMAC
algorithm from the STelnet client to the SSH server, preferred HMAC algorithm from
the SSH server to the STelnet client, preferred algorithm of key exchange, name of
the outgoing interface, and source address
Context
By default, the user authentication mode in the VTY user interface is password. Therefore, before
a user logs in to the router by using STelnet, the user authentication mode in the VTY user
interface must be set. Otherwise, the user cannot log in to the router.
You can log in to the router through a console port to set the user authentication mode in the
VTY user interface.
Other attributes of the VTY user interface in the router, such as terminal attributes and user
priorities, can also be set as needed. These attributes, however, generally do not need to be set
because they have default values.
For detailed settings, see Configuring VTY User Interface.
Context
By default, user interfaces support Telnet. If no user interface is configured to support SSH,
users cannot log in to the router by using STelnet.
Do as follows on the router that serves as an SSH server:
Procedure
Step 1 Run:
system-view
Step 3 Run:
authentication-mode aaa
Step 4 Run:
protocol inbound ssh
NOTE
If a VTY user interface is configured to support SSH, the VTY user interface must be configured with
AAA authentication. Otherwise, the protocol inbound ssh command cannot be configured.
----End
Context
l SSH users can be authenticated in four modes: RSA, password, password-rsa, and all. You
must create a local user with the specified user name in the AAA view.
l Configuring the router to generate a local RSA key pair is a key step for SSH login. If an
SSH user logs in to an SSH server in password authentication mode, configure the server
to generate a local RSA key pair. If an SSH user logs in to an SSH server in RSA
authentication mode, configure both the server and the client to generate local RSA key
pairs.
NOTE
Password-rsa authentication requires success of both password authentication and RSA authentication. The
all authentication mode requires success of either password authentication or RSA authentication.
Procedure
Step 1 Run:
system-view
Step 2 Run:
aaa
Step 3 Run:
local-user user-name password { simple | cipher } password
NOTE
l Before performing the other SSH configurations, you must configure the rsa local-key-pair create
command to generate a local key pair.
l After generating the local key pair,you can perform the display rsa local-key-pair public command
to view the public key in the local key pair.
Step 6 Run:
ssh user user-name authentication-type { password | rsa | password-rsa | all }
NOTE
l In the public key view, only hexadecimal strings complying with the public key format can be
typed in. Each string is randomly generated on an SSH client. For detailed operations, see manuals
for SSH client software.
l After the public key editing view is displayed, the RSA public key generated on the client can
be sent to the server. Copy the RSA public key to the router that serves as the SSH server.
5. Run:
public-key-code end
----End
Context
By default, no router is enabled with the STelnet server function. Users can establish connections
to the router by using STelnet only after the router is enabled with the STelnet server function.
Do as follows on the router that serves as an SSH server:
Procedure
Step 1 Run:
system-view
----End
Context
Table 5-2 lists server parameters.
Earlier SSH SSH has two versions: SSH1.X (earlier than SSH2.0) and SSH2.0. Compared
version with SSH1.X, SSH2.0 is extended in structure and supports more
compatibility authentication modes and key exchange methods. SSH2.0 also supports more
advanced services such as SFTP. The Huawei AR2200 Series supports SSH
versions ranging from 1.3 to 2.0.
Interval at After the interval is set, the key pair of the SSH server is updated periodically
which the key to improve security.
pair of the
SSH server is
updated
Procedure
Step 1 Run:
system-view
----End
Context
In STelnet login mode, a third-party software can be used in the terminal. In this part, the third-
party software OpenSSH and windows command line are used.
After installing OpenSSH in the user terminal, do as follows on the user terminal:
NOTE
For details on how to install OpenSSH, refer to the installation guide of the software.
For details on how to use OpenSSH commands to log in to the router, refer to the help document of the
software.
Procedure
Step 1 Use the windows command line.
Step 2 Run relevant OpenSSH commands to log in to the router in STelnet mode.
----End
Prerequisite
Configurations of logins by using STelnet are complete.
Procedure
l Run the display ssh user-information username command on the SSH server to check
information about SSH users.
l Run the display ssh server status command on the SSH server to check its configurations.
l Run the display ssh server session command on the SSH server to check sessions for SSH
users.
----End
Example
Run the display ssh user-information username command to view information about a
specified SSH user.
<Huawei> display ssh user-information client001
-------------------------------------------------------------------------------
Username Auth-type User-public-key-name
-------------------------------------------------------------------------------
guest password null
rsa rsa RsaKey001
password password null
-------------------------------------------------------------------------------
If no SSH user is specified, information about all SSH users logging in to an SSH server will be
displayed.
Run the display ssh server status command to view configurations of an SSH server.
<Huawei> display ssh server status
SSH version :1.99
SSH connection timeout :60 seconds
SSH server key generating interval :0 hours
SSH Authentication retries :3 times
SFTP Server :Enable
Stelnet server :Enable
Run the display ssh server session command. The command output shows that the session
information between SSH server and client.
<Huawei> display ssh server session
Session 1:
Conn : VTY 3
Version : 2.0
State : started
Username : client001
Retry : 1
CTOS Cipher : aes128-cbc
STOC Cipher : aes128-cbc
CTOS Hmac : hmac-md5
STOC Hmac : hmac-md5
Kex : diffie-hellman-group-exchange-sha1
Service Type : stelnet
Authentication Type : password
Applicable Environment
To ensure that the operator manages routers safely, you need to configure the switching of user
levels, and enable message sending between user interfaces.
Pre-configuration Tasks
Before performing operations after login, complete the following tasks:
Data Preparations
Before performing operations after login, you need the following data:
No. Data
Context
To prevent an unauthorized user from using high-level commands, a password is required to
increase the user level.
Procedure
Step 1 Run:
system-view
CAUTION
If simple is configured, the password is saved in the configuration file in plain text. This means
that low-level login users can easily obtain and change the password by checking the
configuration file, compromising the network security. Therefore, selecting cipher to save the
password in the cipher text is recommended.
If cipher is used to set the password, the password cannot be obtained from the system. Save
the password to avoid oblivion or missing.
Step 3 Run:
quit
super [ level ]
If the password entered is correct, the user can switch to a higher level. If the user enters a
password incorrectly for three consecutive times, the user remains at the current login level and
returns to the user view.
NOTE
When the login user of lower level is switched to the user of higher level through the super command, the
system automatically sends trap messages and records the switchover in a log. When the switched level
is lower than that of the current level, the system only records the switchover in a log.
----End
Context
The user interface can be classified into the Console user interface and VTY user interface.
Procedure
Step 1 Run:
lock
Step 2 Follow the system prompt and input an unlock password, and then confirm the input.
<Huawei> lock
Enter Password:
Confirm Password:
If the locking is successful, the system prompts that the user interface is locked.
----End
Context
Users logging in to the router can send messages from the current user interface to users in other
user interfaces as needed.
Procedure
Step 1 Run:
send { all | ui-type ui-number | ui-number1 }
----End
Context
User information includes the user name, address, and authentication and authorization
information.
Procedure
l Run the display users [ all ] command to view information about logged-in users.
If all is configured, information about logged-in users on all user interfaces is displayed.
----End
Networking Requirements
If a user modifies default values of certain parameters in the console user interface, the user
needs to reset corresponding parameters in the PC when logging in to the router through the
console port next time.
PC Router
Configuration Roadmap
1. Connect a PC to the router through a console port.
2. Perform login settings on the PC.
3. Log in to the router.
NOTE
Data Preparation
Communication parameters of the PC (baud rate: 4800 bps, data bit: 6, parity: even, stop bit: 2,
flow control mode: none)
Procedure
Step 1 Establish the configuration environment by connecting the serial port of the PC to the console
port of the router through standard RS-232 cable.
Step 2 Start a terminal emulator on the PC, and set the communication parameters of the PC, as shown
in Figure 5-2 to Figure 5-4.
Step 3 Power on the router and wait for the completion of the self-check. After the router starts normally
and finishes the self-check, the system prompts you to press Enter.
Wait till the prompt (mostly the <Huawei>) appears, and then you can use a command to view
the running status of the router or configure the router.
----End
Networking Requirements
You can log in to the router on other network segments through the PC or other terminals to
perform remote maintenance.
Eth1/0/0
202.38.160.92/16
WAN
PC Router Target
Router
Configuration Roadmap
The configuration roadmap is as follows:
1. Establish the physical connection.
2. Set user login parameters.
3. Log in to the router from the client side.
Data Preparation
To complete the configuration, you need the following data
l IP address of the PC
l IP address of the Ethernet interface on the router
l User information (including the user name, password, and authentication mode)
l Reachable route between the PC and target router
Procedure
Step 1 Connect the PC and the router to the network.
Step 2 Set login user parameters on the target router.
# Configure the login address.
<Huawei> system-view
[Huawei] interface gigabitethernet 1/0/0
[Huawei-GigabitEthernet1/0/0] ip address 202.38.160.92 255.255.0.0
[Huawei-GigabitEthernet1/0/0] quit
Click OK.
Enter the user name and password in the login window. After authentication, a command line
prompt such as <Huawei> appears. Enter the configuration environment in the user view.
----End
Networking Requirements
As shown in Figure 5-7, after the STelnet service is enabled on the SSH server, the STelnet
client can log in to the SSH server with the password, RSA, password-rsa, or all authentication
mode.
G E 1 /0 /0
1 0 .1 3 7 .2 1 7 .2 2 3 /1 6
N e tw o rk
PC S S H S e rv e r
Configuration Roadmap
The configuration roadmap is as follows:
1. Configure a local key pair on the SSH server for secure data exchange between the STelnet
client and the SSH server.
2. Configure the VTY user interface on the SSH server.
3. Configure an SSH client, which involves the setting of the user authentication mode, user
name, and password.
4. Enable the STelnet server function on the SSH server and configure a user service type.
Data Preparation
To complete the configuration, you need the following data:
l SSH user authentication mode: password, user name: client001, password: huawei
l User level of client001: 3
l IP address of the SSH server: 10.137.217.223
Procedure
Step 1 Generate a local key pair on the server.
<Huawei> system-view
[Huawei] sysname SSH Server
[SSH Server] rsa local-key-pair create
The key name will be: Huawei_Host
The range of public key size is (512 ~ 2048).
NOTES: If the key modulus is greater than 512,
It will take a few minutes.
Input the bits in the modulus[default = 512]: 768
Generating keys...
.......++++++++++++
..........++++++++++++
...................................++++++++
......++++++++
NOTE
If SSH is configured as the login protocol, the AR2200 automatically disables Telnet.
----End
Configuration Files
l Configuration file of the SSH server
#
sysname SSH Server
#
aaa
local-user client001 password cipher huawei
local-user client001 privilege level 3
local-user client001 service-type ssh
#
interface GigabitEthernet1/0/0
ip address 10.137.217.223 255.255.0.0
#
ssh user client001 authentication-type password
#
user-interface vty 0 4
authentication-mode aaa
protocol inbound ssh
#
return
The file system manages the files and directories in the storage devices on the router. It can move
and delete a file or directory and display the contents of the file.
Logging in to the system You can log in to the system through the
Console or by using Telnet or STelnet to
manage files.
Applicable Environment
When the router fails to save or obtain data, you can log in to the file system to repair the faulty
storage devices or manage files or directories on the router. You can especially manage storage
devices by logging in to the file system.
Pre-configuration Tasks
Before performing file operations by logging in to the file system, complete the following tasks:
Data Preparation
To perform file operations by logging in to the file system, you need the following data:
No. Data
2 Directory name
No. Data
3 File name
Context
When the file system on a storage device fails, the terminal of the router prompts you to rectify
the fault.
NOTE
The storage devices can be flash memory, SD card, or USB flash drive. The router has a built-in flash
memory and a built-in SD card (in slot sd1).
The router provides two reserved USB slots (usb0 and usb1) and an SD card slot (sd0).
Only Huawei-certified storage devices can be used.
You can format a storage device when you fail to repair the file system or you do not need any
data saved on the storage device.
CAUTION
Formatting storage devices may lead to data loss. Therefore, exercise caution when perform this
operation.
Procedure
l Run:
fixdisk device-name
NOTE
After this command is run, if the prompt that the system should be repaired is still received, it indicates
that the physical medium may be damaged.
l Run:
format device-name
NOTE
If the storage device cannot work after running the format device-name command, a fault may occur
to the hardware.
----End
Context
You can manage directories by changing and displaying directories, displaying files in
directories and sub-directories, and creating and deleting directories.
Procedure
l Run:
cd { directory | device-name }
A directory is specified.
l Run:
pwd
----End
Context
l Managing files include: displaying contents, copying, moving, renaming, compressing,
deleting, undeleting, deleting files in the recycle bin, running files in batch and configuring
prompt modes.
l You can run the cd { directory | device-name } command to enter the required directory
from the current directory.
Procedure
l Run:
more [ /binary ] { filename | device-name } [ offset ] [ all ]
By specifying parameters in the more command, you can view files flexibly:
By running the more file-name command, you can view the file named file-name.
Contents of a text file are displayed screen after screen. If you hold and press the
spacebar on the current terminal, all contents of the current file can be displayed.
There are two preconditions if you want to display the contents of a text file screen after
screen:
The value configured by screen-length screen-length temporary command must
be larger than 0.
The total lines of the file must be larger than the value configured by screen-
length command.
By running the more file-name offset command, you can view the file named file-
name. Contents of a text file are displayed from the line specified by offset screen after
screen. If you hold and press the spacebar on the current terminal, all contents of the
current file can be displayed.
There are two preconditions if you want to display the contents of a text file screen after
screen:
The value configured by screen-length screen-length command must be larger than
0.
The result of the number of file characters subtracted by the value of offset must be
larger than the value configured by screen-length command.
By running the more file-name all command, you can view the file named file-name.
Contents of a text file are completely displayed without pausing after each screenful of
information.
l Run:
copy source-filename destination-filename
The file to be copied must be larger than 0 bytes. Otherwise, the operation fails.
l Run:
move source-filename destination-filename
NOTE
If the current directory is not the parent directory, you must operate the file by using the absolute
path.
l Run:
reset recycle-bin [ filename ]
CAUTION
If the prompt is in the quiet mode, no prompt appears for data lossdue to maloperation.
----End
Applicable Environment
When the router serves as the FTP server, after the client logs in to the router through FTP, the
user can transfer files between the client and the server.
Pre-configuration Tasks
Before performing file operations by means of FTP, complete the following task:
Data Preparation
To perform file operations by means of FTP, you need the following data:
NOTE
For FTP secure server connection, perform step 2.
No. Data
1 FTP user name and password, File directory authorized to the FTP user
Context
To perform file operations by means of FTP, you need to configure a local user name and a
password on the router and specify the service type and the directories that can be accessed.
Otherwise, you cannot access the router by using FTP.
Procedure
Step 1 Run:
system-view
NOTE
Step 3 Run:
aaa
----End
Context
By default, the listening port number of an FTP server is 21. Users can directly log in to the
router by using the default listening port number. Attackers probably access the default listening
port, reducing available bandwidth, affecting performance of the server, and causing valid users
unable to access the server. After the listening port number of the FTP server is changed, attackers
do not know the new listening port number. This effectively prevents attackers from accessing
the listening port.
NOTE
Procedure
Step 1 Run:
system-view
If a new number of a monitored port is configured, the FTP server interrupts all the FTP
connections and monitors the port of the new number.
----End
Context
By default, the FTP server is disabled on the router. Therefore, you must enable the FTP server
before using FTP.
Procedure
Step 1 Run:
system-view
Step 2 Run:
ftp server enable
NOTE
When the file operation between clients and the router ends, run the undo ftp server command to disable
the FTP server function. This ensures the security of the router.
----End
Context
l You can configure a source IP address for the FTP server. This limits the destination address
that the client can access and therefore guarantee the security.
l You can configure the timeout period for FTP connections on the FTP server. When the
timeout period of an FTP connection expires, the system breaks the connection to release
resources.
Procedure
Step 1 Run:
system-view
----End
Context
When the routerdevice functions as an FTP server, you can configure an ACL to allow the clients
that meet the matching rules to access the FTP server.
Do as follows on the router that serves as the FTP server:
Procedure
Step 1 Run:
system-view
NOTE
Step 4 Run:
quit
Step 5 Run:
ftp acl acl-number
----End
Context
If you need to log in to the router by using FTP, you can use either windows command line
prompt or a third-party software. Here uses the windows command line prompt as an example.
Procedure
Step 1 Use the windows command line.
Step 2 Run the ftp ip-address command to log in to the router by using FTP.
Enter the user name and password at the prompt, and press Enter. When the windows command
line prompts are displayed in the FTP client view, such as ftp>, you have entered the working
directory of the FTP server.
----End
Context
After logging in to the FTP server, you can perform the following operations:
Procedure
l Configuring data type and transmission mode for the file.
Run:
ascii or binary
FTP supports the ASCII type and the binary type. Their differences are as follows:
l In ASCII transmission mode, ASCII characters are used to separate carriage returned from
line feeds.
l In binary transmission mode, characters can be transferred without format conversion or
formatting.
The selection of the FTP transmission mode is client-customized. The system defaults to the
ASCII transmission mode. The client can use a mode switch command to switch between the
ASCII mode and the binary mode. The ASCII mode is used to transmit .txt files and the binary
mode is used to transmit binary files.
l Upload or download files.
Upload or download a file.
Run:
put local-filename [ remote-filename ]
The FTP file is downloaded from the FTP server and saved to the local file.
l Run one or more commands in the following order to manage directories.
Run:
cd pathname
Run:
mkdir remote-directory
If you need other FTP operations,you can perform the help [ command ] command to get help in the
Windows command line.
----End
Prerequisite
The configuration of the Router to be the FTP Server are complete.
Procedure
l Run the display ftp-server the configuration and running information about the FTP server.
l Run the display ftp-users command to check the login FTP user.
----End
Example
After configuring the FTP server, run the display ftp-server command. You can view that the
FTP server is working.
Run the display ftp-users command to view the user name, port number, authorization directory
of the FTP user configured presently.
<Huawei> display ftp-users
username host port idle topdir
zll 100.2.150.226 1383 3 flash:
Applicable Environment
SSH guarantees secure data transmission on a conventional insecure network by authenticating
the client and encrypting data in both directions. SSH supports SFTP.
SFTP is a secure FTP service and enables users to log in to the FTP server for data transmission.
Pre-configuration Tasks
Before performing file operations by using SFTP, complete the following task:
Data Preparation
Before performing file operations by using SFTP, you need the following data.
No. Data
1 Maximum number of VTY user interfaces, (optional) ACL for limiting call-in and
call-out in VTY user interfaces, connection timeout period of terminal users, number
of rows displayed in a terminal screen, size of the history command buffer, user
authentication mode, user name, and password
2 User name, password, authentication mode, and service type of an SSH user and
remote public RSA key pair allocated to the SSH user, SFTP working directory of
the SSH user
No. Data
4 Name of the SSH server,Number of the port monitored by the SSH server,Preferred
encrypted algorithm from the SFTP client to the SSH server,Preferred encrypted
algorithm from the SSH server to the SFTP client,Preferred HMAC algorithm from
the SFTP client to the SSH server,Preferred HMAC algorithm from the SSH server
to the SFTP client,Preferred algorithm of key exchange,Name of the outgoing
interface,Source address
Context
By default, the user authentication mode in the VTY user interface is password. Therefore, before
a user logs in to the router by using SFTP, the user authentication mode in the VTY user interface
must be set. Otherwise, the user cannot log in to the router.
Other attributes of the VTY user interface in the router, such as terminal attributes and user
priorities, can also be set as needed. These attributes, however, generally do not need to be set
because they have default values.
Context
By default, user interfaces support Telnet. If no user interface is configured to support SSH,
users cannot log in to the router by using SFTP.
Procedure
Step 1 Run:
system-view
Step 2 Run:
user-interface [ vty ] first-ui-number [ last-ui-number ]
Step 3 Run:
authentication-mode aaa
Step 4 Run:
protocol inbound ssh
NOTE
If a VTY user interface is configured to support SSH, the VTY user interface must be configured with
AAA authentication. Otherwise, the protocol inbound ssh command cannot be configured.
----End
Context
l SSH users can be authenticated in four modes: RSA, password, password-rsa, and all. You
must create a local user with the specified user name in the AAA view.
l Configuring the router to generate a local RSA key pair is a key step for SSH login. If an
SSH user logs in to an SSH server in password authentication mode, configure the server
to generate a local RSA key pair. If an SSH user logs in to an SSH server in RSA
authentication mode, configure both the server and the client to generate local RSA key
pairs.
NOTE
Password-rsa authentication requires success of both password authentication and RSA authentication. The
all authentication mode requires success of either password authentication or RSA authentication.
Procedure
Step 1 Run:
system-view
Step 2 Run:
aaa
Step 3 Run:
local-user user-name password { simple | cipher } password
Step 4 Run:
rsa local-key-pair create
NOTE
l Before performing the other SSH configurations, you must configure the rsa local-key-pair create
command to generate a local key pair.
l After generating the local key pair,you can perform the display rsa local-key-pair public command
to view the public key in the local key pair.
Step 5 Run:
ssh user user-name authentication-type { password | rsa | password-rsa | all }
NOTE
l In the public key view, only hexadecimal strings complying with the public key format can be
typed in. Each string is randomly generated on an SSH client. For detailed operations, see manuals
for SSH client software.
l After the public key editing view is displayed, the RSA public key generated on the client can
be sent to the server. Copy the RSA public key to the router that serves as the SSH server.
5. Run:
public-key-code end
l If the specified hex-data is invalid, the public key cannot be generated after the peer-
public-key end command is run.
l If the specified key-name is deleted in other views, the system prompts that the key does
not exist after the peer-public-key end command is run and the system view is
displayed.
6. Run:
peer-public-key end
----End
Context
By default, the router is not enabled with the SFTP server function. Users can establish
connections with the router by using SFTP only after the router is enabled with the SFTP server
function.
Do as follows on the router that serves as an SSH server:
Procedure
Step 1 Run:
system-view
----End
Context
The third-party software can be used to access the router from the user terminal by using SFTP.
Here uses the third-party software OpenSSH and windows command line as an example.
After installing OpenSSH on the user terminal, do as follows on the user terminal:
NOTE
For details on how to install OpenSSH, see the installation guide of the software.
For details on how to use OpenSSH commands to log in to the router, see the help document of the software.
Procedure
Step 1 Use the windows command line.
Step 2 Run relevant OpenSSH commands to log in to the router in SFTP mode.
When the command line prompt is displayed in the SFTP client view, such as sftp>, users have
entered the working directory of the SFTP server.
----End
Context
After logging in to the SFTP server, you can perform the following operations:
After logging in to the SFTP server and entering the SFTP client view, you can perform the
following one or more operations.
Procedure
l Run:
help [ all | command-name ]
----End
Prerequisite
The configuration of SSH Users are complete.
Procedure
l Run the display ssh user-information username command to check the information about
the SSH client on the SSH server.
l Run the display ssh server status command on the SSH server to check its global
configurations.
l Run the display ssh server session command on the SSH server to check information about
connection sessions with SSH clients.
----End
Example
Run the display ssh user-information username command. It shows that the SSH user named
clinet001 is authenticated by password, and its service type is sftp.
[Huawei] display ssh user-information client001
-------------------------------------------------------------------------------
Username Auth-type User-public-key-name
-------------------------------------------------------------------------------
client001 password null
-------------------------------------------------------------------------------
If no SSH user is specified, information about all SSH users logging in to an SSH server will be
displayed.
Run the display ssh server status command to view configurations of an SSH server.
<Huawei> display ssh server status
SSH version : 1.99
SSH connection timeout : 60 seconds
SSH server key generating interval : 2 hours
SSH Authentication retries : 5 times
NOTE
If the default interception port is in use, information about the current interception port is not displayed.
Run the display ssh server session command. The command output shows that the session
information between SSH server and client.
<Huawei> display ssh server session
Session 2:
Conn : VTY 4
Version : 2.0
State : started
Username : client002
Retry : 1
CTOS Cipher : aes128-cbc
STOC Cipher : aes128-cbc
CTOS Hmac : hmac-md5
STOC Hmac : hmac-md5
Kex : diffie-hellman-group-exchange-sha1
Networking Requirements
You can log in to the router through the Console interface, Telnet, or STelnet to perform file
operations on the router.
The file path in the storage device must be correct. If the user does not specify a target file name,
the source file name is the name of the target file by default.
Configuration Roadmap
The configuration roadmap is as follows:
Data Preparation
To complete the configuration, you need the following data:
Procedure
Step 1 Display the file information in the current directory, flash:/ is the flash memory identifier.
<Huawei> dir
Directory of flash:/
Idx Attr Size(Byte) Date Time(LMT) FileName
0 -rw- 1,241 Jun 16 2011 09:15:58 rootcert.pem
1 -rw- 2,688 Apr 27 2011 17:06:50 pat1.pat
2 -rw- 396 Mar 21 2011 08:25:25 rsa_host_key.efs
3 -rw- 540 Mar 21 2011 08:25:43 rsa_server_key.efs
4 -rw- 705 Apr 13 2011 11:23:45 iascfg.zip
5 -rw- 88,942 Jul 01 2011 15:18:22 creat_vlanif.bat
6 -rw- 80,783 Jul 01 2011 16:28:32 undovlanif.bat
7 -rw- 56,523 Jun 15 2011 10:43:50 mon_file.txt
Step 3 Display the file information about the current directory, and you can view that the file is copied
to the specified directory.
<Huawei> dir
Directory of flash:/
----End
Networking Requirements
As shown in Figure 6-1, after the FTP server is enabled on the router, you can log in to the FTP
server from the HyperTerminal to upload or download files.
GE1/0/0
10.137.217.221/16
Network
PC FTP Server
Configuration Roadmap
The configuration roadmap is as follows:
Data Preparation
To complete the configuration, you need the following data:
Procedure
Step 1 Configure the IP address of the FTP server.
[server] interface gigabitethernet1/0/0
[server-GigabitEthernet1/0/0] ip address 10.137.217.221 255.255.0.0
[server-GigabitEthernet1/0/0] quit
Step 3 Configure the authentication information, authorization mode, and authorized directories for an
FTP user on the FTP server.
[server] aaa
[server-aaa] local-user huawei password simple huawei
[server-aaa] local-user huawei service-type ftp
[server-aaa] local-user huawei ftp-directory flash:
[server-aaa] quit
Step 4 Run the FTP commands at the windows command line prompt, and enter the correct user name
and password to set up an FTP connection with the FTP server.
NOTE
You can run the dir command before downloading a file or after uploading a file to view the detailed
information of the file.
----End
Configuration Files
l Configuration file of the FTP server.
#
sysname Server
#
FTP server enable
#
interface GigabitEthernet1/0/0
ip address 10.137.217.221 255.255.0.0
#
aaa
local-user huawei password simple Huawei
local-user huawei service-type ftp
local-user huawei ftp-directory flash:
authentication-scheme default
#
authorization-scheme default
#
accounting-scheme default
#
domain default
#
return
Networking Requirements
As shown in Figure 6-4, after SFTP services are enabled on the router functioning as an SSH
server, you can log in to the server in password, RSA, password-rsa, or all authentication mode
from a PC on the SFTP client.
GE1/0/0
10.137.217.225/16
Network
PC SSH Server
Configuration Roadmap
The configuration roadmap is as follows:
1. Configure a local key pair on the SSH server to securely exchange data between the SFTP
client and the SSH server.
2. Configure VTY user interfaces on the SSH server.
3. Configure an SSH user, including user name and password.
4. Enable SFTP services on the SSH server and configure a user service type.
Data Preparation
To complete the configuration, you need the following data:
l SSH user authentication mode: password, user name: client001, password: huawei
l User level of client001: 3
l IP address of the SSH server: 10.137.217.225
Procedure
Step 1 Configure a local key pair on the SSH server.
<Huawei> system-view
[Huawei] sysname SSH Server
[SSH Server] rsa local-key-pair create
The key name will be: Host
The range of public key size is (512 ~ 2048).
NOTES: If the key modulus is greater than 512,
It will take a few minutes.
Input the bits in the modulus[default = 512]: 768
Generating keys...
.......++++++++++++
..........++++++++++++
...................................++++++++
......++++++++
Step 3 Configure the SSH user name and password on the SSH server.
[SSH Server] aaa
[SSH Server-aaa] local-user client001 password cipher huawei
[SSH Server-aaa] local-user client001 privilege level 3
[SSH Server-aaa] local-user client001 service-type ssh
[SSH Server-aaa] local-user client001 ftp-directory flash:
[SSH Server-aaa] quit
----End
Configuration Files
l Configuration file of the SSH server
#
sysname SSH Server
#
aaa
local-user client001 password cipher huawei
local-user client001 privilege level 3
local-user client001 service-type ssh
local-user client001 ftp-directory flash:
#
interface GigabitEthernet1/0/0
ip address 10.137.217.225 255.255.0.0
#
sftp server enable
#
user-interface vty 0 4
authentication-mode aaa
protocol inbound ssh
#
return
When the router starts, system software is started and configuration files are loaded. To ensure
smooth running of the router, you need to efficiently manage system software and configuration
files.
The extension name of the system software file is .cc. The file must be saved in the root directory
of the storage device.
Users can modify the current configurations of the router through the command line interface.
Use the save command to save the current configuration to the configuration file of the default
storage devices, and the current configuration becomes the initial configuration of the router
when the router is powered on next time.
Applicable Environment
You can manage configuration files by saving, clearing, and comparing configuration files. To
upgrade the router, take preventive measures, repair configuration files, and view configurations
after the router starts, you need to manage configuration files.
Pre-configuration Tasks
Before managing configuration files, complete the following task:
l Installing the router and starting it properly
Data Preparation
To manage configuration files, you need the following data.
No. Data
3 The number of the start line from which the comparison of the configuration files
begins
Context
Run one of the following commands to save configuration files.
Procedure
l Configure the system to periodically save configuration files.
WARNING
If an LPU is not running on the router, related configurations may be lost when the system
automatically saves the configuration file.
1. Run:
autosave interval { time } | { value } | { configuration time }
Context
The configuration file needs to be cleared in the following cases:
l The system software does not match the configuration file after the router has been
upgraded.
l The configuration file is destroyed or an incorrect configuration file has been loaded.
Procedure
l Run the reset saved-configuration command to clear the currently loaded configuration
file.
If the configuration file of the router used for the current startup is the same as that used
for the next startup, running the reset saved-configuration command will clear both
the configuration files. The router will uses the default configuration file for the next
startup.
If the configuration file of the router used for the current startup is different from that
used at the next startup, running the reset saved-configuration command will clear the
configuration file used for the current startup.
If the configuration file of the router used for the current startup is empty, the system
will prompt you that the configuration file does not exist after you run the reset saved-
configuration command.
----End
Context
Do as follows on the router:
Procedure
Step 1 Run:
compare configuration [ configuration-file [ current-line-number save-line-
number ] ]
The current configuration is compared with the configuration file for next startup.
If no parameter is set, the comparison begins with the first lines of configuration files. current-
line-number and save-line-number are used to continue the comparison by ignoring the
differences between the configuration files.
When comparing differences between the configuration files, the system displays the contents
of the current configuration file and saved configuration file from the first different line. By
default, 120 characters are displayed for each configuration file. If the number of characters from
the first different line to the end is less than 120, the contents after the first different line are all
displayed.
In comparing the current configurations with the configuration file for next startup, if the
configuration file for next startup is unavailable or its contents are null, the system prompts that
reading files fails.
----End
Prerequisite
The configuration of managing configuration files are complete.
Procedure
l Run the display current-configuration [ configuration [ configuration-type
[ configuration-instance ] ] | controller | interface [ interface-type [ interface-number ] ] ]
[ feature feature-name [ filter filter-expression ] | filter filter-expression ] or display
current-configuration [ all | inactive ] command to view the current configuration files.
Example
Run the display startup command to check files for startup.
<Huawei> display startup
MainBoard:
Startup system software: usb0:/ar0210_30735_1220.cc
Next startup system software: usb0:/ar0210_30735_1220.cc
Backup system software for next startup: null
Startup saved-configuration file: flash:/arcfg.cfg
Next startup saved-configuration file: flash:/arcfg.cfg
Startup license file: null
Next startup license file: null
Startup patch package: null
Next startup patch package: null
Startup voice-files: null
Next startup voice-files: null
Applicable Environment
To enable the router to provide user-defined configurations during the next startup, you need to
correctly specify the system software and configuration file for the next startup.
Pre-configuration Tasks
Before specifying a file for the system startup, complete the following task:
l Installing the router and powering it on properly
Data Preparation
To specify a file for system startup, you need the following data.
No. Data
7.3.2 Configuring System Software for a router to Load for the Next
Startup
To upgrade the system software of a router, you can specify the AR2200 system software to be
loaded for the next startup.
Context
If no system software is specified for the next startup operation of the router, the system software
loaded this time will be started during the next startup operation. To change system software for
the next startup operation, you need to specify the required one.
The filename extension of the system software must be .cc and must be stored in the root directory
of a storage device.
Procedure
Step 1 Run:
startup system-software filename
The AR2200 system software for the router to load next time when it starts is configured.
----End
7.3.3 Configuring the Configuration File for Router to Load for the
Next Startup
Before restarting a router, you can specify the configuration files that are loaded for the next
startup.
Context
You can run the display startup command on the router to check whether the configuration file
to be loaded during the next startup operation is specified. If no configuration file is specified,
the default configuration file is loaded during the next startup operation.
The filename extension of the configuration file must be .cfg or .zip, and must be stored in the
root directory of a storage device.
When the router turns on, it initiates by reading the configuration file from the flash memory by
default. Thus, the configuration in this configuration file is called initial configuration. If no
configuration file is saved in the flash, the router initiates with default parameters.
Procedure
l Run:
startup saved-configuration configuration-file
Configuration file is saved for the router to load next time on startup.
----End
Prerequisite
The file has been specified for system startup.
Procedure
l Run the display current-configuration [ configuration [ configuration-type
[ configuration-instance ] ] | controller | interface [ interface-type [ interface-number ] ] ]
[ feature feature-name [ filterfilter-expression ] | filterfilter-expression ] command to
check current configurations.
l Run the display saved-configuration [ last | time ] command to check the contents of the
configuration file to be loaded during the next startup.
l Run the display startup command to check information about the files to be used during
the next startup.
----End
Example
Run the display startup command to check information about the files to be used during the
next startup.
<Huawei> display startup
MainBoard:
Startup system software: usb0:/ar0210_30735_1220.cc
Next startup system software: usb0:/ar0210_30735_1220.cc
Backup system software for next startup: null
Startup saved-configuration file: flash:/arcfg.zip
Next startup saved-configuration file: flash:/arcfg.zip
Startup license file: null
Next startup license file: null
Startup patch package: null
Next startup patch package: null
Startup voice-files: null
Next startup voice-files: null
Networking Requirements
After the router is configured, new configurations take effect after the system restarts.
Configuration Roadmap
The configuration roadmap is as follows:
Data Preparation
To complete the configuration, you need the following data:
Procedure
Step 1 Check the configuration file and system software that are used during the current startup.
<Huawei> display startup
MainBoard:
Startup system software: usb0:/ar0312.cc
Next startup system software: usb0:/ar0312.cc
Backup system software for next startup: null
Startup saved-configuration file: flash:/iascfg.zip
Next startup saved-configuration file: flash:/iascfg.zip
Startup license file: null
Next startup license file: null
Startup patch package: null
Next startup patch package: null
Startup voice-files: null
Next startup voice-files: null
The system prompts you whether to save the current configuration to the file named vrpcfg.cfg
on the main control board. After entering y at the prompt, you save the configuration
successfully.
Step 3 Specify the configuration file to be loaded during the next startup of the router.
<Huawei> startup saved-configuration usb0:/arcfg.cfg
Step 4 Specify the system software to be loaded during the next startup of the router.
Specify the system software to be loaded during the next startup of the main control board.
<Huawei> startup system-software usb0:/arsoft.cc
NOTE
The software package arsoft.cc has been loaded to the AR2200. For details on how to upload the software
package, see 6.3 Performing File Operations by Means of FTP.
----End
Configuration Files
None.
To manage configurations or operate files of another device, you can access the device by using
Telnet, STelnet, TFTP, FTP, or SFTP from the device that you have logged in to.
Figure 8-1 Networking diagram for accessing another device from the router
PC Client
As shown in Figure 8-1, when you run the terminal emulation program or Telnet program on a
PC to connect to the router successfully, the router can still function as a client to access another
device on the network by using the following one or more methods.
Telnet Server
PC RouterA RouterB
l Redirection terminal services: You can run the Telnet client program on a PC to log in to
the router through a specified port number. Then connect with the serial interface devices
that are connected with the asynchronous interface of the router, as shown in Figure 8-3.
The typical application is to connect the asynchronous interface of the router with multiple
devices for their remote configuration and maintenance.
Ethernet Router
Async0 Async3
Async1 Async2
NOTE
Only the devices that provide the asynchronous interface support the Telnet redirection service.
l Interruption of Telnet services
In Telnet connection, you can use two types of shortcut keys to interrupt the connection.
As shown in Figure 8-4, Router A logs in to Router B through Telnet, and Router B logs
in to Router C through Telnet. Thus, a cascade network is formed. In this case, Router A
is the client of Router B and Router B is the client of Router C. Figure 8-4 illustrates the
usage of the two types of shortcut keys.
Telnet Telnet
Client Server
NOTE
If the network disconnects, the shortcut keys become invalid. The instruction cannot be sent to the
server.
<Ctrl_T>: The client interrupts the connection.
When the server fails and the client is unaware of the failure, the server does not respond
to the input of the client. In this case, if you press Ctrl_T, the Telnet client interrupts the
connection actively and quits the Telnet connection.
For example:
<RouterC>
Press <Ctrl_T> to directly interrupt the connection and quit Telnet connection.
<RouterA>
CAUTION
When the number of remote login users reaches to the maximum number of VTY user
interfaces, the system prompts that all user interfaces are in use and you cannot use Telnet
to log in.
SSH Overview
When users on an insecure network log in to the router through Telnet, the Secure Shell (SSH)
feature ensures information security and authentication. It protects the router from attacks such
as IP address spoofing and interception of plain text password.
The SSH client function allows users to establish SSH connections with router serving as SSH
server or with UNIX hosts.
logging in to the server through SFTP, the client must be configured with the period of
sending the keepalive packet and the number of times for no reply restriction on the server
if no packet is received by the client. If a client does not receive any packet within specified
period, the client sends a keepalive packet to the server. If the number of times of no reply
restriction exceeds the specified number, the client takes the initiative to release the
connection.
Applicable Environment
Figure 8-5 Networking diagram for accessing another device from the router that you have
logged in to
Network Network
PC RouterA RouterB
As shown in Figure 8-5, you can log in to Router A from a PC by using Telnet, but cannot
manage Router B remotely. This is because there is no reachable route between the PC and
Router B. To manage Router B remotely, you can log in to it from Router A by using Telnet.
In this situation, Router A functions as a Telnet client, and Router B that you attempt to log in
to functions as a server.
Pre-configuration Tasks
Before logging in to another device on the network by using Telnet, complete the following
tasks:
l Ensuring that the router that you attempt to log in to works properly, and enabling Telnet
services on the device
l Ensuring that there is a reachable route between the router that you have logged into and
the router that you attempt to log in to
Data Preparation
To log in to another device by using Telnet, you need the following data:
No. Data
2 Number of the TCP port used by the RouterB to provide Telnet services
Context
An IP address is configured for an interface on the router and functions as the source IP address
of an telnet connection. In this manner, security checks can be implemented.
The source address of a client can be configured as a source interface or a source IP address.
Do as follows on a router that functions as an Telnet client.
Procedure
Step 1 Run:
system-view
----End
Context
Telnet provides an interactive CLI for users to log in to a remote server. Users can log in to a
host, and then remotely log in to another host by using Telnet to configure and manage the remote
host. In this manner, not each host is required to connect to a hardware terminal.
Do as follows on the router that serves as a Telnet client:
Procedure
l Run:
telnet [ vpn-instance vpn-instance-name ] [-a source-ip-address ] host-name
[ port-number ]
Prerequisite
All configurations for logging in to another device are complete.
Procedure
l Run the display tcp status command to check the status of all TCP connections.
----End
Example
Run the display tcp status command to view the status of TCP connections. The Established
status indicates that a TCP connection has been established.
<Huawei> display tcp status
TCPCB Tid/Soid Local Add:port Foreign Add:port VPNID State
39952df8 36 /1509 0.0.0.0:0 0.0.0.0:0 0
Closed
32af9074 59 /1 0.0.0.0:21 0.0.0.0:0 14849
Listening
34042c80 73 /17 10.164.39.99:23 10.164.6.13:1147 0
Established
Applicable Environment
To manage a remote device that can transmit data only through a serial interface, configure the
redirection function on the AR2200.
A remote device can be a router, a switch, an electricity terminal, a finance terminal, or other
terminals that use serial interfaces to transmit data.
l Managing remote routers and switches
Ethernet Router
Async0 Async3
Async1 Async2
As shown in Figure 8-6, there are two routers and two switches connected to the Router
(an AR2200). To manage these devices through their serial interfaces, connect
asynchronous serial interfaces of the Router to serial interfaces of the devices, and configure
the redirection function on the Router. After the configuration is complete, you can use an
operation terminal to manage and maintain these devices remotely.
l Managing terminals such intelligent electricity meters, intelligent water meters, and
automatic teller machines
Nework
Monitor
Device
Router
Async0 Async3
Async2
Async1
As shown in Figure 8-7, the redirection function is enabled on the Router. The Router
listens to the specified TCP port number and receives data flows from the terminals through
asynchronous serial interfaces. After receiving data packets, the Router encapsulates the
packets into Ethernet frames so that they can be transmitted over an Ethernet network. In
this way, the intelligent terminals can be managed by a remote operation terminal.
Pre-configuration Tasks
Before configuring the redirection function, complete the following tasks:
l Starting the remote devices
l Directly connecting the remote devices to the 8AS board of the router through asynchronous
serial cables and ensuring that the 8AS board has registered successfully and the
asynchronous serial interfaces are in Up state
Data Preparation
To configure the redirection function, you need the following data.
No. Data
Prerequisite
The 8AS board on the router has registered successfully and the asynchronous serial interfaces
are in Up state.
Context
Do as follows on the router.
Procedure
Step 1 Run:
system-view
By default, the redirection function is not associated with any VPN instance, and all users on
public and private networks can use the redirection function to log in to remote devices.
The default port number is 2000 plus tty-number. When the default port number is used by
another service, perform this step to set a new port number.
NOTE
l The terminal attributes of a TTY user interface must be the same as the physical attributes of the terminal
connected to the corresponding asynchronous serial interface. For details on how to configure terminal
attributes of a TTY user interface, see 4.4.3 Setting Terminal Attributes of TTY User Interface.
l If the modem function is enabled on a TTY user interface, the redirection function does not take effect.
----End
Follow-up Procedure
Run the telnet host-name port-number command to log in to a remote device. In the command,
host-name is the IP address or host name of the router with the redirection function enabled, and
port-number is the default port number or the port number configured by running the redirect
listen-port command.
Prerequisite
All configurations of the redirection function are complete.
Context
l Run the display tcp status command to check the status of the current TCP connection.
Example
Run the display tcp status to check the TCP connection status.
<Huawei> display tcp status
TCPCB Tid/Soid Local Add:port Foreign Add:port VPNID State
1973f250 9 /2 0.0.0.0:22 0.0.0.0:0 23553 Listening
1973f0ec 9 /1 0.0.0.0:23 0.0.0.0:0 23553 Listening
1973ef88 109/1 0.0.0.0:80 0.0.0.0:0 23553 Listening
1a16a204 9 /14 0.0.0.0:2046 0.0.0.0:0 23553 Listening
1973e9f8 7 /1 0.0.0.0:7547 0.0.0.0:0 0 Listening
1a169c74 9 /15 10.137.217.211:23 10.138.77.61:2120 0 Established
Applicable Environment
Logins by using Telnet bring security risks because no secure authentication mechanism is
available and data is transmitted by using TCP in plain text mode.
STelnet is short for SSH Telnet that is a secure Telnet protocol. STelnet is on the basis of SSH.
SSH users can use STelnet services as Telnet services.
In this configuration, the Router that you have logged in to functions as a Telnet client, and
theRouter that you attempt to log in to functions as an SSH server.
Pre-configuration Tasks
Before logging in to another device by using STelnet, complete the following tasks:
l Configuring a reachable route between the client and SSH server
Data Preparation
To log in to another device by using STelnet, you need the following data:
No. Data
1 Name of the SSH server,Public key that is assigned by the client to the SSH server
2 IPv4 address or host name of the SSH server,Number of the port monitored by the
SSH server,Preferred encrypted algorithm from the SFTP client to the SSH
server,Preferred encrypted algorithm from the SSH server to the SFTP
client,Preferred HMAC algorithm from the SFTP client to the SSH server,Preferred
HMAC algorithm from the SSH server to the SFTP client,Preferred algorithm of key
exchange
The user information for logging in to the SSH server
Context
If the first-time authentication on the SSH client is enabled, the STelnet client does not check
the validity of the RSA public key when logging in to the SSH server for the first time. After
the login, the system automatically allocates the RSA public key and saves it for authentication
in next login.
Procedure
Step 1 Run:
system-view
Step 2 Run:
ssh client first-time enable
NOTE
l The purpose of enabling the first-time authentication on the SSH client is to skip checking the validity
of the RSA public key of the SSH server when the STelnet client logs in to the SSH server for the first
time. The check is skipped because the STelnet server has not saved the RSA public key of the SSH
server.
l If the first-time authentication is not enabled on the SSH client, when the STelnet client logs in to the
SSH server for the first time, the STelnet client fails to pass the check on the RSA public key validity
and cannot log in to the server.
TIP
To ensure that the STelnet client can log in to the SSH server at the first attempt, you can assign the RSA
public key in advance to the SSH server on the SSH client in addition to enabling the first-time
authentication on the SSH client.
----End
Context
If the first-time authentication is not enabled on the SSH client, when the STelnet client logs in
to the SSH server for the first time, the STelnet client fails to pass the check on the RSA public
key validity and cannot log in to the server.So you need to allocate an RSA public key to the
SSH server before the STelnet client logs in to the SSH server.
Procedure
Step 1 Run:
system-view
NOTE
Before being assigned to the SSH server, the assigned peer RSA public key must be obtained from the SSH
server and must be configured on the SSH client. Then, the STelnet client client can successfully undergo
the validity check on the RSA public key of the SSH server.
Step 5 Run:
public-key-code end
l If the specified hex-data is invalid, the public key cannot be generated after the peer-public-
key end command is run.
l If the specified key-name is deleted in other views, the system prompts that the key does not
exist after the peer-public-key end command is run and the system view is displayed.
Step 6 Run:
peer-public-key end
----End
Context
When accessing an SSH server, the STelnet client can carry the source address and the VPN
instance name and choose the key exchange algorithm, encryption algorithm, or HMAC
algorithm, and configure the keepalive function.
Procedure
Step 1 Run:
system-view
----End
Prerequisite
The configurations for logging in to another device by using STelnet are complete.
Procedure
l Run the display ssh server status command to view the status of the SSH server.
----End
Example
Run the display ssh server status to view the status of the SSH server.
<Huawei> display ssh server status
SSH version :1.99
SSH connection timeout :60 seconds
SSH server key generating interval :0 hours
SSH Authentication retries :3 times
SFTP Server :Enable
Applicable Environment
You can transfer files through TFTP between the server and the client in a simple interaction
environment.
The current Router functions as a TFTP client, and theRouter to be accessed functions as a TFTP
server.
Pre-configuration Tasks
Before accessing another device by using TFTP, complete the following tasks:
Data Preparation
To access another device by using TFTP, you need the following data.
No. Data
1 (Optional) Source address or source interface of the router that functions as a TFTP
client
3 Name of the specific file in the TFTP server and the file directory
Context
An IP address is configured for an interface on the router and functions as the source IP address
of a TFTP connection. In this manner, security checks can be implemented.
The source address of a client can be configured as a source interface or a source IP address.
Procedure
Step 1 Run:
system-view
Step 2 Run:
tftp client-source { -a source-ip-address | -i interface-type interface-number }
After the configuration, the source IP address of the TFTP client displayed on the TFTP server
must be the same as the configured one.
----End
Context
An Access Control List (ACL) is a set of sequential rules. These rules are described based on
the source address, destination address, and port number of a packet. Routers use the ACL rules
to filter packets. With the rule applied to the interface on a router, the router permits or denies
the packets.
Each ACL can define multiple rules. ACL rules are classified into the interface ACL, basic ACL,
and advanced ACL based on the functions of ACL rules.
NOTE
TFTP supports only the basic ACL (whose number ranges from 2000 to 2999).
Procedure
Step 1 Run:
system-view
----End
Procedure
l Run:
tftp [ -a source-ip-address | -i interface-type interface-number ] tftp-
server [ public-net | vpn-instance vpn-instance-name ] get source-filename
[ destination-filename ]
Procedure
l Run:
tftp [ -a source-ip-address | -i interface-type interface-number ] tftp-
server [ public-net | vpn-instance vpn-instance-name ] put source-filename
[ destination-filename ]
Prerequisite
Configurations of using the device as a TFTP client are complete.
Procedure
l Run the display tftp-client command to check the device address that is set to the source
address of the TFTP client.
l Run the display acl { name acl-name | acl-number | all } command to check the ACL rule
that is configured on the TFTP client.
----End
Example
Run the display tftp-client command to view the source address of the TFTP client.
<Huawei> display tftp-client
Info: The source address of TFTP client is 1.1.1.1.
Run the display acl{ name acl-name | acl-number | all } to view the ACL rule that is configured
on the TFTP client.
<Huawei> display acl 2001
Basic acl 2001, 2 rules,
Acl's step is 5
rule 5 permit
Applicable Environment
Before transmitting files between a client and a remote FTP server, or managing directories of
the server, you can configure the router that you have logged in to as an FTP client. Then, you
can access the FTP server by using FTP for file transmission or directory management.
Pre-configuration Tasks
Before establishing the configuration task of accessing files on another device by using FTP,
complete the following tasks:
l Configuring a reachable route between the router and the FTP server
Data Preparation
To establish the configuration task of accessing files on another device by using FTP, you need
the following data:
No. Data
2 Host name or IP address of the FTP server, port number of connecting FTP, login
username and password
3 Local file name and file name on the remote FTP server,working directory name of
the remote FTP server, local working directory of the FTP client, or directory name
of the remote FTP server
Prerequisite
An IP address is configured for an interface on the router and functions as the source IP address
of an FTP connection. In this manner, security checks can be implemented.
The source address of a client can be configured as a source interface or a source IP address.
The interface configuration is possible, only if the system has a loopback interface.
Procedure
Step 1 Run:
system-view
NOTE
Then, run the display ftp-client command on the router to view the current configuration of the FTP client.
----End
Context
You can log in to the FTP server in the user view or the FTP view.
Do as follows on the router that serves as the client:
Procedure
l In the user view, establish a connection to the FTP server.
Run:
ftp [ -a source-ip-address | -i interface-type interface-number ] host [ port-
number ] [ public-net | vpn-instance vpn-instace-name ]
2. Run:
open [ -a source-ip-address | -i interface-type interface-number ] host
[ port-number ] [ vpn-instance vpn-instance-name ]
Before logging in to the FTP server, you can run the set net-manager vpn-instance command to
configure a default VPN instance. After that, the default VPN instance is used in the FTP operation.
----End
Context
After logging in to the FTP server, you can perform the following operations:
l Configure a data type for transmission files and a file transmission method.
l Check the online help about FTP commands in the FTP client view.
l Upload local files to the remote FTP server, or download files from the FTP server and
save them locally.
l Create directories on or delete directories from the FTP server.
l Display information about a specified remote directory or a file of the FTP server, or delete
a specified file from the FTP server.
After logging in to the router that functions as a client and entering the FTP client view, you can
perform the following steps:
Procedure
l Configuring data type and transmission mode for the file.
Run:
ascii | binary
FTP supports the ASCII type and the binary type. Their differences are as follows:
l In ASCII transmission mode, ASCII characters are used to separate carriage returned from
line feeds.
l In binary transmission mode, characters can be transferred without format conversion or
formatting.
The selection of the FTP transmission mode is client-customized. The system defaults to the
ASCII transmission mode. The client can use a mode switch command to switch between the
ASCII mode and the binary mode. The ASCII mode is used to transmit .txt files and the binary
mode is used to transmit binary files.
Run:
passive
Run:
verbose
The FTP file is downloaded from the FTP server and saved to the local file.
l Run one or more commands in the following order to manage directories.
Run:
cd pathname
The working path of the FTP server is switched to the upper-level directory.
Run:
pwd
l The directory to be created can comprise letters and digits, but not special characters such as
<, >, ?, \ and :.
l When running the mkdir /abc command, you create a sub-directory named "abc".
l Run one or more commands in the following to manage files.
Run:
ls [ remote-filename ] [ local-filename ]
If the directory name is not specified when a specific remote file is selected, the system
searches the working directory for the specific file.
Run:
dir [ remote-filename ] [ local-filename ]
When local-filename is set, related information about the file can be downloaded locally.
----End
Context
From the AR2200 (an FTP client) that you have logged in to, you can log in to the FTP server
by using another username without logging out of the FTP client view. The established FTP
connection is identical with that established by running the ftp command.
Procedure
l Run:
user user-name [ password ]
The user that have logged in to the FTP server is changed and the new user logs in to the
server.
When the username that is used to log in to the FTP server is changed, the original
connection between the user and the FTP server is interrupted.
----End
Context
You can select different commands to terminate the connection with the FTP server in the FTP
client view.
Procedure
l Run the following commands according to different configurations.
Run:
bye
Or,
quit
Or,
disconnect
Prerequisite
The configurations of accessing other devices by using FTP are complete.
Procedure
l Run the display ftp-client command to view the source parameters of the FTP client.
----End
Example
Run the display ftp-client command to view the source parameters of the FTP client.
<Huawei> display ftp-client
Info: The source address of FTP client is 1.1.1.1.
Applicable Environment
SFTP is short for SSH FTP that is a secure FTP protocol. SFTP is on the basis of SSH. It ensures
that users can log in to a remote device securely for file management and transmission, and
enhances the security in data transmission. In addition, you can log in to a remote SSH server
from the router that functions as an SFTP client.
Pre-configuration Tasks
Before establishing the configuration task of accessing files on another device by using SFTP,
complete the following tasks:
Data Preparation
To access files on another device by using SFTP, you need the following data:
No. Data
1 (Optional) Source address of the device that functions as the SFTP client
3 (Optional) Public key that is assigned by the client to the SSH server
5 Number of the port monitored by the SSH server,Preferred encrypted algorithm from
the SFTP client to the SSH server,Preferred encrypted algorithm from the SSH server
to the SFTP client,Preferred HMAC algorithm from the SFTP client to the SSH
server,Preferred HMAC algorithm from the SSH server to the SFTP client,Preferred
algorithm of key exchange,Name of the outgoing interface,Source address
The user information for logging in to the SSH server
Context
An IP address is configured for an interface on the router and functions as the source IP address
of an FTP connection. In this manner, security checks can be implemented.
The source address of a client can be configured as a source interface or a source IP address.
Procedure
Step 1 Run:
system-view
----End
Context
If the first-time authentication on the SSH client is enabled, the SFTP client does not check the
validity of the RSA public key when logging in to the SSH server for the first time. After the
login, the system automatically allocates the RSA public key and saves it for authentication in
next login.
Do as follows on the router that serves as an SSH client:
Procedure
Step 1 Run:
system-view
NOTE
l The purpose of enabling the first-time authentication on the SSH client is to skip checking the validity
of the RSA public key of the SSH server when the STelnet client logs in to the SSH server for the first
time. The check is skipped because the STelnet server has not saved the RSA public key of the SSH
server.
l If the first-time authentication is not enabled on the SSH client, when the STelnet client logs in to the
SSH server for the first time, the STelnet client fails to pass the check on the RSA public key validity
and cannot log in to the server.
TIP
To ensure that the STelnet client can log in to the SSH server at the first attempt, you can assign the RSA
public key in advance to the SSH server on the SSH client in addition to enabling the first-time
authentication on the SSH client.
----End
Context
If the first-time authentication is not enabled on the SSH client, when the SFTP client logs in to
the SSH server for the first time, the SFTP client fails to pass the check on the RSA public key
validity and cannot log in to the server.
Do as follows on the router functioning as an SSH client:
Procedure
Step 1 Run:
system-view
NOTE
Before being assigned to the SSH server, the assigned peer RSA public key must be obtained from the SSH
server and must be configured on the SSH client. Then, the STelnet client client can successfully undergo
the validity check on the RSA public key of the SSH server.
Step 5 Run:
public-key-code end
Step 6 Run:
peer-public-key end
----End
Context
The command of enabling the SFTP client is similar to that of the STelnet. When accessing the
SSH server, the SFTP can carry the source address and the name of the VPN instance and choose
the key exchange algorithm, encrypted algorithm and HMAC algorithm, and configure the
keepalive function.
Procedure
Step 1 Run:
system-view
Step 2 Run:
sftp [ -a source-address | -i interface-type interface-number ] host-ipv4 [ port ]
[ [ public-net | -vpn-instance vpn-instance-name ] | [ prefer_kex { dh_group1 |
dh_exchange_group } ] | [ prefer_ctos_cipher { des | 3des | aes128 } ] |
[ prefer_stoc_cipher { des | 3des | aes128 } ] | [ prefer_ctos_hmac { sha1 |
sha1_96 | md5 | md5_96 } ] | [ prefer_stoc_hmac { sha1 | sha1_96 | md5 | md5_96 } ] ]
* [ -ki aliveinterval [ -kc alivecountmax ] ]
----End
Context
After logging in to the SSH server from the SFTP client, you can perform the following
operations on the SFTP client:
l Create or delete a directory on the SSH server, and display the current working directory,
the specified directory and information about the file in the specified directory.
l Change a file name, delete a file, display a file list, and upload or download a file.
l Displaying the SFTP client command help.
After logging in to the router that functions as an SSH client and entering the SFTP client view,
you can perform the following steps:
Procedure
l Managing the directory
Run:
cd [ remote-directory ]
Run:
rename old-name new-name
----End
Prerequisite
The configuration of accessing files on another device by using SFTP is complete.
Procedure
l Run the display sftp-client command to check the source IP address of the SFTP client on
the SSH client.
----End
Example
Run the display sftp-client command on the client to view the source parameters of the device
functioning as an SFTP client.
<Huawei> display sftp-client
Info: The source address of SFTP client is 1.1.1.1
Networking Requirements
As shown in Figure 8-8, Router A and Router B can ping each other successfully. A user logs
in to Router B from Router A using Telnet.
RouterA RouterB
Configuration Roadmap
The configuration roadmap is as follows:
1. On Router B, configure the authentication mode and password for VTY0 to VTY4.
2. Configure users to use passwords to log in to Router B from Router A using Telnet.
3. Configure a Telnet server port number on Router B to ensure that users log in through this
port only.
Data Preparation
To complete the configuration, you need the following data:
l Host address of Router B
l Authentication mode and password
l Telnet server port number
l User level 15
Procedure
Step 1 Configure IP addresses.
# Configure Router A.
<Huawei> system-view
[Huawei] sysname RouterA
[RouterA] interface gigabitethernet1/0/0
[RouterA-GigabitEthernet1/0/0] ip address 1.1.1.1 24
[RouterA-GigabitEthernet1/0/0] quit
[RouterA] quit
# Configure Router B.
<Huawei> system-view
[Huawei] sysname RouterB
[RouterB] interface gigabitethernet1/0/0
[RouterB-GigabitEthernet1/0/0] ip address 1.1.1.2 24
[RouterB-GigabitEthernet1/0/0] quit
Step 2 Configure the authentication mode and password for Telnet services on Router B.
[RouterB] user-interface vty 0 4
[RouterB-ui-vty0-4] authentication-mode password
[RouterB-ui-vty0-4] set authentication password simple hello
[RouterB-ui-vty0-4] quit
To configure an ACL for Telnet services, run the following commands on Router B.
[RouterB] acl 2000
[RouterB-acl-basic-2000] rule permit source 1.1.1.1 0
[RouterB-acl-basic-2000] quit
[RouterB] user-interface vty 0 4
[RouterB-ui-vty0-4] acl 2000 inbound
NOTE
>>User password:
<RouterB>
Step 5 Use the port number 1028 to log in to Router B from Router A using Telnet.
<RouterA> telnet 1.1.1.2 1028
Press CTRL_] to quit telnet mode
Trying 1.1.1.2 ...
Connected to 1.1.1.2 ...
>>User password:
<RouterB>
----End
Configuration Files
l Configuration file of Router A
#
sysname RouterA
#
interface GigabitEthernet1/0/0
ip address 1.1.1.1 255.255.255.0
#
return
Networking Requirements
As shown in Figure 8-9, RouterB fails and users can only log in to it through the console port.
Only users in VPN instance vpna are allowed to log in to RouterB. There is a reachable route
between vpna and RouterA.
Connect the console port of RouterB to an asynchronous serial interface of RouterA, enable the
redirection function on RouterA, and associate the redirection function with vpna. The users in
vpna can use a specified port number to log in to RouterB.
GE0/0/1
10.1.1.1/24
vpna Async2/0/1
Network
Console
PC RouterA RouterB
Configuration Roadmap
The configuration roadmap is as follows:
1. Connect the console port of RouterB to an asynchronous serial interface of RouterA.
2. Enable the redirection function on RouterA.
Data Preparation
To complete the configuration, you need the following data:
l IP address of the network-side interface on RouterA: 10.1.1.1/24
Procedure
Step 1 Configure the asynchronous serial interface to work in flow mode.
<Huawei> system-view
[Huawei] sysname RouterA
[RouterA] interface async 5/0/1
[RouterA-Async5/0/1] async mode flow
Step 2 Obtain the TTY user interface number corresponding to the asynchronous serial interface.
[RouterA] display user-interface
Idx Type Tx/Rx Modem Privi ActualPrivi Auth Int
0 CON 0 9600 - 15 - N -
41 TTY 41 9600 input 0 - N 5/0/0
F 42 TTY 42 9600 - 0 - N 5/0/1
Step 3 Enable the redirection function on RouterA and associate the redirection function with the VPN
instance vpna.
[RouterA] user-interface tty 42
[RouterA-ui-tty42] undo shell
[RouterA-ui-tty42] redirect enable
[RouterA-ui-tty42] redirect binding vpn-instance vpna
[RouterA-ui-tty42] quit
[RouterA] quit
NOTE
If the redirection function is not associated with the VPN instance to which the private users belong, all
users on public and private networks can log in to RouterB.
Step 4 Check the port number allocated to the TTY user interface.
<RouterA> display tcp status
TCPCB Tid/Soid Local Add:port Foreign Add:port VPNID State
19fde824 9 /2 0.0.0.0:22 0.0.0.0:0 23553 Listening
19fde6c0 9 /1 0.0.0.0:23 0.0.0.0:0 23553 Listening
19fde130 109/1 0.0.0.0:80 0.0.0.0:0 23553 Listening
19fdef18 9 /4 0.0.0.0:2042 0.0.0.0:0 23553 Listening
19fde55c 7 /1 0.0.0.0:7547 0.0.0.0:0 0 Listening
19fdf07c 9 /9 10.137.217.211:23 10.138.77.61:2567 0 Established
19fdf344 9 /10 10.137.217.211:23 10.138.77.69:2824 0 Time_Wait
----End
Configuration Files
l Configuration file of RouterA
#
sysname RouterA
#
ip vpn-instance
vpna
ipv4-
family
route-distinguisher 1:1
vpn-target 111:1 export-extcommunity
vpn-target 111:1 import-
extcommunity
#
interface Async5/0/1
async mode flow
#
interface GigabitEthernet 0/0/1
ip binding vpn-instance vpna
ip address 10.1.1.1 255.255.255.0
#
user-interface tty 42
undo shell
redirect enable
redirect binding vpn-instance vpna
#
return
Networking Requirements
As shown in Figure 8-10, after the STelnet service is enabled on the SSH server, the STelnet
client can log in to the SSH server with the password, RSA, password-rsa, or all authentication
mode.
Configure two login clients:
l Configure Client001 with the password as huawei and adopt the password authentication.
l Configure Client002, adopt the RSA authentication and assign the public key RsaKey001
to Client002.
The user interface supports only SSH.
Figure 8-10 Networking diagram of configuring the device as the STelnet client to connect to
the SSH server
SSH Server
GE1/0/0
10.164.39.222/24
GE1/0/0 GE1/0/0
10.164.39.220/24 10.164.39.221/24
Client001 Client002
Configuration Roadmap
The configuration roadmap is as follows:
Data Preparation
To complete the configuration, you need the following data:
l Name and the authentication mode of the SSH user
l Password or the RSA public key of the SSH user
l Name of the SSH server
Procedure
Step 1 Generate a local key pair on the SSH server.
<Huawei> system-view
[Huawei] sysname SSH Server
[SSH Server] rsa local-key-pair create
The key name will be: Host
The range of public key size is (512 ~ 2048).
NOTES: If the key modulus is greater than 512,
It will take a few minutes.
Input the bits in the modulus[default = 512]: 768
Generating keys...
.......++++++++++++
..........++++++++++++
...................................++++++++
......++++++++
Step 4 Bind the RSA public key of the SSH client to Client002.
[SSH Server] ssh user client002 assign rsa-key RsaKey001
# Log in to the SSH server from Client001 in password authentication mode by entering the user
name and password.
<client001> system-view
[client001] stelnet 10.164.39.222
Please input the username:client001
Trying 10.164.39.222 ...
Press CTRL+K to abort
Connected to 10.164.39.222 ...
Enter password:
Enter the password huawei. The following information indicates that the login succeeds.
Info: The max number of VTY users is 20, and the number
of current VTY users on line is 6.
The current login time is 2010-09-06 11:42:42.
<SSH Server>
----End
Configuration Files
l Configuration file of the SSH server
#
sysname SSH Server
#
rsa peer-public-key rsakey001
public-key-code begin
3047
0240
BFF35E4B C61BD786 F907B5DE 7D6770C3 E5FD17AB 203C8FCB BBC8FDF2 F7CB674E
519E8419 0F6B97A8 EA91FC4B B9E18836 5E74BFD5 4C687767 A89C6B43
1D7E3E1B 0203
010001
public-key-code end
peer-public-key end
#
aaa
local-user client001 password cipher huawei
local-user client002 password cipher huawei
local-user client001 service-type ssh
local-user client002 service-type ssh
#
ssh user client002 authentication-type rsa
ssh user client002 assign rsa-key RsaKey001
#
user-interface vty 0 4
authentication-mode aaa
protocol inbound ssh
#
return
Networking Requirements
As shown in Figure 8-11, the IP address of the TFTP server is 10.111.16.160/24.
Log in to the router from the HyperTerminal and then download the file ar.cc from the TFTP
server.
Configuration Roadmap
The configuration roadmap is as follows:
1. Run the TFTP application on the TFTP server, and set the location of the file on the server.
2. Use the TFTP command on the router to download the file.
3. Use the TFTP command on the router to upload the file.
Data Preparation
To complete the configuration, you need the following data:
l The TFTP application installed on the TFTP server
l The path of the file on the TFTP server
l The destination file name and its path on the router
Procedure
Step 1 Start the TFTP server, and set its Current Directory as the directory where the ar.cc file resides.
Figure 8-12shows the interface.
NOTE
The display may be different depending on different TFTP server applications run in the computer.
Step 2 Log in to the router from the computer HyperTerminal and enter the following command to
download the file.
<Huawei> tftp 10.111.16.160 get ar.cc sd1:/
Info: Transfer file in binary mode.
Downloading the file from the remote TFTP server. Please wait...
69143936 bytes received in 42734
second.
TFTP: Downloading the file successfully.
Step 3 Run the dir command to check whether the downloaded file is saved in the specified directory
on the router.
<Huawei> dir sd1:/
Directory of sd1:/
Step 4 Log in to the router from the computer HyperTerminal and enter the following command to
upload the file.
----End
8.8.5 Example for Connecting the SFTP Client to the SSH Server
In this example, the local key pairs are generated on the SFTP client and the SSH server
respectively; the public RSA key is generated on the SSH server and bind the RSA public key
to the SFTP client. In this manner, the SFTP client can connect to the SSH server.
Networking Requirements
As shown in Figure 8-13, after the SFTP service is enabled on the SSH server, the SFTP Client
can log in to the SSH server with the password, RSA, password-rsa, or all authentication.
Figure 8-13 Networking diagram of connecting the SFTP client to the SSH server
SSH Server
GE1/0/0
10.164.39.222/24
GE1/0/0 GE1/0/0
10.164.39.220/24 10.164.39.221/24
Client001 Client002
Configuration Roadmap
The configuration roadmap is as follows:
1. Configure Client001 and Client002 on the SSH server.
2. Generate the local key pairs on the SFTP client and SSH server .
3. Generate the RSA public key on the SSH server and bind the RSA public key of SSH client
to Client002.
4. Enable the SFTP service on the SSH server.
5. Configure the service mode and authorization directory for the SSH user.
6. Client001 and Client002 log in to the SSH server through SFTP.
Data Preparation
To complete the configuration, you need the following data:
l Name and the authentication mode of the SSH user
l Password or the RSA public key of the SSH user
Procedure
Step 1 Generate a local key pair on the SSH server.
<Huawei> system-view
[Huawei] sysname SSH Server
[SSH Server] rsa local-key-pair create
The key name will be: Host
The range of public key size is (512 ~ 2048).
NOTES: If the key modulus is greater than 512,
It will take a few minutes.
Input the bits in the modulus[default = 512]: 768
Generating keys...
.........++++++++
......................++++++++
......................+++++++++
.....+++++++++
0240
BFF35E4B C61BD786 F907B5DE 7D6770C3 E5FD17AB
203C8FCB BBC8FDF2 F7CB674E 519E8419 0F6B97A8
EA91FC4B B9E18836 5E74BFD5 4C687767 A89C6B43
1D7E3E1B
0203
010001
=====================================================
Time of Key pair created: 2007-12-29 16:20:05+08:00
Key name: Server
Key type: RSA encryption Key
=====================================================
Key code:
3067
0260
BCFAC085 49A2E70E 1284F901 937D7B63 D7A077AB
D2797280 4BCA86C0 4CD18B70 5DFAC9D3 9A3F3E74
9B2AF4CB 69FA6483 E87DA590 7B47721A 16391E27
1C76ABAB 743C568B 1B35EC7A 8572A096 BCA9DF0E
BC89D3DB 5A83698C 9063DB39 A279DD89
0203
010001
[client002]
Step 4 Bind the RSA public key of the SSH client to Client002.
[SSH Server] ssh user client002 assign rsa-key RsaKey001
----End
Configuration Files
l Configuration file of the SSH server.
#
sysname SSH Server
#
rsa peer-public-key rsakey001
public-key-code begin
3047
0240
C4989BF0 416DA8F2 2675910D 7F2997E8 5573A35D 0163FD4A FAC39A6E 0F45F325
A4E3AA1D 54692B04 C6A28D3D C58DE2E8 E0D58D65 7A25CF92 A74D21F9 E917182B
0203
010001
public-key-code end
peer-public-key end
#
aaa
local-user client001 password simple huawei
local-user client001 service-type ssh
local-user client001 ftp-directory flash:
local-user client002 ftp-directory flash:
#
sftp server enable
ssh user client002 authentication-type rsa
ssh user client002 assign rsa-key RsaKey001
#
user-interface vty 0 4
authentication-mode aaa
protocol inbound ssh
#
Return
Networking Requirements
When an RADIUS user is connected to an SSH server, the SSH server sends the user name and
password of the SSH client to the RADIUS server (compatible with the TACACS server) for
authentication.
The RADIUS server authenticates the user and sends the result (passed or failed) back to the
SSH server. If the authentication is successful, the user level is sent along with the result. The
SSH server determines whether the SSH client is allowed to set up a connection according to
the authentication result.
Figure 8-14 shows the networking diagram.
GE1/0/0
10.164.39.221/24 10.164.6.49/24
SSH Client SSH Server Radius Server
Configuration Roadmap
The configuration roadmap is as follows:
1. Configure the RADIUS template on the SSH server.
2. Configure a domain on the SSH server.
3. Create a user on the RADIUS server.
4. Generate the local key pair on STelnet client and SSH server respectively.
5. Generate the local key pair on the client and SSH server .
6. Generate the RSA public key on SSH server and bind the RSA public key of the SSH client
to ssh2@ssh.com.
7. Enable the STelnet and SFTP services on the SSH server.
8. Configure the service mode and authorization directory of the SSH user.
9. Users ssh1@ssh.com and ssh2@ssh.com log in to the SSH server through STelnet and
SFTP respectively.
Data Preparation
To complete the configuration, you need the following data:
Procedure
Step 1 Generate a local key pair on the SSH server.
<Huawei> system-view
[Huawei] rsa local-key-pair create
The key name will be: Host
The range of public key size is (512 ~ 2048).
NOTES: If the key modulus is greater than 512,
It will take a few minutes.
Input the bits in the modulus[default = 512]: 768
Generating keys...
.......++++++++++++
..........++++++++++++
...................................++++++++
......++++++++
# Create users ssh1@ssh.com and ssh2@ssh.com on the SSH server and set the authentication
mode.
[Huawei] aaa
[Huawei-aaa] local-user ssh1@ssh.com password cipher huawei
[Huawei-aaa] local-user ssh2@ssh.com password cipher huawei
[Huawei-aaa] quit
# Specify the RADIUS server at 10.164.6.49 as the RADIUS authentication and set the
authentication port number to 1812.
[Huawei-radius-ssh] radius-server authentication 10.164.6.49 1812
# Enable initial authentication on the SSH client if it logs in for the first time.
[client] ssh client first-time enable
[client] quit
# Log in to the SSH server from the STelnet client in RADIUS authentication mode.
<client> system-view
[client] stelnet 10.164.39.222
Please input the username: ssh1@ssh.com
Trying 10.164.39.222 ...
Press CTRL+K to abort
Connected to 10.164.39.222 ...
The server is not authenticated. Do you continue to access it?(Y/N):y
Save the server's public key? [Y/N] :y
The server's public key will be saved with the name: 10.164.39.222. Please wait...
Enter password:
Enter the password huawei. The following information indicates that the login succeeds.
Info: The max number of VTY users is 10, and the current number
of VTY users on line is 2.
<Huawei>
# Log in to the SSH server from the SFTP client in RADIUS authentication mode.
<client> system-view
[client] sftp 10.164.39.222
Please input the username: ssh2@ssh.com
Trying 10.164.39.222 ...
Press CTRL+K to abort
Connected to 10.164.39.222 ...
Enter password:
sftp-client>
----End
Configuration Files
Configuration file of the SSH server
#
radius-server template ssh
radius-server authentication 10.164.6.49 1812
#
rsa peer-public-key rsakey001
public-key-code begin
3047
0240
C4989BF0 416DA8F2 2675910D 7F2997E8 5573A35D 0163FD4A FAC39A6E 0F45F325
A4E3AA1D 54692B04 C6A28D3D C58DE2E8 E0D58D65 7A25CF92 A74D21F9 E917182B
0203
010001
public-key-code end
peer-public-key end
#
aaa
authentication-scheme newscheme
authentication-mode radius
#
domain ssh.com
authentication-scheme newscheme
radius-server ssh
#
sftp server enable
ssh user ssh1@ssh.com
ssh user ssh2@ssh.com
ssh user ssh2@ssh.com assign rsa-key RsaKey001
#
user-interface vty 0 4
authentication-mode aaa
protocol inbound ssh
#
return
Upgrade and maintenance of the router can optimize device performance, monitor device
operation status, simplify operation and maintenance, and reduce carriers' Operation
Expenditure (OPEX).
If new devices are deployed, you can purchase new licenses as needed to enable license-
controlled features and functions on the devices. This reduces purchase costs. If the capacities
of the existing devices are expanded, you can update the licenses used on the devices to enable
more license-controlled features and functions.
Software upgrade involves software downloading and software loading. Software downloading
includes:
l Remote downloading
l Local downloading
During device operation, the system software may need to be modified due to system bugs or
new function requirements. The traditional way is to upgrade the system software after powering
off the device. This, however, interrupts services and affects QoS.
By means of patch management, the system software can be upgraded in service without
interrupting services.
None A patch file is saved to the storage The patch file will be in the running
medium but has not been loaded to state after being loaded from the
the patch area in memory. storage medium to the patch area in
memory.
Running A patch file is in the running state A patch file in the running state can
when it is stored in the patch area be deleted from the patch area in
and run permanently. If a board is memory.
reset, the patch files in the running
state on the board remain in the
running state.
Upload and
Run patch
Patch Status: Patch Status:
none running
Delete patch
Applicable Environment
l Activating a new GTL license for the first time
If you have purchased a new device, you need to apply for and purchase a GTL license file
to obtain the authorization of related service modules. After the GTL license file is
activated, the license-controlled service modules can be used.
l Activating an updated GTL license file
If a device has an activated GTL license file but the GTL license file has expired, you need
to apply for a new GTL license file, update it, and then activate it. Otherwise, the GTL
license file will become invalid upon expiration. As a result, function modules will be
disabled and services will be interrupted.
Before updating a GTL license file, check whether a new GTL license needs to be applied
for. If the authorization value of the new GTL license file is smaller than that of the current
GTL license file, an interactive message is displayed to prompt you whether to activate the
new GTL license file.
If you enter Y, the system informs you of a GTL license file update success.
If you enter N, the system informs you of a GTL license update failure, and displays
the status of the current GTL license file.
Before activating a GTL license file, check that the GTL license file is suffixed with .dat. After
obtaining a GTL license file, use a notepad program to check whether the ESN on the MPU is
the same as that in the GTL license file.
NOTE
A GTL license file has two versions, namely, Demo and Comm.
The reservation period refers to the number of days for which you can continue to use a function
after the relevant license expires. The system prompts you with a message in the reservation
period. If you intend to continue to use the GTL license file, apply for a new GTL license.
Pre-configuration Tasks
Before activating a GTL license file, complete the following tasks:
l Applying for a GTL license file
l Installing the GTL license file
Data Preparation
To activate a GTL license file, you need the following data.
No. Data
Context
Before uploading a GTL license file, run the dir command to check the remaining space of the
storage media on the device. Make sure that there is enough space in the storage media to store
the GTL license file.
Procedure
Step 1 Run:
dir device-name
NOTE
l A user who uses the GTL license for the first time must buy the GTL license from Huawei, and then
load the GTL license file to the main control board.
l A user who wants to upgrade the GTL license needs to run the license revoke command to obtain an
invalidation code, and then apply to Huawei for a new GTL license by using the invalidation code. The
user also needs to load the new GTL license file to the main control board.
----End
Context
Before activating the GTL license, run the dir *.dat command to verify that the license file has
been loaded to the USB flash drive, sd card, or flash memory..
Procedure
l Activate the GTL license for the first time.
1. Run:
license active file-name
If you use the GTL license for the first time, buy the GTL license file from Huawei.
l Upgrade the GTL license.
1. Run:
license revoke
Apply to Huawei for a new GTL license by using the invalidation code.
2. Run:
license active file-name
Context
The Emergency state of a GTL license module can be enabled on the router in any of the
following situations:
l The GTL license file of the Comm version has been activated and is in the Normal state.
l The GTL license file of the Demo version has been activated and is in the Demo state.
l The Emergency state can be enabled again only on the last day of the previous enabling
operation.
Procedure
Step 1 Run:
license emergency
----End
Prerequisite
The configurations of activating the GTL license file are complete.
Procedure
l Run the display license command to check information about the GTL license file on the
master and slave MPUs.
l Run the display license state command to check the license type.
----End
Example
<Huawei> display license
<Huawei> display license
Active License on master board: flash:/LIC_ON77076_A6D2CE1AEC3_AR.dat
Product name : AR
Product version : V200R001
License file ESN : AR00050123456789,AR00060123456789,AR00070123456789,AR000801
23456789
License Serial No : LIC20110309010210
Creator : Huawei Technologies Co., Ltd.
Created Time : 2011-03-09 19:36:14
Country : China
Custom : R&D of Huawei Technologies Co., Ltd.
Office : Shenzhen
Applicable Environment
Before upgrading system software, you can select resource files as needed.
NOTE
Pre-configuration Tasks
Before upgrading system software, complete the following task:
l Making sure that the router to be upgraded is working properly, and logging in to the
router successfully
Data Preparation
To upgrade system software, you need the following data.
No. Data
4 (Optional) New system software, configuration files, PAF file, license file, and patch
file
Procedure
Step 1 Prepare hardware as needed, for example, clear memory space to store new system software and
related upgrade files.
Step 2 Check whether a new GTL license file needs to be applied for. If it is needed, obtain it from
Huawei.
NOTE
l A new GTL License needs to be applied for when a device is upgraded to a new R version or V version.
l The obtained new GTL license file is consistent with the system software.
To view GTL license-controlled features, use the Text Editor to open the GTL license file. The
contents in the Resource and Function fields are the resource and function items controlled by
the GTL license file.
Step 3 Obtain software required for the upgrade. The new system software (.cc file) and relevant
documents for the upgrade must be obtained from Huawei.
Step 4 In the user view, run the display version command to view the current system software. If the
current system software is the same as or later than new system software, the software upgraded
is not needed.
Step 5 Run the following commands to check the device operation status:
Run the display memory-usage command in the user view to check the memory usage of MPUs
to ensure that the MPUs are working properly.
Run the display health command in the user view and record the command output. If you cannot
locate faults that have occurred during the upgrade, provide the information to Huawei technical
personnel for troubleshooting.
Step 6 Set up an environment where software upgrade can be performed by means of TFTP or FTP.
This helps to back up the original resource files before the upgrade and upload the new resource
files required for the upgrade.
l If the device to be upgraded functions as a client and a PC functions as a server, you need to
install the FTP server software on the PC. You need to purchase and install the FTP server
software yourself, because the device is not installed with such software by default.
l If the device to be upgraded functions as a server and a PC functions as a client, you do not
need to install the FTP server software on the PC. By default, the FTP server function on the
device to be upgraded is disabled. To enable the function, run the ftp server enable
command.
When the system software is upgraded by means of TFTP, the device to be upgraded can only
function as a client and does not provide the TFTP server function. In this case, you must install
the TFTP server software on the PC.
Step 7 Back up the important data stored in the storage media on the device to be upgraded.
Step 8 Check the remaining space of the storage media to make sure that there is enough space to store
the new system software and related upgrade files.
----End
Context
You can download resource files to the router by using the serial port of a computer or the
Ethernet port of the router.
This section describes how to download resource files to the router using the serial port.
Procedure
Step 1 Log in to the router from the console port. For details, see 1.2 Logging In to the Device Through
the Console Port or Mini USB Port.
Step 2 Restart the router. Press Ctrl+B to enter the BootROM menu when the following information
is displayed.
Sep 16 2011,17:14:28
Copying Data : Done
Uncompressing : Done
Initializing SMI Bus:OK
Init flash, please wait......
Base Address: 0xfffffffffc000000
Size is: 0x20000000OK
flash drv init.
Initializing FlashPiece Module:
FlashPiece start offset at: 0x300000
FlashPiece size is: 0x100000
Initializing FlashDynamic Module:
FlashDynamic start offset at: 0x400000
FlashDynamic size is: 0x200000
Initializing I2C Bus:OK
USB2 Host Stack Initialized.
USB Hub Driver Initialized
USBD Wind River Systems, Inc
EHCI Controller found.
Waiting to attach to USBD...0xbfffdf0 (tRootTask): usb1_base = 0xbff22000Done.
0xbfffdf0 (tRootTask): usbBulkDevInit() returned OK
Press Ctrl+B to break auto startup ... Attached TCP/IP interface to teth1.
NOTE
l If a password is configured, you must enter the password after pressing Ctrl+B to display the BootROM
menu (the default password is huawei ).
l You can change the password under the BootROM menu. Make a note of your password and keep it
in a safe place. The password cannot be restored if it is lost.
Main Menu
1. Default Startup
2. Serial Menu
3. Network Menu
4. Startup Select
5. File Manager
6. Reboot
1. Display parameter
2. Modify parameter
3. Save parameter
4. Download file
0. Return
Enter your choice(1-10): 2
Set the FTP type, resource file name, management interface address, FTP server address, and
FTP user name and password.
NOTE
Step 5 After the system returns to the network menu, select choice 4 to download the specified resource
file from the local FTP server.
NetWork Menu
1. Display parameter
2. Modify parameter
3. Save parameter
4. Download file
0. Return
Enter your choice(1-10): 4
NOTE
The device uses the flash and sd1 as default setting. sd1 is the built-in SD card of the device. The other
storage medium such as USB flash drive will be displayed only after they are installed.
----End
Context
Before specifying the system software to be used at the next startup, perform the following
operations:
Upload the system software to the master and slave MPUs. For details, see the contents of
uploading and downloading files in Performing File Operations by Using FTP Commands.
Make sure that the storage media on the MPUs have sufficient space to store the system software.
NOTE
Verify the system software to be uploaded by checking its size and date.
Procedure
Step 1 In the user view, run:
startup system-software system-file
The system software to be used at the next startup is specified for the MPU.
Step 2 (Optional) If the upgraded system software needs a corresponding patch file, perform the
following operations:
l Run:
startup patch file-name
A patch file to be used at the next startup is specified for the MPU.
The configuration file to be used at the next startup is specified for the MPUs.
The license file to be used at the next startup is specified for the MPU.
----End
Context
If the storage device where the startup software package is stored is damaged, you can use the
backup software package to make the system start.
NOTE
l The file name extension of the system software package must be .cc and the package must be stored
in the root directory.
l The backup startup software package can be the same as or different from the current startup software
package, but it can be used to make the system start.
Procedure
Step 1 Run:startup system-software filename backupThe backup startup software package is
specified.
----End
Context
After the system software is upgraded successfully, you need to manually upgrade the BootROM
of the 2FE and 1GEC.
NOTE
Run the display device command to check whether the device is configured with the successfully registered
2FE or 1GEC.
Procedure
Step 1 Run:
upgrade slot slot-id startup bootrom
Step 2 Run:
reset slot slot-id
After the LPU is reset, run the display version slot slot-id command to check whether the
BootROM is upgraded successfully.
----End
Context
During the upgrade, the device must be restarted in the following situations:
l The system software and configuration file to be used at the next startup have been specified.
CAUTION
Before restarting the router, run the save command to save the current configuration file.
The router restarts with the specified startup files. If the specified startup files are damaged, the
router restarts with the backup startup files. If the router fails to restart with the backup startup
files, it searches valid startup files on the storage devices in the sequence "Flash memory-> SD
card-> USB flash drive." When the router finds valid system software packages and
configuration files on the storage device, it selects a rollback version within 24 minutes and
restarts with the selected version. If the router does not find valid system software and
configuration file, it stops at the BootROM menu.
Procedure
l In the user view, run:
reboot [ fast | save diagnostic-information ]
----End
Context
Before activating the GTL license, run the dir command to verify that the license file has been
loaded to the storage device (Flash memory, SD card, or USB flash drive).
Procedure
l Run:
license active file-name
The GTL license file is activated, and the license-controlled features on the device can be
used.
----End
Prerequisite
The configurations of upgrading system software are complete.
Procedure
l Run the display patch-information command to check information about all patches.
l Run the display startup command to check that the values of the "Startup system software"
and "Startup saved-configuration file" fields in the command output are the needed ones.
----End
Example
After the patch is installed, run the display patch-information command. You can view the
patch status on each board.
<Huawei> display patch-information
Patch version : ARV200R001C00SPH100
Patch packet name: sd1:/patch_lic2.pat
Run the display startup command. You can view the names of the system software and the
configuration file used at the startup. For example:
<Huawei> display startup
MainBoard:
Startup system software: sd1:/ar0215_31345_1220.cc
Next startup system software: sd1:/ar0215_31345_1220.cc
Backup system software for next startup: null
Startup saved-configuration file: sd1:/iascfg.zip
Next startup saved-configuration file: sd1:/iascfg.zip
Startup license file: null
Next startup license file: null
Startup patch package: null
Next startup patch package: null
Startup voice-files: null
Next startup voice-files: null
Applicable Environment
During patch installation, the patch is installed onto the MPU and all LPUs.
You can use either of the following methods to install patches:
l Installing a patch file immediately: The patch file takes effect after a command is used to
run the patch file, without having to restart the device. For details, see Installing a
Patch.
l Specifying a patch file to be used at the next startup: The patch file takes effect after the
device is restarted.
Pre-configuration Tasks
Before managing patches, complete the following tasks:
l Making sure that the router is working properly
l Storing patches in the storage medium on the router
Data Preparation
To manage patches, you need the following data.
No. Data
1 Patch file
Context
Only one patch file can be run in the system at a time. Therefore, display patch-information
run the command before patch installation to check information about all patches, including the
running patches. If the command output shows that there is a running patch file in the system,
delete the running patch file.
Procedure
Step 1 Enter the user view.
Step 2 Run:
patch load patchname all run
NOTE
l The patch load patchname all run command can activate only one patch file each time.
l Each patch is developed incrementally based on the earlier version. If the incremental patch
patchB.pat is activated when the system is running the earlier version patchA.pat, patchB.pat takes
effect. To run patchA.pat again, run the patch delete all command to delete patches in the system,
and load and activate patchA.pat. Alternatively, run the startup patch command to specify
patchA.pat as the next startup patch, and then restart the device to make patchA.pat effective.
----End
Context
Before specifying a patch file to be used at the next startup, the following tasks must be
completed:
l Upload the specified patch file to the storage medium on the master MPU. For details, see
the contents of uploading and downloading files in Performing File Operations by Using
FTP Commands.
Procedure
Step 1 In the use view, run:
startup patch file-name
The patch file (*.pat) to be used at the next startup is specified for the master and slave MPUs.
----End
Follow-up Procedure
After the patch file to be used at the next startup has been specified, run the display startup
command to view the value of the "Next startup patch package" field on the MPUs.
Context
Only one patch file can be run in the system during patch installation. Therefore, delete the
running patch file from the patch area before loading and running a new patch file.
Procedure
Step 1 Enter the user view.
Step 2 Run:
patch delete all
----End
Follow-up Procedure
After patch files have been deleted, run the following command to verify the configuration.
l Run the display patch-information command to check the patch status.
<Huawei> display patch-information
Info: No patch in the system
Prerequisite
The configurations of patch installation are complete.
Procedure
l Run the display patch-information command to check information about all patches.
----End
Example
After a patch has been installed, run the display patch-information command. You can view
the patch status on each board.
<Huawei> display patch-information
Patch version : ARV200R001C00SPH100
Patch packet name: sd1:/patch_lic2.pat
Applicable Environment
The CPU and memory are a key part of a device. A lot of routing information or fast route
algorithms in the system will consume a large number of CPU resources, affecting system
performance. As a result, the device is unable to process data in time, a lot of packets may be
lost, or the system may break down. All these will bring an incalculable loss to customers.
If alarms of high CPU and memory usage can be generated during data processing on the
router, the CPU and memory usage can be effectively monitored, and the system performance
can be optimized. This also allows the system to work properly.
Pre-configuration Tasks
Before setting CPU and memory usage thresholds, complete the following task:
l Making sure that the router is working properly
Data Preparation
To set CPU and memory usage thresholds, you need the following data.
No. Data
1 CPU usage thresholds, including an alarm threshold and a clear alarm threshold
Context
Two CPU usage thresholds are set:
l Alarm threshold: indicates that the system generates an alarm when the CPU usage reaches
the alarm threshold.
l Clear alarm threshold: indicates that the alarm is cleared when the CPU usage falls below
the clear alarm threshold.
Procedure
Step 1 Run:
system-view
An alarm threshold and a clear alarm threshold are set for the CPU usage on an MPU or an LPU
in a specified slot.
NOTE
By default, the alarm threshold of CPU usage is 80%, and the clear alarm threshold of CPU usage is 75%.
----End
Context
Alarm threshold of memory usage: indicates that the system generates an alarm when the
memory usage reaches the alarm threshold.
Procedure
Step 1 Run:
system-view
----End
Prerequisite
The configurations of CPU and memory usage are complete.
Procedure
l Run the display cpu-usage command to check CPU usage.
l Run the display cpu-usage [ configuration ] [ slot slot-id ] command to check CPU usage.
l Run the display memory-usage thresholdcommand to check memory usage.
----End
Applicable Environment
After the system software of the router is upgraded, the router must be restarted to make the
configuration take effect. To prevent the system from breaking down due to a large number of
temporary files, the router also must be restarted.
l Immediate restart
l Scheduled restart
Pre-configuration Tasks
Before restarting the router, complete the following tasks:
Data Preparation
To restart the router, you need the following data.
No. Data
Context
CAUTION
Running the reboot command is not recommended, because this will interrupt network services
in a short period. Before restarting the router, choose whether to save the configuration file of
the router.
Procedure
l Run:
reboot [ fast ]
----End
Context
Do as follows on the router that needs to restart as scheduled:
Procedure
Step 1 Run:
schedule reboot at exact-time
The router is configured to restart as scheduled, and the restart time is set.
Step 2 Run:
schedule reboot delay interval
The router is configured to restart as scheduled, and the wait time before the restart is set.
You can choose either Step 1 or Step 2 to configure the router to restart as scheduled. If you
need to perform other operations before the device restart, perform Step 2 to set the wait time
before the restart.
----End
Prerequisite
The configurations of restarting the router as scheduled are complete.
Procedure
l Run the display schedule reboot command to check the parameters set for the scheduled
restart of the router.
----End
Example
# View the configuration of the router restart, with the restart time at 00:00.
<Huawei> display schedule reboot
Info:System will reboot at 00:00:00 2009/07/01 (in 12 hours and 33 minutes).
# View the configuration of the router restart, with the wait time of 12 hours before the restart.
<Huawei> display schedule reboot
Info:System will reboot at 23:27:14 2009/06/30 (in 11 hours and 59 minutes).
Networking Requirements
The current system software needs to be upgraded if it cannot provide additional features or
larger specifications required by customers.
As shown in Figure 9-2, the system software of the cannot meet customer's requirements and
needs to be upgraded. Huawei has provided related upgrade files for the customer to perform
software upgrade on the.
Precautions
l The key data in the storage medium on the device must be backed up to the PC.
l The remaining space of the storage media must be checked to make sure that there is enough
space to store new system software.
Configuration Roadmap
The configuration roadmap is as follows:
1. Specify FTP as the mode of uploading the system software, the device as the FTP server,
user 1 as the user name, and huawei as the user password.
2. Specify the system software and configuration file to be used at the next startup.
3. Save the configuration file and restart the device.
4. Verify the configuration.
Data Preparation
To complete the configuration, you need the following data:
l System software version before the upgrade, which is V200R001C00_ch.cc in this example
l New system software version, which is V200R001C00_ch.cc in this example
l Backup startup software version, which is V200R001C00_backup.cc
l Size of the remaining space of the storage media
Procedure
Step 1 Upload the new system software.
# Configure the device as an FTP server.
<Huawei> system-view
[Huawei] sysname HuaWei
[HuaWei] ftp server enable
Info: Succeeded in starting the FTP server.
[HuaWei] aaa
[HuaWei-aaa] local-user user1 password simple huawei
info: A new user added
[HuaWei-aaa] local-user user1 service-type ftp
[HuaWei-aaa] local-user user1 ftp-directory sd1:/
[HuaWei-aaa] quit
[HuaWei] quit
After the preceding configurations are complete, run the display local-user command to check
information about the user.
<HuaWei> display local-user
----------------------------------------------------------------------------
User-name State AuthMask AdminLevel
----------------------------------------------------------------------------
user1 A H -
user2 A A -
----------------------------------------------------------------------------
Total 2 user(s)
# On the PC, specify the binary format as the file transfer mode, and c:\temp as the working
directory.
NOTE
Store the uploaded file in the specified directory (C:\temp in this example). Choose Start >
Run and enter cmd. Then, press Enter. Enter FTP 10.1.1.1. At the prompt of "user", enter the
user name. At the prompt of "password", enter the password. The following configurations are
displayed:
C:\Documents and Settings\Administrator> ftp 10.1.1.1
Connect to 10.1.1.1.
220 FTP server ready.
User <10.1.1.1:<none>>:user1
331 Please specify the password.
Password:
230 User logged in.
Specify a directory and a file transfer mode on the FTP client to store the uploaded file.
ftp> binary
200 Type set to I.
ftp> lcd c:\temp
Local directory now c:\temp.
# On the PC, upload the new system software (*.cc) to the device.
ftp> put V200R001C00_ch.cc
200 Port command okay.
226 Transfer complete.
Step 2 Specify the system software and configuration file to be used at the next startup.
# View the system software and configuration file to be used at the next startup, and check that
the system software is the specified one.
<HuaWei> display startup
MainBoard :
Startup system software : sd1:/V200R001C00_ch.cc
Next startup system software : sd1:/V200R001C00_ch.cc
Backup system software for next startup: null
Startup saved-configuration file: sd1:/iascfg.zip
Next startup saved-configuration file : sd1:/aa.cfg
Startup license file: null
Next startup license file: null
Startup patch package: null
Next startup patch package: null
Startup voice-files: null
Next startup voice-files: null
# After a backup startup software package is configured, the system can restart properly if a fault
occurs.
<HuaWei> startup system-software sd1:/V200R001C00_backup.cc backup
This operation will take several minutes, please wait...
Info: Succeeded in setting the backup file for booting system
----End
Networking Requirements
The device performance needs to be optimized without affecting the use of the current version
on the device.
As shown in Figure 9-3, the performance of the device needs to be optimized. Huawei has
provided a patch file for the customer to install.
Configuration Roadmap
The configuration roadmap is as follows:
Data Preparation
To complete the configuration, you need the following data:
Procedure
Step 1 Upload the patch file mapping the current system software.
# Upload the patch file mapping the current system software to the device from the PC.
ftp> put SPH-1.1.952.pat
200 Port command okay.
226 Transfer complete.
----End