01-03 Basic Configurations Commands

Download as pdf or txt
Download as pdf or txt
You are on page 1of 408

Huawei AR Series Access Routers

Command Reference 3 Basic Configurations Commands

3 Basic Configurations Commands

About This Chapter

3.1 CLI Overview Commands


3.2 Auto-Config Commands
3.3 Auto-Start Configuration Commands
3.4 USB-based Deployment Configuration Commands
3.5 SMS-based Deployment Configuration Commands
3.6 Fast Provisioning Configuration Commands
3.7 First Login Commands
3.8 UI Configuration Commands
3.9 User Login Configuration Commands
3.10 HTTP Server Commands
3.11 File Management Commands
3.12 Configuring System Startup Commands
3.13 Upgrade Commands

3.1 CLI Overview Commands

3.1.1 assistant task

Function
The assistant task command creates an assistant task.

The undo assistant task command deletes an assistant task.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 23


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

By default, no assistant task is created.

Format
assistant task task-name
undo assistant task task-name

Parameters
Parameter Description Value
task-name The value is a string of 1 to 15 characters. It
Specifies the name of
can consist of underscores (_), letters, and
an assistant task.
digits only, and must start with a letter.

Views
System view

Default Level
3: Management level

Usage Guidelines
An assistant task is a virtual assistant on the device to realize automatic
maintenance and management. After you create an assistant task and bind it to a
batch of files to be processed, the device performs operations or configurations
when it is unattended. Assistant tasks are mainly used for scheduled system
upgrade or configuration.

You can create a maximum of five assistant tasks on the device.

Example
# Create an assistant task.
<Huawei> system-view
[Huawei] assistant task test

Related Topics
3.1.5 display assistant task history
3.1.12 if-match timer cron
3.1.13 perform batch-file

3.1.2 cls
Function
The cls command clears the current screen.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 24


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Format
cls

Parameters
None

Views
User view

Default Level
1: Monitoring level

Usage Guidelines
This command only clears the screen and does not clear the screen buffer.

Example
# Clear screen.
<Huawei> cls
Info: Current terminal monitor is off.
Info: Current terminal debugging is off.

3.1.3 command-privilege level


Function
The command-privilege level command sets the command level in a specified
view.

The undo command-privilege command restores the default command level.

By default, each command in each view has a default command level.

Format
command-privilege level level view view-name command-key

undo command-privilege view view-name command-key

Parameters
Parameter Description Value
level level Specifies the command level. The value is an
integer that
ranges from 0 to
15.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 25


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Parameter Description Value


view view-name Specifies the view name. You can enter a -
question mark (?) in the terminal GUI to
obtain all view names in the command
view.

command-key Specifies a command. The command must -


be entered manually because automatic
command line completion is not supported.

Views
System view

Default Level
3: Management level

Usage Guidelines
Usage Scenario

The system divides commands into four levels and sets the command level in the
specified view. The device administrator can change the command level as
required, so that a lower-level user can use some high-level commands. The device
administrator can also change the command level to a larger value to improve
device security.

When using this command to change the level of a command, you can run the
display command-view command-key command to check the view of the
specified command. You can also check common views in Table 3-1.

Table 3-1 Common Views

View View Name

cli_8f All views

user User view

system System view

aaa AAA view

async Async interface view

eth-trunk Eth-Trunk interface view

gigabitethernet GE interface view

loopBack Loopback interface view

vlanif VLANIF interface view

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 26


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

View View Name

voice Voice view

Precautions

You are not advised to change the default command level. If you need to change
it, consult with professional personnel to ensure that routine operation and
maintenance are not affected and security risk is avoided.

The rules for using this command to set the command level of a specified view are
as follows:

● When you degrade the target command, all keywords in the command are
degraded.
● When you upgrade the target command, only the last keyword in the
command is upgraded.
● When you set a level for the target command, the levels of all commands (in
the same view) starting with this command are changed.
● When you set a level for the target command, the keyword level in other
commands having the same index as the keyword whose level is changed is
also changed.
● If the level of keywords that have the same index is modified for multiple
times, the latest configured level takes effect.

Example
# Set the privilege level of the save command to 5.
<Huawei> system-view
[Huawei] command-privilege level 5 view user save

Related Topics
3.8.24 user privilege

3.1.4 diagnose

Function
The diagnose command enters the diagnostic view from the system view.

Format
diagnose

Parameters
None

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 27


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Views
System view

Default Level
3: Management level

Usage Guidelines
Diagnostic commands are mainly used for fault diagnosis. However, running some
commands may cause device faults or service interruptions. Therefore, use these
commands under the instruction of Huawei technical engineers.

Example
# Enter the diagnostic view.
<Huawei> system-view
[Huawei] diagnose
[Huawei-diagnose]

3.1.5 display assistant task history


Function
The display assistant task history command displays operation records of an
assistant task.

Format
display assistant task history [ task-name ]

Parameters
Parameter Description Value
task-name The value is a string of 1 to 15 characters
Specifies the name of an
consisting only of underscores (_), letters,
existing assistant task.
and digits, and must start with a letter.

Views
All views

Default Level
1: Monitoring level

Usage Guidelines
The latest five operations of each assistant task are displayed in an earlier-to-later
order.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 28


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Example
# Displays operation records of an assistant task.
<Huawei> display assistant task history
--------------------------------------------------------------------------------
Assistant task name: nemo
--------------------------------------------------------------------------------
Assistant task name: song
Action type : Batch file
Batch file name: sd1:/reboottest.bat
Start time : 2012-07-16 09:25:00
End time : 2012-07-16 09:25:00
State : Finished

Action type : Batch file


Batch file name: sd1:/reboottest.bat
Start time : 2012-07-16 09:24:00
End time : 2012-07-16 09:24:00
State : Finished

--------------------------------------------------------------------------------
Assistant task name: xu
Action type : Batch file
Batch file name: sd1:/reboottest.bat
Start time : 2012-07-16 09:25:00
End time : 2012-07-16 09:25:00
State : Finished

Action type : Batch file


Batch file name: sd1:/reboottest.bat
Start time : 2012-07-16 09:24:00
End time : 2012-07-16 09:24:00
State : Finished

Action type : Batch file


Batch file name: sd1:/reboottest.bat
Start time : 2012-07-16 09:23:00
End time : 2012-07-16 09:23:00
State : Finished

--------------------------------------------------------------------------------

Table 3-2 Description of the display assistant task history command output
Item Description

Assistant task name Task name.


This parameter is configured using the
assistant task command.

Action type Operation that an assistant task


performs.

Batch file name Name of the batch file used by an


assistant task.
This parameter is configured using the
perform batch-file command.

Start time Operation start time of an assistant


task.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 29


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Item Description

End time Operation end time of an assistant


task.

State Running status of an assistant task.


● Running indicates that the assistant
task is in operation.
● Finished indicates that the assistant
task has finished operation.

Related Topics
3.1.1 assistant task
3.1.12 if-match timer cron
3.1.13 perform batch-file

3.1.6 display command-view


Function
The display command-view command displays the view of a specified command.

Format
display command-view command-key

Parameters
Parameter Description Value
command- Specifies the command word of the The value is a string of
key command to be queried. Currently, the 1 to 200 case-insensitive
command word cannot be characters that can
automatically displayed through the include spaces.
question mark help function, and needs
to be entered manually.

Views
System view

Default Level
3: Management level

Usage Guidelines
You can run this command to check the view of a specified command. For
example, if you need to run the command-privilege level command to change

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 30


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

the level of a specified command, run the display command-view command to


check the view of the specified command.

Example
# Display the view of the if-match timer cron command.
<Huawei> system-view
[Huawei] display command-view if-match timer cron
It will take several minutes, please wait.........

Matching result(s):
----------------
assistant-task
----------------

Table 3-3 Description of the display command-view command output


Item Description

Matching result(s) Query result.


NOTE
The return value cli_8f indicates all views.

Related Topics
3.1.3 command-privilege level

3.1.7 display history-command


Function
The display history-command command displays the historical commands stored
on the current device.

Format
display history-command

Parameters
None

Views
All views

Default Level
1: Monitoring level

Usage Guidelines
Usage Scenario

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 31


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

You can run this command to check historical commands the user has executed
recently. This command facilitates information search. Historical commands are
stored in the circular mode and a maximum of 200 historical commands can be
displayed.

Precautions

All the historical commands entered by a user are automatically saved on the
terminal, that is, any input that ends with Enter is saved as a historical command.

● Historical commands are saved in the same format as that used in the input. If a
command that is entered by a user is in an incomplete format, the saved historical
command is also in the incomplete format.
● If a user runs a command several times, only the latest command is saved on the device.
If the command is entered in different formats, they are considered as different
commands.

You can view historical commands using the following methods:

● To view the previous historical command, press the Up arrow key or Ctrl+P.
If there is an earlier historical command, the earlier historical command is
displayed.
● To view the next historical command, press the Down arrow key or Ctrl+N.
If there is a new historical command, the new historical command is
displayed.

Example
# Display the historical commands that have been executed on the current
terminal.
<Huawei> display history-command
quit
user privilege level 15
user-interface vty 0 4
system-view

Related Topics
3.8.14 history-command max-size

3.1.8 display hotkey

Function
The display hotkey command displays the status of the defined, undefined, and
system hotkeys.

Format
display hotkey

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 32


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Parameters
None

Views
All views

Default Level
1: Monitoring level

Usage Guidelines
After you understand the defined, undefined, and system hotkeys in the system,
you can use hotkeys to quickly enter commands. To redefine hotkeys for a
command, run the hotkey command.

The system allows hotkeys in places where commands can be entered, and
displays the commands corresponding to hotkeys. You can run the display hotkey
command to view the commands corresponding to hotkeys.

Example
# Display defined, undefined, and system hotkeys.
<Huawei> display hotkey
----------------- HOTKEY -----------------

=Defined hotkeys=
Hotkeys Command
CTRL_G display current-configuration
CTRL_L undo idle-timeout
CTRL_O undo debugging all

=Undefined hotkeys=
Hotkeys Command
CTRL_U NULL

=System hotkeys=
Hotkeys Function
CTRL_A Move the cursor to the beginning of the first line
CTRL_B Move the cursor one character left
CTRL_C Stop current command function
CTRL_D Erase current character
CTRL_E Move the cursor to the end of the Last line
CTRL_F Move the cursor one character right
CTRL_H Erase the character left of the cursor
CTRL_K Kill outgoing connection when connecting
CTRL_N Display the next command from the history buffer
CTRL_P Display the previous command from the history buffer
CTRL_T Function as a question mark
CTRL_W Delete the word left of the cursor
CTRL_X Delete all characters up to the cursor
CTRL_Y Delete all characters after the cursor
CTRL_Z Return to the user view
CTRL_] Kill incoming connection or redirect connection
ESC_B Move the cursor one word back
ESC_D Delete remainder of word
ESC_F Move the cursor forward one word

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 33


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Table 3-4 Description of the display hotkey command output

Item Description

Defined hotkeys Defined hotkeys.

Undefined hotkeys Undefined hotkeys.

System hotkeys System hotkeys.

Related Topics
3.1.11 hotkey

3.1.9 display this

Function
The display this command displays the running configuration in the current view.

Format
display this

Parameters
None

Views
All views

Default Level
1: Monitoring level

Usage Guidelines
Usage Scenario

After the configurations are complete in a certain view, run the display this
command to check the current configurations.

Precautions

If a configuration parameter uses the default value, this parameter is not


displayed. The set parameters that do not be committed successfully are neither
displayed.

If you run the display this command in an interface view, configuration of the
interface view is displayed. If you run this command in a protocol view,
configuration of the protocol view is displayed.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 34


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Example
# Display the running configuration in the current view.
<Huawei> system-view
[Huawei] interface ethernet 2/0/0
[Huawei-Ethernet2/0/0] display this
#
interface Ethernet2/0/0
port link-type trunk
#
return

3.1.10 header
Function
The header command configures the header information displayed on a terminal
when users log in to a connected device.
The undo header command deletes the header information displayed on a
terminal when users log in to a connected device.
By default, no header information is displayed on terminals when users log in to a
connected device.

Format
header { login | shell } { information text | file file-name }
undo header { login | shell }

Parameters
Parameter Description Value
login Indicates header -
information displayed on
a terminal when a user
logs in to the device and a
connection between the
terminal and the device is
activated.
shell Indicates the header -
displayed on a terminal
when the session is set up
after the user logs in to
the connected device.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 35


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Parameter Description Value


information Specifies the header and The value is a string with spaces and
text content. carriage returns supported. The
maximum length of the string that
can be entered at one time is 220
characters, if a linefeed is contained
in the first line. If no linefeed is
contained in the first line, a
maximum of 480 characters can be
entered at one time, and the total
string length ranges from 1 to 2000
characters.
file file-name Specifies the file name The value is a string of 5 to 64
that the header uses. characters. The maximum header
file size is 128 KB. If the file size is
greater than 128 KB, only the first
128 KB file information can be
displayed.

Views
System view

Default Level
2: Configuration level

Usage Guidelines
Usage Scenario
To provide some prompts or alarms to users, you can use the header command to
configure a title on the device. If a user logs in to the device, the title is displayed.
Procedure
If information is specified, the header text starts and ends with the same
character. You can set the header text in either of the following modes:
● Non-interactive: enter the header text behind the start character.
Use the same character at the beginning and end of the header and press
Enter. If the start and end characters are inconsistent, the system prompts an
error message.
● Interactive: enter the start character and press Enter.
The system displays a message prompting the correct header information.
Then enter the required information and enter the same character at the
beginning and end of the header, and press Enter. The system quits the
interactive process.
During interaction, you can press Enter at any time to enter information in
the next line.
Precautions

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 36


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

● Before setting the login parameter, you must set login authentication
parameters; otherwise, no header information about authentication is
displayed.
● Before setting the file parameter, ensure that the file containing the header
exists; otherwise, the file name cannot be obtained.
● If the file parameter is set, save the file containing the header in the root
directory of the default storage media. To save the file to another directory,
you must use a full path.
● If you use SSH1.X to log in to the device, the shell header rather than the
login header is displayed.
● If you use SSH2.0 to log in to the device, both login and shell headers are
displayed in the login process.
● If the header command is configured several times, only the latest
configuration takes effect.
● After the login title is configured, any user that logs in to the system can view
the title.
● The start and end characters in the header text can be double quotation
marks (""). However, the header text content cannot contain double
quotation marks ("").

Example
# Configure a shell header. (non-interactive process)
<Huawei> system-view
[Huawei] header shell information &Hello! Welcome to system!& # Enter the header text behind the
start character '&' and enter '&' at the end of the header text, and press Enter.

# Display the shell header if the login succeeds.


Hello! Welcome to system!

# Configure a shell header (interactive process).


<Huawei> system-view
[Huawei] header shell information % # Press Enter after entering the start character '%' to start the
interactive process.
Info: Input banner text, and quit with the character '%'. Hello!
Welcome to system!%
[Huawei] quit
<Huawei> quit // Log off.

# Press Enter. The shell header is displayed when the user logs in again.
Hello!
Welcome to system!
<Huawei>

# Specify the file that stores a login header.


<Huawei> system-view
[Huawei] header login file sd1:/header-file.txt

3.1.11 hotkey
Function
The hotkey command sets a shortcut key for a command.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 37


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

The undo hotkey restores the system shortcut keys to the default values.
By default, the system sets the default values for three shortcut keys CTRL+G,
CTRL+L, and CTRL+O, while does not set default value for CTRL+U.

Format
hotkey { CTRL_G | CTRL_L | CTRL_O | CTRL_U } command-text
undo hotkey { CTRL_G | CTRL_L | CTRL_O | CTRL_U }

Parameters
Parameter Description Value
CTRL_G Specifies the shortcut key Ctrl+G for a -
command.
CTRL_L Specifies the shortcut key Ctrl+L for a -
command.
CTRL_O Specifies the shortcut key Ctrl+O for a -
command.
CTRL_U Specifies the shortcut key Ctrl+U for a -
command.
command-text Specifies the associated command line for The value is a string
shortcut keys. of 1 to 240
characters.

Views
System view

Default Level
2: Configuration level

Usage Guidelines
Usage Scenario
You can set a shortcut key for a command that is often used; you can also change
the default value of the shortcut key that is defined by the system according to
your requirements.
Precautions
Four shortcut keys are customized by users: CTRL+G, CTRL+L, CTRL+O, and CTRL
+U.
● By default, the shortcut key CTRL+G corresponds to the display current-
configuration command which displays current configuration.
● By default, the shortcut key CTRL+L corresponds to the undo idle-timeout
command which restores the default timeout period.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 38


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

● By default, the shortcut key CTRL+O corresponds to the undo debugging all
command which stops the output of all debugging information.
After you use the hotkey command to set a shortcut key for a command, you can
run the command by pressing the shortcut key or entering a command.

One shortcut key can be set for only one command. If you set a shortcut key for multiple
commands, only the latest configuration takes effect.
When assigning a command for a shortcut key, you need to mark the command with
double quotation marks if the command consists of several words, that is, the command
includes spaces. You do not need to mark the command with double quotation marks if the
command consists of only one word.

Example
# Assign the display tcp status command for the shortcut key CTRL+L.
<Huawei> system-view
[Huawei] hotkey ctrl_l "display tcp status"
[Huawei] commit
[Huawei] display hotkey
----------------- HOTKEY -----------------

=Defined hotkeys=
Hotkeys Command
CTRL_G display current-configuration
CTRL_L display tcp status
CTRL_O undo debugging all

=Undefined hotkeys=
Hotkeys Command
CTRL_U NULL

=System hotkeys=
Hotkeys Function
CTRL_A Move the cursor to the beginning of the first line
CTRL_B Move the cursor one character left
CTRL_C Stop current command function
CTRL_D Erase current character
CTRL_E Move the cursor to the end of the Last line
CTRL_F Move the cursor one character right
CTRL_H Erase the character left of the cursor
CTRL_K Kill outgoing connection when connecting
CTRL_N Display the next command from the history buffer
CTRL_P Display the previous command from the history buffer
CTRL_T Function as a question mark
CTRL_W Delete the word left of the cursor
CTRL_X Delete all characters up to the cursor
CTRL_Y Delete all characters after the cursor
CTRL_Z Return to the user view
CTRL_] Kill incoming connection or redirect connection
ESC_B Move the cursor one word back
ESC_D Delete remainder of word
ESC_F Move the cursor forward one word

Related Topics
3.1.8 display hotkey

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 39


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

3.1.12 if-match timer cron


Function
The if-match timer cron command sets the time to perform an assistant task.
The undo if-match timer cron command cancels the time configured for an
assistant task.
By default, the time to perform an assistant task is not specified.

Format
if-match timer cron seconds minutes hours days-of-month months days-of-week
[ years ]
undo if-match timer cron

Parameters
Parameter Description Value
seconds Sets second. The value is a string of characters in the cron format.
A cron time string consists of digits (0 to 9) and
special characters asterisk (*), hyphen (-), slash (/),
and comma (,). The value ranges from 1 to 127.
Currently, the device supports asterisk (*) only,
indicating that the value is accurate to minute but
not second.
minutes Sets minute. The value is a string of characters in the cron format.
A cron time string consists of digits (0 to 9) and
special characters asterisk (*), hyphen (-), slash (/),
and comma (,). The value ranges from 1 to 127.
hours Sets hour The value is a string of characters in the cron format.
A cron time string consists of digits (0 to 9) and
special characters asterisk (*), hyphen (-), slash (/),
and comma (,). The value ranges from 1 to 127.
days-of- Sets date. The value is a string of characters in the cron format.
month A cron time string consists of digits (0 to 9) and
special characters asterisk (*), hyphen (-), slash (/),
and comma (,). The value ranges from 1 to 127. This
parameter is exclusive with the days-of-week
parameter. At least one of the two contains asterisk
(*).
months Sets month. The value is a string of characters in the cron format.
A cron time string consists of digits (0 to 9) and
special characters asterisk (*), hyphen (-), slash (/),
and comma (,). The value ranges from 1 to 127.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 40


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Parameter Description Value


days-of- Sets week. The value is a string of characters in the cron format.
week A cron time string consists of digits (0 to 9) and
special characters asterisk (*), hyphen (-), slash (/),
and comma (,). The value ranges from 1 to 127. The
parameter is exclusive with the days-of-month
parameter. At least one of the two contains asterisk
(*).
years Sets year. The value is a string of characters in the cron format.
A cron time string consists of digits (0 to 9) and
special characters asterisk (*), hyphen (-), slash (/),
and comma (,). The value ranges from 1 to 127. If
this parameter is not specified, it refers to all the
years between 2000 to 2099.

Views
Assistant task view

Default Level
3: Management level

Usage Guidelines
Usage Scenario
The if-match timer cron command is used to set the time to perform an assistant
task. The time is expressed in the cron format defined in UNIX or Linux.
The commonly used time format (hh:mm:ss dd-mm-yyyy) can specify only one
specific time value. The cron time format is more flexible and powerful and uses
simple methods to display single or multiple time, duration, and period. The
method is as follows:
● Valid characters include digits 0 to 9, and special characters asterisk (*),
hyphen (-), slash (/), and comma (,).
● This table shows the syntax of cron format:

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 41


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Express Format Description Example


ion
Mode

Single <time> <time>: The value is Command: if-match


time an integer that timer cron * 0 1 2 5 *
point specifies a specific 2012
time value. Meaning: perform an
The value range is assistant task at 1:00 on
dependent on May 2, 2012.
specific parameter.
The range of
minutes is 0 to 59.
The range of hours
is 0 to 23. The range
of days-of-month
depends on the
number of days in a
specific month. The
range of months is 1
to 12. The range of
days-of-week is 0 to
7. The range of
years is 2000 to
2099.

Multipl <time1>,<time <timen>: The value Command: if-match


e time 2>,...,<timen> is an integer. The timer cron * 0 1,2,3 2 3 *
points value range depends 2012
on specific Meaning: perform an
parameter. assistant task at the
Multiple time points following time points:
are separated by a ● 1:00, March 2, 2012
comma (,) with no
space before or ● 2:00, March 2, 2012
behind it. The time ● 3:00, March 2, 2012
values in a list can
be arranged at any
sequence.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 42


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Express Format Description Example


ion
Mode

Specific <time>/<step> <time>: The value is Command: if-match


time an integer that timer cron * 0 0/10 * 3 *
point specifies a specific 2012
time value. Meaning: perform an
<step>: The value is assistant task at the
an integer that following time points:
specifies the time ● 0:00, March 1, 2012
incremental.
● 10:00, March 1, 2012
The two values are
separated by a slash ● 20:00, March 1, 2012
(/) with no space ● 0:00, March 2, 2012
before or behind it. ● ...
The format: ● 10:00, March 2, 2012
<time>,<time>
+<step>,<time> ● 20:00, March 2, 2012
+2*<step>,...,<time>
+n*<step>. The
maximum time
(<time>+n*<step>)
depends on specific
parameter in the
command line.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 43


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Express Format Description Example


ion
Mode

Duratio <time1>- <time1> and Command: if-match


n <time2> <time2>: The values timer cron *0 0-3 1 3 *
are integers, 2012
specifying the start Meaning: perform an
and end time assistant task at the
respectively. following time points:
<time2> must be
later than or equal ● 0:00, March 1, 2012
to <time1>. ● 1:00, March 1, 2012
The two values are ● 2:00, March 1, 2012
separated by a ● 3:00, March 1, 2012
hyphen (—) with no
space before or
behind it.
the <time1>-
<time2> is same
with
<time1>,<time1>
+1,<time1>+2,
……,<time2>. If
<time1> and
<time2> are the
same, the two
specify the same
time point.

Period * If the parameter in Command: if-match


the command line is timer cron * 30 10 * 1 1
set to *, the 2012
parameter may refer Meaning: perform an
to any time point. assistant task at 10:30,
By setting the Monday every week in
parameter to *, you January, 2012.
can configure the
system to
periodically perform
an assistant task
every year, week,
month, day, hour, or
minute.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 44


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Express Format Description Example


ion
Mode

Combin Combination All the expression Command: if-match


ation format modes can be timer cron * 0 0/10,2,4-5
combined except 1 3 * 2012
"period". The Meaning: perform an
expression modes assistant task at the
are separated by a following time points:
comma (,) with no
space before or ● 0:00, March 1, 2012
behind it. ● 2:00, March 1, 2012
● 4:00, March 1, 2012
● 5:00, March 1, 2012
● 10:00, March 1, 2012
● 20:00, March 1, 2012

Precautions

● If you run this command multiple times in the same view, only the latest
configuration takes effect.
● The days-of-month and days-of-week parameters are exclusive. Set one or
both of them to "*". If one parameter is set to *, the other one specifies a
specific date. If both parameters are set to *, they can refer to any date.
● The minimum unit supported is second, so set the second parameter to *. The
specified assistant task can work only once every minute.
● Since the system can perform only one assistant task at a time, the time
when one assistant task finished working may be later than the time when
the next task is schedule to start. There may be a time span between the time
when an assistant task is scheduled to work and the time when it actually
starts to work. The if-match timer cron command specifies the time when an
assistant task is scheduled to work.
● When you enter digits, such as 000002012, the numeric string means the
same as 2012.

Example
# Configure an assistant task to work at 20:00, 2012-05-04.
<Huawei> system-view
[Huawei] assistant task test
[Huawei-assistant-task-test] if-match timer cron * 0 20 4 5 * 2012
[Huawei-assistant-task-test] perform 1 batch-file sys.bat

# Cancel the time for an assistant task to start to work.


<Huawei> system-view
[Huawei] assistant task test
[Huawei-assistant-task-test] undo if-match timer cron

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 45


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Related Topics
3.1.1 assistant task
3.1.5 display assistant task history
3.1.13 perform batch-file

3.1.13 perform batch-file


Function
The perform batch-file command configures an assistant task to process a batch
file.
The undo perform command disables the assistant task from processing a batch
file.
By default, no batch file is configured for the assistant task.

Format
perform priority batch-file filename
undo perform priority

Parameters
Parameter Description Value
priority It has a fixed value of 1 at current
Specifies the priority of an
because one assistant task can
assistant task.
process only one batch file.
filename Specifies the name of the batch The value is a string of 5 to 64
file processed by the assistant case-insensitive characters
task. The file name is in the *.bat without spaces.
format.

Views
Assistant task template view

Default Level
3: Management level

Usage Guidelines
Usage Scenario
After you successfully create an assistant task and specify the execution time, you
can run this command to configure the device to process a batch file at the
specified time.
Prerequisites

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 46


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

An assistant task has been created using the assistant task command and the
time at which the task is executed has been specified using the if-match timer
cron command.

Precautions

If an assistant task is being executed, stop the assistant task before you can delete
it. If an assistant task is to be executed, directly delete it. The device will not
execute the assistant task later.

By default, the commands listed in the batch file are executed in the system view.

Example
# Configure the assistant task huawei to process the batch file sys.bat at
2012-05-04 20:00.
<Huawei> system-view
[Huawei] assistant task huawei
[Huawei-assistant-task-huawei] if-match timer cron * 0 20 4 5 * 2012
[Huawei-assistant-task-huawei] perform 1 batch-file sys.bat

# Disable the assistant task to process the batch file.


<Huawei> system-view
[Huawei] assistant task huawei
[Huawei-assistant-task-huawei] undo perform 1
Info: Start to delete the action.
[Huawei-assistant-task-huawei] display this
#
assistant task huawei
if-match timer cron * 0 20 4 5 * 2012
#
return

Related Topics
3.1.1 assistant task
3.1.5 display assistant task history
3.1.12 if-match timer cron

3.1.14 quit

Function
The quit command returns from the current view to a lower-level view. If the
current view is the user view, this command exits from the system.

Format
quit

Parameters
None

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 47


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Views
All views

Default Level
0: Visit level

Usage Guidelines
Usage Scenario

Three types of views are available and they are listed as follows from a lower level
to a higher level:

● User view
● System view
● Service view, such as interface view

Run the quit command to return to a lower-level command view from the current
view. If you are in the user view currently, after you run the quit command, you
quit from the system.

Example
# Return to the system view from the AAA view, and then return to the user view.
After this, quit the system.
<Huawei> system-view
[Huawei] aaa
[Huawei-aaa] quit
[Huawei] quit
<Huawei> quit

Related Topics
3.1.17 system-view
3.1.15 return

3.1.15 return

Function
The return command returns to the user view from other views except the user
view.

Format
return

Parameters
None

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 48


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Views
All views

Default Level
0: Visit level

Usage Guidelines
In other views, you can use the return command to return to the user view.
● Run this command to return to the user view if the current view is another
view except the user view.
● If the current view is the user view, no change occurs after running this
command.
● The shortcut keys<Ctrl+Z> have the same function as the return command.

Example
# Return to the user view from the user interface view.
<Huawei> system-view
[Huawei] user-interface vty 0
[Huawei-ui-vty0] return
<Huawei>

Related Topics
3.1.17 system-view

3.1.16 set current-configuration display


Function
The set current-configuration display command sets the configurations that the
user of a specified level can view.
The undo set current-configuration display command cancels the configuration.
By default, no configuration is specified for users.

Format
set current-configuration display [ all ] level level command-key
undo set current-configuration display [ all ] level level command-key

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 49


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Parameters
Parameter Description Value
all Indicates that all configuration sub- -
items are displayed if the
configuration contains sub-items.

level level The value is an integer


Specifies the user level.
ranging from 0 to 15.
command-key The value is a string of 1 to
Specifies the command of which
255 case-sensitive
the output will be displayed.
characters.

Views
System view

Default Level
3: Management level

Usage Guidelines
Use Scenario
After the administrator runs the command-privilege level command to degrade
the level of display current-configuration, low-level users can run the display
current-configuration command to view all device configurations.
To allow the low-level users to view the specified configurations, the administrator
can run the set current-configuration display command to specify the
configurations to be displayed.
Precaution
● If you enter a part of a command in the command-key parameter, the system
matches the commands starting with the characters you entered.
● If the command specified in command-key is executed in a sub-view, the
display current-configuration command displays the configurations in the
parent view.
● To view all configuration sub-items in a configuration item, use the all
keyword.
● If you run the set current-configuration display command multiple times,
multiple configurations can be specified. You can specify 128 configurations
for the user of the certain level.

Example
# Set the display current-configuration command level to 0 and specify the
configurations that level-0 users can view.
<Huawei> system-view
[Huawei] command-privilege level 0 view cli_8f display current-configuration

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 50


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

[Huawei] set current-configuration display level 0 ip address


[Huawei] set current-configuration display level 0 aaa
[Huawei] set current-configuration display level 0 network

# Display configurations as a level-0 user.


<Huawei> display current-configuration
#
aaa
#
interface GigabitEthernet0/0/0
ip address 192.168.200.183 255.255.255.0
#
interface LoopBack0
ip address 10.168.1.1 255.255.255.0
#
ospf 1
area 0.0.0.0
network 10.168.1.0 0.0.0.255
network 172.16.1.0 0.0.0.255
#
return

# Specify other configurations that level-0 user can view.


<Huawei> system-view
[Huawei] set current-configuration display all level 0 aaa

# Display configurations as a level-0 user.


<Huawei> display current-configuration
#
aaa
authentication-scheme default
authorization-scheme default
accounting-scheme default
domain default
domain default_admin
local-user huawei password cipher %$%$^XcfPki5NVJ)ceVfc.;-f"Ei%$%$
local-user huawei privilege level 3
#
interface GigabitEthernet0/0/0
ip address 192.168.200.183 255.255.255.0
#
interface LoopBack0
ip address 10.168.1.1 255.255.255.0
#
ospf 1
area 0.0.0.0
network 10.168.1.0 0.0.0.255
network 172.16.1.0 0.0.0.255
#
return

3.1.17 system-view
Function
The system-view command enables you to enter the system view from the user
view.

Format
system-view

Parameters
None

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 51


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Views
User view

Default Level
2: Configuration level

Usage Guidelines
You must configure the device in the system view. Run this command in the user
view to enter the system view.

Example
# Enter the system view.
<Huawei> system-view
Enter system view, return user view with Ctrl+Z.
[Huawei]

Related Topics
3.1.14 quit
3.1.15 return

3.2 Auto-Config Commands

● AR100 series, AR120 series (except AR129 and AR129GW-L), AR150 series (except
AR156, AR156W, AR157, AR157G-HSPA+7, AR157VW, AR157W, AR158E, and
AR158EVW), AR160 series (except AR161FW-P-M5), AR201, AR1200 series, AR2200
series, and AR3200 series support Auto-Config function.
● The management interfaces of the AR1200, AR2200, AR3200, and AR3600 series do not
support the Auto-Config function.

3.2.1 autoconfig enable


Function
The autoconfig enable command enables Auto-Config.
The undo autoconfig enable command disables Auto-Config.
By default, Auto-Config is enabled on the device.

Auto-Config is disabled on the device by default for AR169-P-M9, AR169W-P-M9,


AR169RW-P-M9.

Format
autoconfig enable

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 52


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

undo autoconfig enable

Parameters
None

Views
System view

Default Level
2: Configuration level

Usage Guidelines
You can configure the Auto-Config function only after it is enabled. The
autoconfig enable command is used in the following scenarios:
● Auto-Config is disabled on the device (You can run the 3.2.5 display
autoconfig enable command to check whether Auto-Config is enabled). In
such a case, you can use the autoconfig enable command to enable Auto-
Config.
● If the Auto-Config function cannot be automatically recovered after an error
occurs in the Auto-Config process, run the undo autoconfig enable
command to disable the Auto-Config function. After Auto-Config stops, run
the autoconfig enable command to enable Auto-Config again. You can use
the 3.2.6 display autoconfig-status command to check whether Auto-Config
is enabled.

Example
# Enable Auto-Config.
<Huawei> system-view
[Huawei] autoconfig enable
Info: Enable autoconfig successfully.

Related Topics
3.2.2 autoconfig getting-file restart
3.2.3 display autoconfig activating-config delay
3.2.4 display autoconfig activating-config remanent-time
3.2.5 display autoconfig enable
3.2.6 display autoconfig-status

3.2.2 autoconfig getting-file restart


Function
The autoconfig getting-file restart command enables the device to re-obtain the
intermediate file, the system software, patch file and configuration file from the
file server.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 53


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Format
autoconfig getting-file restart

Parameters
None

Views
System view

Default Level
2: Configuration level

Usage Guidelines
If the device fails to obtain the intermediate file, system software, patch file or
configuration file, the Auto-Config process is suspended and needs to be restarted.
The autoconfig getting-file restart command restarts the Auto-Config process,
enabling the device to re-obtain the intermediate file, system software, patch file
and configuration file. The 3.2.6 display autoconfig-status command displays
whether the Auto-Config process is suspended.

This command can be executed only when obtaining files failed and the Auto-Config
process is suspended.

Example
# Configure the device to re-obtain files from the file server and continue the
AutoConfig process.
<Huawei> system-view
[Huawei] autoconfig getting-file restart

Related Topics
3.2.1 autoconfig enable
3.2.5 display autoconfig enable
3.2.6 display autoconfig-status

3.2.3 display autoconfig activating-config delay


Function
The display autoconfig activating-config delay command displays the delay in
restarting a device after a configuration file is downloaded using Auto-Config.

Format
display autoconfig activating-config delay

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 54


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Parameters
None

Views
All views

Default Level
1: Monitoring level

Usage Guidelines
Usage Scenario

After a user uses the Option 146 parameter to set the delay in restarting a device,
there is a delay in restarting the device after the version file, patch file, and
configuration file are downloaded using Auto-Config. After the device is restarted,
loaded files can take effect. Run the display autoconfig activating-config delay
command to check the configured delay in restarting a device.

Precautions

By default, the device is restarted immediately if no delay is set using the Option
146 parameter.

Example
# Display the delay in restarting a device after a configuration file is downloaded
using Auto-Config.
<Huawei> display autoconfig activating-config delay
The delay in activating configuration is 0 seconds.

Related Topics
3.2.4 display autoconfig activating-config remanent-time

3.2.4 display autoconfig activating-config remanent-time


Function
The display autoconfig activating-config remanent-time command displays the
remaining delay in restarting a device after a configuration file is downloaded
using Auto-Config.

Format
display autoconfig activating-config remanent-time

Parameters
None

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 55


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Views
All views

Default Level
1: Monitoring level

Usage Guidelines
Usage Scenario

After a user uses the Option 146 parameter to set the delay in restarting a device,
there is a delay in restarting the device after the version file, patch file, and
configuration file are downloaded using Auto-Config. After the device is restarted,
loaded files can take effect. Run the display autoconfig activating-config
remanent-time command to check the remaining delay in restarting a device.

Precautions

By default, the device is restarted immediately if no delay is set using the Option
146 parameter.

Example
# Display the remaining delay in restarting a device after a configuration file is
downloaded using Auto-Config.
<Huawei> display autoconfig activating-config remanent-time
The remanent time of activating configuration is 10 seconds.

Related Topics
3.2.3 display autoconfig activating-config delay

3.2.5 display autoconfig enable

Function
The display autoconfig enable command displays whether Auto-Config is
enabled.

Format
display autoconfig enable

Parameters
None

Views
All views

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 56


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Default Level
1: Monitoring level

Usage Guidelines
Auto-Config runs only after it is enabled. You can run the display autoconfig
enable command to check whether Auto-Config is enabled to ensure that Auto-
Config runs properly.

Example
# Check whether Auto-Config is enabled.
<Huawei> display autoconfig enable
Autoconfig is enabled.

Related Topics
3.2.1 autoconfig enable

3.2.6 display autoconfig-status


Function
The display autoconfig-status command displays the running status of Auto-
Config.

Format
display autoconfig-status

Parameters
None

Views
All views

Default Level
1: Monitoring level

Usage Guidelines
None

Example
# Display the configuration and running status of Auto-Config.
<Huawei> display autoconfig-status

Running: No

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 57


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Can deploy configurations with a USB disk: Yes

Stop : Yes
Reason : Current startup configuration file already exists.

Suspend: No
Reason : --

The status of DHCP phase:


Operation result: --
Failed reason : --

The status of setting ACS phase:


URL : --
User name : --
Password : --
Operation result: --
Failed reason : --

The status of getting middle file phase:


File name : --
Operation result: --
Failed reason : --

The status of getting system software phase:


File name : --
Operation result: --
Failed reason : --

The status of getting patch file phase:


File name : --
Operation result: --
Failed reason : --

The status of getting configuration file phase:


File name : --
Operation result: --
Failed reason : --

The status of activating configuration phase:


Remained time : --
Operation result: --
Failed reason : --

Table 3-5 Description of the display autoconfig-status command output


Item Description

Running Whether Auto-Config is running.

Can deploy configurations with a USB Whether a USB disk can be used for
disk deployment.
NOTE
The device can be configured using Auto-
Config or USB deployment. However, two
deployment methods cannot be used
together.

Stop Whether Auto-Config stops.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 58


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Item Description

Reason Reason that Auto-Config stops:


● AutoConfig is disabled.
● Current startup configuration file
already exists.

Suspend Whether Auto-Config is suspended.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 59


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Item Description

Reason Reason that Auto-Config is suspended:


● Autoconfig is completed.
● Connecting to file server failed.
● Deploying configurations with a
USB disk.
● Failed to get the TFTP server
address from the host.
● Getting file server information
failed.
● Getting system MAC address and
ESN failed.
● Getting system MAC address failed
and the ESN is wrong.
● Getting system ESN failed and the
MAC address is wrong.
● No file can be deleted.
● Option 147 check failed.
● Option 147 does not exist or check
is successful, but check of other
information fails.
● Option 141 is too long.
● Option 142 is too long.
● Option 67 is too long.
● Option 66 is too long.
● Option 15 is too long.
● Option 145 is too long.
● Option 146 is too long.
● Option 43 is too long.
● Space is not insufficient.
● Specifying startup patch file failed.
● Specifying startup system software
failed.
● Specifying startup configuration file
failed.
● Some ACS information is empty.
● Setting ACS URL failed.
● Setting ACS user name failed.
● Setting ACS password failed.
● The obtained version is different
from the version in the system
software name.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 60


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Item Description

● The system software already exists


and is the current startup file.
● The user name or password used to
connect to the file server is wrong.
● The file does not exist on the file
server.
● The extension name of the system
software is wrong.
● The extension name of the patch
file is wrong.
● The extension name of
configuration file is wrong.
● The configuration file already exists
and is the current startup file.
● The patch file already exists and is
the current startup file.
● The length of the middle file is
incorrect.
● The MAC address and ESN do not
match.
● The TFTP server cannot be found.
● The length of some ACS
information is wrong.
● The format of ACS URL is wrong.
● The format of ACS user name is
wrong.
● The format of ACS password is
wrong.
● The system software name or
version is not received.
● The system software name is too
long.
● The patch file name is too long.
● The version is too long.
● The configuration file name is too
long.
● The opervalue is too long.
● The delaytime is too long.
● The middle file does not have a
configuration file name.

The status of DHCP phase DHCP exchange phase.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 61


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Item Description

Operation result Result of interaction between the


device and the DHCP server:
● --: The DHCP exchange phase is not
started.
● Running: Auto-Config is running.
● Successful: Auto-Config is
successful.
● Suspend: Auto-Config is suspended.
● Stop: Auto-Config stops.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 62


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Item Description

Failed reason Reason for interaction failure between


the device and the DHCP server:
● AutoConfig is disabled.
● Current startup configuration file
already exists.
● Deploying configurations with a
USB disk.
● Failed to get the TFTP server
address from the host.
● Getting file server information
failed.
● Option 147 check failed.
● Option 147 does not exist or check
is successful, but check of other
information fails.
● Option 141 is too long.
● Option 142 is too long.
● Option 67 is too long.
● Option 66 is too long.
● Option 15 is too long.
● Option 145 is too long.
● Option 146 is too long.
● Option 43 is too long.
● The TFTP server cannot be found.
● The system software name is too
long.
● The patch file name is too long.
● The version is too long.
● The configuration file name is too
long.
● The opervalue is too long.
● The delaytime is too long.
NOTE
If Auto-Config keeps running during the
interaction between the device and the
DHCP server, The last failed reason is
displayed, indicating the latest reason for
failure.

The status of setting ACS phase ACS configuration phase.

URL ACS URL.

User name ACS user name.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 63


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Item Description

Password ACS password.

Operation result Operation result:


● --: The ACS configuration phase is
not started.
● Running: Auto-Config is running.
● Successful: Auto-Config is
successful.
● Suspend: Auto-Config is suspended.
● Stop: Auto-Config stops.

Failed reason Reason for a failure:


● Autoconfig is completed.
● AutoConfig is disabled.
● Current startup configuration file
already exists.
● Some ACS information is empty.
● Setting ACS URL failed.
● Setting ACS user name failed.
● Setting ACS password failed.
● The length of some ACS
information is wrong.
● The format of ACS URL is wrong.
● The format of ACS user name is
wrong.
● The format of ACS password is
wrong.
NOTE
If Auto-Config keeps running when ACS
runs, The last failed reason is displayed,
indicating the latest reason for failure.

The status of getting middle file phase Phase of obtaining the intermediate
file.

File name Intermediate file name.

Operation result Result of obtaining the intermediate


file:
● --: The phase of obtaining the
intermediate file is not started.
● Running: Auto-Config is running.
● Successful: Auto-Config is
successful.
● Suspend: Auto-Config is suspended.
● Stop: Auto-Config stops.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 64


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Item Description

Failed reason Reason for failing to obtain the


intermediate file:
● AutoConfig is disabled.
● Current startup configuration file
already exists.
● Connecting to file server failed.
● Getting system MAC address and
ESN failed.
● Getting system MAC address failed
and the ESN is wrong.
● Getting system ESN failed and the
MAC address is wrong.
● Space is not insufficient.
● The user name or password used to
connect to the file server is wrong.
● The file does not exist on the file
server.
● The length of the middle file is
incorrect.
● The MAC address and ESN do not
match.
● The middle file does not have a
configuration file name.
● The system software name is too
long.
● The patch file name is too long.
● The version is too long.
● The configuration file name is too
long.
NOTE
If Auto-Config keeps running during the
phase of obtaining the intermediate file,
The last failed reason is displayed,
indicating the latest reason for failure.

The status of getting system software Phase of obtaining the system


phase software.

File name System software name.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 65


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Item Description

Operation result Result of obtaining system software:


● --: The phase of obtaining a version
file is not started.
● Running: Auto-Config is running.
● Successful: Auto-Config is
successful.
● Suspend: Auto-Config is suspended.
● Stop: Auto-Config stops.

Failed reason Reason for failing to obtain the system


software:
● AutoConfig is disabled.
● Current startup configuration file
already exists.
● Connecting to file server failed.
● No file can be deleted.
● Specifying startup system software
failed.
● Space is not insufficient.
● The file does not exist on the file
server.
● The user name or password used to
connect to the file server is wrong.
● The obtained version is different
from the version in the system
software name.
● The system software already exists
and is the current startup file.
● The extension name of the system
software is wrong.
● The system software name or
version is not received.
● The system software already exists
and is the rollback startup file.
NOTE
If Auto-Config keeps running during the
phase of obtaining the system software,
The last failed reason is displayed,
indicating the latest reason for failure.

The status of getting patch file phase Phase of obtaining a patch file.

File name Patch file name.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 66


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Item Description

Operation result Result of obtaining the patch file:


● --: The phase of obtaining a patch
file is not started.
● Running: Auto-Config is running.
● Successful: Auto-Config is
successful.
● Suspend: Auto-Config is suspended.
● Stop: Auto-Config stops.

Failed reason Reason for failing to obtain the patch


file:
● AutoConfig is disabled.
● Current startup configuration file
already exists.
● Connecting to file server failed.
● Specifying startup patch file failed.
● Space is not insufficient.
● The file does not exist on the file
server.
● The user name or password used to
connect to the file server is wrong.
● The extension name of the patch
file is wrong.
● The patch file already exists and is
the current startup file.
● The patch file already exists and is
the rollback startup file.
NOTE
If Auto-Config keeps running during the
phase of obtaining the patch file, The last
failed reason is displayed, indicating the
latest reason for failure.

The status of getting configuration file Phase of obtaining a configuration file.


phase

File name Configuration file name.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 67


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Item Description

Operation result Result of obtaining the configuration


file:
● --: The phase of obtaining a
configuration file is not started.
● Running: Auto-Config is running.
● Successful: Auto-Config is
successful.
● Suspend: Auto-Config is suspended.
● Stop: Auto-Config stops.

Failed reason Reason for failing to obtain the


configuration file:
● AutoConfig is disabled.
● Current startup configuration file
already exists.
● Connecting to file server failed.
● Specifying startup configuration file
failed.
● Space is not insufficient.
● The file does not exist on the file
server.
● The user name or password used to
connect to the file server is wrong.
● The extension name of
configuration file is wrong.
● The configuration file already exists
and is the current startup file.
● The configuration file already exists
and is the rollback startup file.
NOTE
If Auto-Config keeps running during the
phase of obtaining the configuration file,
The last failed reason is displayed,
indicating the latest reason for failure.

The status of activating configuration Phase of activating the configuration.


phase

Remained time Remaining relay for restarting a


device.
The command output of this
command is the same as that of the
3.2.4 display autoconfig activating-
config remanent-time command.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 68


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Item Description

Operation result Result of activating configurations:


● --: The phase of activating the
configuration is not started.
● Running: Auto-Config is running.
● Successful: Auto-Config is
successful.
● Suspend: Auto-Config is suspended.
● Stop: Auto-Config stops.

Failed reason Reason for failing to activate


configurations:
● AutoConfig is disabled.
● Current startup configuration file
already exists.

Related Topics
3.2.1 autoconfig enable
3.2.2 autoconfig getting-file restart
3.2.4 display autoconfig activating-config remanent-time

3.3 Auto-Start Configuration Commands

3.3.1 autostart
Function
The autostart command displays the autostart view.

Format
autostart

Parameters
None

Views
System view

Default Level
3: Management level

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 69


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Usage Guidelines
To perform configurations related to Auto-Start, enter the autostart view first. You
can run this command in the system view to enter the autostart view.

Example
# Display the autostart view.
<Huawei> system-view
[Huawei] autostart
[Huawei-autostart]

3.3.2 autostart enable

Function
The autostart enable command enables Auto-Start on a device.

The undo autostart enable command disables Auto-Start on a device.

By default, Auto-Start is disabled on a device.

Format
autostart enable

undo autostart enable

Parameters
None

Views
System view

Default Level
3: Management level

Usage Guidelines
You can run this command to enable Auto-Start. You can use Auto-Start to deploy
or upgrade a device only after enabling Auto-Start.

Example
# Enable Auto-Start.
[Huawei] autostart enable
Info: Enable autostart successfully.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 70


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

3.3.3 autostart run

Function
The autostart run command configures a device to immediately start the Auto-
Start process.

Format
autostart run

Parameters
None

Views
Autostart view

Default Level
3: Management level

Usage Guidelines
When the Auto-Start process fails, you can modify file server parameters or
reconfigure the intermediate file and file server, and run this command to
configure the device to immediately start the Auto-Start process.

Example
# Configure the device to immediately start the Auto-Start process.
<Huawei> system-view
[Huawei] autostart
[Huawei-autostart] autostart run
Are you sure to run autostart function? (Please set autostart config first.)[Y/N]:
y
Info: Autostart function run.

3.3.4 display autostart config

Function
The display autostart config command displays the file server configuration.

Format
display autostart config

Parameters
None

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 71


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Views
System view

Default Level
3: Management level

Usage Guidelines
You can run this command to view the file server configuration on the device,
including the type and IP address of the file server, and the user name and
password for accessing the file server.

Example
# Display the file server configuration.
[Huawei] display autostart config
Server type :FTP
Server IP address :192.168.1.1
Username :user1
Password :***

Related Topics
3.3.1 autostart
3.3.7 servertype
3.3.6 ipaddress
3.3.8 username

3.3.5 display autostart status

Function
The display autostart status command displays the running status of Auto-Start.

Format
display autostart status

Parameters
None

Views
System view

Default Level
3: Management level

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 72


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Usage Guidelines
None

Example
# Display the running status of Auto-Start.
[Huawei] display autostart status

Enable : Yes

Running: No

Can deploy configurations by USB disk or AutoConfig: Yes

Suspend: No
Reason : --

The status of getting middle file phase:


File name : arstart.ini
Operation result: Suspend
Failed reason : The unknown reason cause getting file from file server failed

The status of getting system software phase:


File name : --
Operation result: --
Failed reason : --

The status of getting patch file phase:


File name : --
Operation result: --
Failed reason : --

The status of getting configuration file phase:


File name : --
Operation result: --
Failed reason : --

The status of activating configuration phase:


Operation result: --
Failed reason : --

Table 3-6 Description of the display autostart status command output


Item Description

Enable Whether Auto-Start is enabled:


● Yes: enabled
● No: disabled

Running Whether Auto-Start is running:


● Yes: running
● No: not running

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 73


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Item Description

Can deploy configurations by USB disk Whether site deployment using a USB
or AutoConfig flash drive or Auto-Config is available:
● Yes: available
● No: unavailable
NOTE
The device can be deployed using a USB
flash drive, Auto-Config, or Auto-Start. The
three deployment modes are mutually
exclusive and only one of them can be
used at a time.

Suspend Whether Auto-Start is suspended:


● Yes: suspended
● No: not suspended

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 74


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Item Description

Reason Reason why Auto-Start is suspended.


● Autostart is completed.
● Connecting to file server failed.
● Getting file server information
failed.
● Getting system MAC address and
ESN failed.
● Getting system MAC address failed
and the ESN is wrong.
● Getting system ESN failed and the
MAC address is wrong.
● No file can be deleted.
● Space is not insufficient.
● Specifying startup patch file failed.
● Specifying startup system software
failed.
● Specifying startup configuration file
failed.
● The obtained version is different
from the version in the system
software name.
● The system software already exists
and is the current startup file.
● The username or password used to
connect to the file server is wrong.
● The file does not exist on the file
server.
● The extension name of the system
software is wrong.
● The extension name of the patch
file is wrong.
● The extension name of
configuration file is wrong.
● The configuration file already exists
and is the current startup file.
● The patch file already exists and is
the current startup file.
● The length of the middle file is
incorrect.
● The MAC address and ESN do not
match.
● The system software name or
version is not received.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 75


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Item Description

● The system software name is too


long.
● The patch file name is too long.
● The version is too long.
● The configuration file name is too
long.
● The opervalue is too long.
● The middle file does not have a
configuration file name.

The status of getting middle file phase Phase of obtaining the intermediate
file.

File name Name of the intermediate file, system


software, configuration file, or patch
file.

Operation result Result of the file obtaining phase.


● --: The phase is not started.
● Running: The phase is running.
● Successful: The phase is successful.
● Suspend: The phase is suspended.
● Stop: The phase stops.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 76


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Item Description

Failed reason Reason for failing to obtain a file.


● AutoStart is disabled.
● Current startup configuration file
already exists.
● Connecting to file server failed.
● Getting system MAC address and
ESN failed.
● Getting system MAC address failed
and the ESN is wrong.
● Getting system ESN failed and the
MAC address is wrong.
● Space is not insufficient.
● The username or password used to
connect to the file server is wrong.
● The file does not exist on the file
server.
● The length of the middle file is
incorrect.
● The MAC address and ESN do not
match.
● The middle file does not have a
configuration file name.
● The system software name is too
long.
● The patch file name is too long.
● The version is too long.
● The configuration file name is too
long.
● Specifying startup system software
failed.
● The obtained version is different
from the version in the system
software name.
● The system software already exists
and is the current startup file.
● The extension name of the system
software is wrong.
● The system software name or
version is not received.
● The system software already exists
and is the rollback startup file.
● Specifying startup patch file failed.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 77


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Item Description

● The extension name of the patch


file is wrong.
● The patch file already exists and is
the current startup file.
● The patch file already exists and is
the rollback startup file.
● Current startup configuration file
already exists.
● Specifying startup configuration file
failed.
● The extension name of
configuration file is wrong.
● The configuration file already exists
and is the current startup file.
● The configuration file already exists
and is the rollback startup file.

The status of getting system software Phase of obtaining the system


phase software.

The status of getting patch file phase Phase of obtaining the patch file.

The status of getting configuration file Phase of obtaining the configuration


phase file.

The status of activating configuration Phase of activating the configuration.


phase

Operation result Result of the configuration activation


phase.
● --: The phase is not started.
● Running: The phase is running.
● Successful: The phase is successful.
● Suspend: The phase is suspended.
● Stop: The phase stops.

Failed reason Reason for failing to activate the


configuration.
● AutoStart is disabled.
● Current startup configuration file
already exists.

Related Topics
3.3.2 autostart enable
3.3.3 autostart run

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 78


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

3.3.6 ipaddress

Function
The ipaddress command configures the IP address of the file server.

The undo ipaddress command deletes the IP address of the file server.

Format
ipaddress ip

undo ipaddress

Parameters
Parameter Description Value
ip Specifies the IP address of the file The value is in dotted decimal
server. notation.

Views
Autostart view

Default Level
3: Management level

Usage Guidelines
Before using Auto-Start to deploy or upgrade a device, run this command to
configure the IP address of the file server. After the IP address is configured, the
device can connect to the corresponding file server based on the IP address and
download site deployment files.

Example
# Configure the IP address 192.168.1.20 for the file server.
<Huawei> system-view
[Huawei] autostart
[Huawei-autostart] ipaddress 192.168.1.20
Info: Set ip address successfully.

Related Topics
3.3.1 autostart
3.3.7 servertype
3.3.8 username
3.3.4 display autostart config

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 79


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

3.3.7 servertype
Function
The servertype command configures the type of the file server.
The undo servertype command restores the default type of the file server.
By default, the file server is an FTP server.

Format
servertype { FTP | SFTP }
undo servertype

Parameters
Parameter Description Value
FTP Sets the type of the file server to FTP. -
SFTP Sets the type of the file server to SFTP. -

Views
Autostart view

Default Level
3: Management level

Usage Guidelines
Before using Auto-Start to deploy or upgrade a device, run this command to
configure the type of the file server.
If the file server type is set to FTP, the device connects to the file server and
downloads site deployment files using FTP. If the file server type is set to SFTP, the
device connects to the file server and downloads site deployment files using SFTP.
Site deployment files contain the intermediate file and one or more of the system
software, patch file, and configuration file.

Example
# Set the type of the file server to SFTP.
<Huawei> system-view
[Huawei] autostart
[Huawei-autostart] servertype sftp
Info: Set server type successfully.

Related Topics
3.3.1 autostart

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 80


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

3.3.6 ipaddress
3.3.8 username
3.3.4 display autostart config

3.3.8 username

Function
The username command configures the user name and password for accessing
the file server.

The undo username command deletes the user for accessing the file server.

By default, no user is configured for accessing the file server.

Format
username username password password

undo username username

Parameters

Parameter Description Value


username Specifies the user name for The value is a string of 1 to 64 case-
accessing the file server. insensitive characters without spaces. It
can contain special characters.
password Specifies the password The value is a string of case-sensitive
corresponding to the user characters without spaces. It can be a
name for accessing the file string of 1 to 32 characters in plain text,
server. or a string of 80 characters in cipher
text.

Views
Autostart view

Default Level
3: Management level

Usage Guidelines
Before using Auto-Start to deploy or upgrade a device, run this command to
configure the user name and password for accessing the file server. After the user
name and password are configured, the device can be authenticated by and
connect to the file server.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 81


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Example
# Set the user name and password for accessing the file server to admin and
huawei, respectively.
<Huawei> system-view
[Huawei] autostart
[Huawei-autostart] username admin password huawei
Info: Set user name and password successfully.

Related Topics
3.3.1 autostart
3.3.7 servertype
3.3.6 ipaddress
3.3.4 display autostart config

3.4 USB-based Deployment Configuration Commands

3.4.1 autoupdate enable

Function
The autoupdate enable command enables the USB-based deployment function.

The undo autoupdate enable command disables the USB-based deployment


function.

By default, the USB-based deployment function is disabled.

Format
autoupdate enable

undo autoupdate enable

Parameters
None

Views
System view

Default Level
3: Management level

Usage Guidelines
Use Scenario

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 82


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

● If a device has the current configuration file (not an unconfigured device),


you must run the autoupdate enable command to enable the USB-based
deployment function before you can use a USB flash drive to upgrade the
device.
● If a device has no current configuration file (unconfigured), the device can be
upgraded using a flash drive regardless of whether the USB-based
deployment function is enabled.
Prerequisites
This command can take effect only after an authentication password for USB-
based deployment is configured by the set usb autoupdate password command.
Precautions
If the USB-based deployment is enabled, the clear usb autoupdate password
command disables the USB-based deployment function while deleting the
authentication password for USB-based deployment.

Example
# Enable the USB-based deployment function.
<Huawei> system-view
[Huawei] set usb autoupdate password huawei123
[Huawei] autoupdate enable
Info: Enable Autoupdate successfully.

3.4.2 clear usb autoupdate password


Function
The clear usb autoupdate password command deletes the authentication
password for USB-based deployment.

Format
clear usb autoupdate password

Parameters
None

Views
System view

Default Level
3: Management level

Usage Guidelines
To disable password authentication for USB-based deployment, run this command
to delete the authentication password configured by the set usb autoupdate
password command.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 83


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

If the USB-based deployment and hash-based message authentication code


(HMAC) check for USB-based deployment is enabled, the clear usb autoupdate
password command also disables the USB-based deployment and the HMAC
check. In this case, the device displays the following message "Info: Clear usb
autoupdate password successfully, the hmac check and autoupdate are disabled."
If HMAC check is not enabled for USB-based deployment, the device displays the
following information when you run the clear usb autoupdate password
command "Info: Clear usb autoupdate password successfully."

Example
# Delete the authentication password for USB-based deployment.
<Huawei> system-view
[Huawei] clear usb autoupdate password

Related Topics
3.4.7 set usb autoupdate password

3.4.3 display autoupdate enable


Function
The display autoupdate enable command displays whether the USB-based
deployment function is enabled.

Format
display autoupdate enable

Parameters
None

Views
System view

Default Level
3: Management level

Usage Guidelines
None

Example
# Check whether the USB-based deployment function is enabled.
<Huawei> system-view
[Huawei] display autoupdate enable
Autoupdate state: enabled.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 84


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Table 3-7 Description of the display autoupdate enable command output

Item Description

Autoupdate ● enabled: The USB-based deployment function is enabled.


state ● disabled: The USB-based deployment function is not
enabled.

3.4.4 display hmac enable


Function
The display hmac enable command displays whether the HMAC check function is
enabled for USB-based deployment.

Format
display hmac enable

Parameters
None

Views
System view

Default Level
3: Management level

Usage Guidelines
None

Example
# Check whether the HMAC check function is enabled for USB-based deployment.
<Huawei> system-view
[Huawei] display hmac enable
Autoupdate hmac check state: enabled.

Table 3-8 Description of the display hmac enable command output

Item Description

Autoupdate ● enabled: The HMAC check function is enabled for USB-


hmac check based deployment.
state ● disabled: The HMAC check function is not enabled for
USB-based deployment.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 85


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

3.4.5 display usb autoupdate state

Function
The display usb autoupdate state command displays the USB-based deployment
status.

Format
display usb usb-id autoupdate state

Parameters
Parameter Description Value
usb-id Specifies the USB interface The value is an integer ranging from
ID. 0 to 1.

Views
User view

Default Level
3: Management level

Usage Guidelines
None

Example
# Display the USB-based deployment status.
<Huawei> display usb 1 autoupdate state
Info: Deployment using the USB flash drive is completed successfully.

Table 3-9 Description of the display usb autoupdate state command output

Item Description

Info: Deployment using the USB flash USB-based deployment is


drive is completed successfully. successful.

Info: Deployment using a USB flash drive USB-based deployment has not
is not performed. started.

Info: Deployment using a USB flash drive USB-based deployment is in


is in progress, please wait.... progress.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 86


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Item Description

Info: Deployment using the USB flash USB-based deployment fails.


drive failed!

Related Topics
3.4.7 set usb autoupdate password

3.4.6 hmac enable


Function
The hmac enable command enables the hash-based message authentication code
(HMAC) check function for USB-based deployment.
The undo hmac enable command disables the HMAC check function for USB-
based deployment.
By default, the HMAC check function is disabled.

Format
hmac enable
undo hmac enable

Parameters
None

Views
System view

Default Level
3: Management level

Usage Guidelines
Use Scenario
To improve security of USB-based deployment, you can run the hmac enable
command to enable the HMAC check function for USB-based deployment.
After HMAC check is configured for USB-based deployment, the device uses the
password configured by the 3.4.7 set usb autoupdate password command as the
key to calculate an HMAC based on the HMAC-SHA256 algorithm for a specific
file. Then the device compares the calculated HMAC with the value of the HMAC
field in the index file. If the two HMAC values are the same, the device considers
the file to be downloaded valid.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 87


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Prerequisites
An authentication password has been configured using the set usb autoupdate
password command.
Precautions
If HMAC check is enabled for USB-based deployment, the clear usb autoupdate
password command disables the HMAC function while deleting the
authentication password for USB-based deployment.

Example
# Enable the HMAC check function for USB-based deployment.
<Huawei> system-view
[Huawei] set usb autoupdate password huawei123
[Huawei] hmac enable
Info: Enable Autoupdate hmac check successfully.

3.4.7 set usb autoupdate password


Function
The set usb autoupdate password command configures an authentication
password for USB-based deployment.

Format
set usb autoupdate password password

Parameters
Parameter Description Value
password Sets the The value is a string of 8 to 64 characters in
authentication plain text without spaces, or a string of 8 to
password used in 108 characters in cipher text without spaces.
USB-based The string must contain at least two types of
deployment. the following: uppercase letters, lowercase
letters, digits, and special characters.

Views
System view

Default Level
3: Management level

Usage Guidelines
The authentication password configured by this command is used in the following
scenarios:

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 88


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

● When hash-based message authentication code (HMAC) check is enabled, the


device uses this password as the key to calculate the HMAC.

Currently, the HMAC can only be calculated using the HMAC-SHA256 algorithm.
● When downloading an encrypted configuration file from the USB flash drive,
the device uses this password to decrypt the configuration file.

Currently, configuration files can be encrypted only when they are being compressed
into .zip format. The following encryption methods can be used:
● Simple text encryption: For example, when you compress a .cfg configuration file
into a .zip file, you can enter a password in the compression software to encrypt
the configuration file.
● AES256 encryption algorithm: For example, when you compress a .cfg
configuration file into a .zip file, you can select the AES256 mode and enter a
password in the compression software to encrypt the configuration file. This
encryption method is recommended because it is more secure.
The password used to encrypt the configuration file must be the same as the
password configured by the set usb autoupdate password command.

Example
# Set the authentication password used in USB-based deployment to huawei123.
<Huawei> system-view
[Huawei] set usb autoupdate password huawei123

Related Topics
3.4.5 display usb autoupdate state

3.4.8 usb autoupdate generate encrypted boot-password


Function
The usb autoupdate generate encrypted boot-password command encrypts a
Boot password in plain text into one in cipher text.

Format
usb autoupdate generate encrypted boot-password

Parameters
None

Views
System view

Default Level
3: Management level

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 89


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Usage Guidelines
Usage Scenario
In a scenario where USB-based deployment is performed and Boot passwords are
set in a batch using configuration files, no password in plain text is allowed in the
configuration files. Therefore, you can run the usb autoupdate generate
encrypted boot-password command to generate an encrypted Boot password.
Precautions
You can run the usb autoupdate generate encrypted boot-password command
on a device and then enter a password in plain text as prompted. The password is
a string of 6 to 19 characters and must contain at least two types of the following:
uppercase letters, lowercase letters, digits, and special characters.

Example
# Enter a Boot password in plain text and then a password in cipher text is
generated.
<Huawei> system-view
[Huawei] usb autoupdate generate encrypted boot-password
Enter Password(<6-19>):
Confirm password:
Info:The encrypted boot password is:
%^%#NUWg5b|rB(.Z7'T5Yee:|3Z[Pl|32>)D,g8T8j5P%^%#

3.5 SMS-based Deployment Configuration Commands

3G/LTE-supporting devices support SMS-based deployment. However, the AR109, AR109W,


AR109GW-L, AR129CV, AR129CVW, and AR129CGVW-L do not support this function.
● Currently, 3G-supporting devices include:
● 3G/LTE routers, which need to have 3G/LTE antennas installed before being used. For
specific device models, see Licensing Requirements and Limitations for 3G Cellular
Interfaces in "3G Cellular Interface Configuration".
● Routers that can have 3G cards (except 3G-EVDO cards) installed in SIC slots. For
specific device models, see Licensing Requirements and Limitations for 3G Cellular
Interfaces in "3G Cellular Interface Configuration".
● Currently, the following routers support the LTE functions:
● 3G/LTE routers, which need to have 3G/LTE antennas installed before being used. For
specific device models, see Overview of LTE Cellular Interfaces in "LTE Cellular
Interface Configuration".
● Routers that can have LTE interface cards installed in slots. For specific device models,
see Licensing Requirements and Limitations for LTE Cellular Interfaces in "LTE Cellular
Interface Configuration".

3.5.1 sms config autodeploy enable


Function
The sms config autodeploy enable command enables the SMS-based
deployment function.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 90


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

The undo sms config autodeploy enable command disables the SMS-based
deployment function.
By default, SMS-based deployment is enabled.

Format
sms config autodeploy enable
undo sms config autodeploy enable

Parameters
None

Views
System view

Default Level
3: Management level

Usage Guidelines
As the enterprise network size expands, more branch devices need to be deployed.
Some devices are geographically dispersed and difficult to obtain wired resources
and have services deployed. SMS-based deployment function can solve this
problem. For example, deployment personnel can send deployment short
messages to devices through Short Message Service (SMS). Devices then receive
and parse the short messages, activate 3G/LTE links, and access the file server
through SFTP to obtain and load a configuration file for zero touch deployment in
a batch. By default, SMS-based deployment is enabled. After devices are deployed
successfully, you are advised to disable SMS-based deployment to prevent
unauthorized users from modifying device configurations using forged deployment
short messages.

Example
# Enable SMS-based deployment.
<Huawei> system-view
[Huawei] sms config autodeploy enable
Info: Enable the SMS config function successfully.

Related Topics
3.5.2 sms config caller

3.5.2 sms config caller


Function
The sms config caller command configures a mobile phone number whitelist.
The undo sms config caller command deletes a mobile phone number whitelist.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 91


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

By default, no mobile phone number whitelist is configured.

Format
sms config caller tel-number

undo sms config caller [ tel-number ]

Parameters

Parameter Description Value


tel-number Specifies the mobile phone The value is a string of 3 to 20
number segment in the characters without spaces and can
whitelist. contain digits 0 to 9.

Views
System view

Default Level
3: Management level

Usage Guidelines
Usage Scenario

After devices are deployed successfully, you need to prevent device configurations
from being modified according to short messages sent from unauthorized phone
numbers. You can run the sms config caller command to configure a whitelist
that contains mobile phone number segments. Only the mobile phone numbers
that match all consecutive digits of any mobile phone number segment in the
whitelist are allowed to send short messages for service configurations.

Precautions

Currently, a whitelist can contain a maximum of eight mobile phone number


segments.

Example
# Add the mobile phone number segment 13812345678 to a whitelist to allow the
mobile phone number that matches this number segment to send short messages
for SMS-based deployment.
<Huawei> system-view
[Huawei] sms config caller 13812345678
Info: Succeed in setting whitelist.

Related Topics
3.5.1 sms config autodeploy enable

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 92


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

3.6 Fast Provisioning Configuration Commands

3.6.1 display fast provisioning record

Function
The display fast provisioning record command displays the automatic learning
record of an interface enabled with the fast provisioning function.

Format
display fast provisioning record [ interface interface-type interface-number ]

Parameters

Parameter Description Value


interface interface-type interface- Specifies the type and number of an -
number interface.

Views
All views

Default Level
2: Configuration level

Usage Guidelines
None

Example
# Display the automatic learning records of interfaces enabled with the fast
provisioning function.
<Huawei> system-view
[Huawei] display fast provisioning record
----------Fast Provisioning Record-----------
Ethernet1/0/0.1
State : successful
Vlan : 11
IP : 172.16.0.1 Mask : 8
Fast provisioning num : 1
---------------------------------------------

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 93


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Table 3-10 Description of the display fast provisioning record command output
Item Description

State State of a sub-interface. The value can be:


● successful: The sub-interface has learned and saved the
configuration successfully.
● learning: The sub-interface is learning the configuration
automatically.

Vlan/IP/Mask Configuration information learned by the sub-interface.

Fast provisioning Number of sub-interfaces that have successfully learned


num configurations.
Currently, a maximum of eight sub-interfaces are
supported.

3.6.2 display fast provisioning state


Function
The display fast provisioning state command displays the status of the fast
provisioning function on interfaces.

Format
display fast provisioning state

Parameters
None

Views
All views

Default Level
2: Configuration level

Usage Guidelines
None

Example
# Display the status of the fast provisioning function on interfaces.
<Huawei> system-view
[Huawei] display fast provisioning state
----------Fast Provisioning State-----------
GigabitEthernet0/0/1

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 94


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

GigabitEthernet0/0/1.1
State : enable
GigabitEthernet0/0/1.2
State : disable
---------------------------------------------

Table 3-11 Description of the display fast provisioning state command output

Item Description

State Whether the fast provisioning function is enabled on a sub-


interface.
● enable: The fast provisioning function is enabled on the
sub-interface.
● disable: The fast provisioning function is disabled on the
sub-interface.
● restart: The fast provisioning function is enabled on the
sub-interface after the device restarts.
● inactive: The fast provisioning function is enabled on the
sub-interface, but the physical state of the sub-interface
is Down.

3.6.3 fast provisioning enable

Function
The fast provisioning enable command enables the fast provisioning function
globally.

The undo fast provisioning enable command disables the fast provisioning
function globally.

By default, the fast provisioning function is disabled globally.

Format
fast provisioning enable [ restart ]

undo fast provisioning enable

Parameters
Parameter Description Value
restart Indicates that the fast provisioning function is enabled -
globally after the device restarts.

Views
System view

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 95


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Default Level
2: Configuration level

Usage Guidelines
Use Scenario
To enable the fast provisioning function, run the fast provisioning enable in the
system view.
Precautions
● After the fast provisioning function is disabled globally using the undo fast
provisioning enable command, the fast provisioning function configured on
interfaces also becomes invalid.
● After the fast provisioning function is enabled, the device starts a timer since
the first time the automatic learning function is triggered. The fast
provisioning function is automatically disabled globally and on interfaces 1
hour later. If the device restarts within 1 hour, the fast provisioning function
will not be automatically disabled 1 hour later. In this case, the fast
provisioning function can only be disabled using the undo fast provisioning
enable command.
● The configuration takes effect immediately when the fast provisioning
enable or undo fast provisioning enable command is used to enable or
disable the fast provisioning function.
● The configuration takes effect after the device restarts when the fast
provisioning enable restart command is used to enable the fast provisioning
function.

Example
# Enable the fast provisioning function globally.
<Huawei> system-view
[Huawei] fast provisioning enable

3.6.4 fast-provisioning disable (sub-interface view)


Function
The fast-provisioning disable command disables the fast provisioning function on
a sub-interface.
The undo fast-provisioning disable command enables the fast provisioning
function on a sub-interface.
By default, the fast provisioning function is disabled on a sub-interface. After the
fast provisioning function is enabled on an interface, the function is automatically
enabled on sub-interfaces of the interface.

Format
fast-provisioning disable

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 96


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

undo fast-provisioning disable

Parameters
None

Views
Ethernet sub-interface view, serial sub-interface view, ADSL sub-interface view, GE
sub-interface view

Default Level
2: Configuration level

Usage Guidelines
Use Scenario
When the fast provisioning function is enabled on an interface using the 3.6.5
fast-provisioning enable (interface view) command, all sub-interfaces of the
interface have the function enabled. If the fast provisioning function only needs to
be enabled on some sub-interfaces, run the fast-provisioning disable command
to disable the fast provisioning function on specified sub-interfaces.
Prerequisite
The fast provisioning function has been enabled on the main interface using the
3.6.5 fast-provisioning enable (interface view) command.

Example
# Disable the fast provisioning function on the sub-interface GE1/0/0.1.
<Huawei> system-view
[Huawei] fast provisioning enable
[Huawei] interface gigabitEthernet 1/0/0
[Huawei-GigabitEthernet1/0/0] fast-provisioning enable
[Huawei-GigabitEthernet1/0/0] quit
[Huawei] interface gigabitEthernet 1/0/0.1
[Huawei-GigabitEthernet1/0/0.1] fast-provisioning disable

3.6.5 fast-provisioning enable (interface view)


Function
The fast-provisioning enable command enables the fast provisioning function on
an interface.
The undo fast-provisioning enable command disables the fast provisioning
function on an interface.
By default, the fast provisioning function is disabled on an interface.

Format
fast-provisioning enable

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 97


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

undo fast-provisioning enable

Parameters
None

Views
Ethernet interface view, serial interface view, GE interface view, ADSL interface
view

Default Level
2: Configuration level

Usage Guidelines
Use Scenario

You can run the fast-provisioning enable command to enable the fast
provisioning function on an interface. After the fast provisioning function is
enabled on an interface, sub-interfaces of the interface can automatically learn
and save information such as the VLAN, IP address, and DLCI from the peer device.

Currently, the fast provisioning function is supported by the following three kinds
of sub-interfaces:
● ADSL sub-interface: supports the fast provisioning function only when the
sub-interface is used in an IPoA scenario.
● Serial sub-interface: supports the fast provisioning function only when the
sub-interface is used in a synchronous or asynchronous sub-interface and the
sub-interface type is P2P.
● Ethernet sub-interface: supports the fast provisioning function only in a
scenario where packets carry one VLAN tag.

Prerequisite

The fast provisioning function has been enabled globally using the 3.6.3 fast
provisioning enable command.

Precautions

● After enabling the fast provisioning function on an interface, create a sub-


interface for the interface. Only the sub-interface can automatically learn
information such as the VLAN, IP address, and DLCI from the peer device.
● After the fast provisioning function is enabled, the device starts a timer since
the first time the automatic learning function is triggered. The fast
provisioning function is automatically disabled globally and on interfaces 1
hour later. If the device restarts within 1 hour, the fast provisioning function
will not be automatically disabled 1 hour later. In this case, the fast
provisioning function can only be disabled using the undo fast provisioning
enable command.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 98


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Example
# Enable the fast provisioning function on GE1/0/0.
<Huawei> system-view
[Huawei] fast provisioning enable
[Huawei] interface gigabitEthernet 1/0/0
[Huawei-GigabitEthernet1/0/0] fast-provisioning enable

3.6.6 reset fast-provisioning


Function
The reset fast-provisioning command clears configuration information
automatically learned by an interface using the fast provisioning function.

Format
reset fast-provisioning

Parameters
None

Views
Ethernet interface view, serial interface view, ADSL interface view, Ethernet sub-
interface view, serial sub-interface view, GE interface view, GE sub-interface view,
ADSL sub-interface view

Default Level
2: Configuration level

Usage Guidelines
Use Scenario
You can run the reset fast-provisioning command to clear configuration
information automatically learned by an interface using the fast provisioning
function. Sub-interfaces then can relearn configuration information automatically.
Precautions
● In the main interface view, run the reset fast-provisioning command to clear
all the configuration information learned by sub-interfaces of the main
interface.
● In the sub-interface view, run the reset fast-provisioning command to clear
the IP address learned by the sub-interface.
● After the fast provisioning function is enabled, the device starts a timer since
the first time the automatic learning function is triggered. The fast
provisioning function is automatically disabled globally and on interfaces 1
hour later. If the device restarts within 1 hour, the fast provisioning function
will not be automatically disabled 1 hour later. In this case, the fast

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 99


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

provisioning function can only be disabled using the undo fast provisioning
enable command.

Example
# Reset the status of the fast provisioning function on the sub-interface GE1/0/0.1.
<Huawei> system-view
[Huawei] interface gigabitEthernet 1/0/0.1
[Huawei-GigabitEthernet1/0/0.1] reset fast-provisioning

3.7 First Login Commands

3.7.1 clock datetime


Function
The clock datetime command sets the current date and time on the router.

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

Parameters
Parameter Description Value
HH:MM:SS Specifies the current HH specifies the hour, which is an integer
time on the router. ranging from 0 to 23. MM specifies the
minute, which is an integer ranging from 0
to 59. SS specifies the second, which is an
integer ranging from 0 to 59.
YYYY-MM- Specifies the current YYYY specifies the year, which is an integer
DD date (year, month, ranging from 2000 to 2037. MM specifies
and day) on the the month, which is an integer ranging
router. from 1 to 12. DD specifies the day, which is
an integer ranging from 1 to 31.

Views
User view

Default Level
3: Management level

Usage Guidelines
Usage Scenario
In the scenario where accurate absolute time is required, the current date and
time must be set on the router.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 100


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Prerequisite

The time zone and daylight saving time have been configured using the clock
timezone and clock daylight-saving-time commands. If the time zone and
daylight saving time are not configured, the clock datetime command sets a UTC
time.

Precautions

● The specified time must be in 24-hour format. If you do not specify MM and
SS, their values are 0. You must enter at least one digit to specify HH. For
example, when you enter 0, the time is 00:00:00.
● The specified year must be a four-digit number and the specified month and
day can be a one-digit number. For example, when you enter 2012-9-1, the
time is 2012-09-01.
● If the device is configured to restart at a specified time and if the system time
is changed to be more than 10 minutes later than the specified restart time,
the scheduled restart function will be disabled.

Example
# Set the current time and date of the system to 0:0:0 2012-01-01.
<Huawei> clock datetime 0:0:0 2012-01-01

Related Topics
3.7.4 display clock

3.7.2 clock daylight-saving-time

Function
The clock daylight-saving-time command sets the name, start time, and end
time of the daylight saving time (DST).

The undo clock daylight-saving-time command cancels the DST settings.

By default, DST is not used.

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

clock daylight-saving-time time-zone-name repeating start-time { { fifth | first |


second | third | fourth | last } weekday month | start-date1 } end-time { { first |
second | third | fourth | last } weekday month | end-date1 } offset [ start-year
[ end-year ] ]

undo clock daylight-saving-time

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 101


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Parameters
Parameter Description Value
time-zone- Specifies the name The value is a string of 1 to 32 characters.
name of the DST zone.
one-year Specifies absolute -
DST.
repeating Specifies periodic -
DST.
start-time Specifies the DST The start time is in 24-hour format HH:MM.
start time. HH specifies the hour, which is an integer
ranging from 0 to 23. MM specifies the
minute, which is an integer ranging from 0
to 59. If MM is not specified, DST starts on
the hour. You must enter at least one digit
to specify HH. For example, when you enter
0, the start time is 00:00.

start-date Specifies the DST The start date is in the format YYYY-MM-
start date. DD. YYYY specifies the year, which is an
integer ranging from 2000 to 2037, MM
specifies the month, which is an integer
ranging from 1 to 12, and DD specifies the
day, which is an integer ranging from 1 to
31.
end-time Specifies the DST The end time is in 24-hour format HH:MM.
end time. HH specifies the hour, which is an integer
ranging from 0 to 23. MM specifies the
minute, which is an integer ranging from 0
to 59. If MM is not specified, DST starts on
the hour. You must enter at least one digit
to specify HH. For example, when you enter
0, the start time is 00:00.

end-date Specifies the DST The end date is in the format YYYY-MM-
end date. DD. YYYY specifies the year, which is an
integer ranging from 2000 to 2037, MM
specifies the month, which is an integer
ranging from 1 to 12, and DD specifies the
day, which is an integer ranging from 1 to
31.
fifth Specifies the fifth -
week in a month.
first Specifies the first -
week in a month.
second Specifies the second -
week in a month.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 102


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Parameter Description Value


third Specifies the third -
week in a month.
fourth indicates the fourth -
week in a month.
last Specifies the last -
week in a month.
weekday Specifies a day of The value is Mon, Tue, Wed, Thu, Fri, Sat,
the week. or Sun.
month Specifies a month. The value is Jan, Feb, Mar, Apr, May, Jun,
Jul, Aug, Sep, Oct, Nov, or Dec.
start-date1 Specifies the DST The start date is in the format MM-DD. MM
start date. specifies the month, which is an integer
ranging from 1 to 12, and DD specifies the
day, which is an integer ranging from 1 to
31.
end-date1 Specifies the DST The end date is in the format MM-DD. MM
end date. specifies the month, which is an integer
ranging from 1 to 12, and DD specifies the
day, which is an integer ranging from 1 to
31.
offset Specifies the DST The offset is in 24-hour format HH:MM. HH
offset. specifies the hour, which is an integer
ranging from 0 to 23. MM specifies the
minute, which is an integer ranging from 0
to 59. If MM is not specified, the offset is
the specified hours. You must enter at least
one digit to specify HH.
start-year Specifies the start The start year is in the format YYYY and
year. ranges from 2000 to 2037.
end-year Specifies the end The end year is in the format YYYY and
year. ranges from 2000 to 2037.

Views
User view

Default Level
3: Management level

Usage Guidelines
Usage Scenario
DST, also referred to as summer time, is a convention intended to save resources.
In high latitude areas, sunrise time is earlier in summer than in winter. To reduce

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 103


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

use of incandescent lighting in the evenings and save energy, clocks are adjusted
forward one hour.

Users can customize the DST zone according to their countries' or regions'
convention. In addition, users can set how far ahead clocks are adjusted forward,
usually an hour. With DST enabled, when it is time to start DST, the system time is
adjusted according to the user-specified DST. When it is time to end DST, the
system time automatically returns to the original time.

Configuration Impact

To configure DST, note the following:


● The time in logs and debugging information uses the local time adjusted
based on the time zone and the configured DST.
● The time in the output of the display commands uses the local time adjusted
based on the time zone and the configured DST.

To remove configurations for DST, note the following:


● If DST has already taken effect when you remove the configurations, the
device will adjust its clock by subtracting the value of the offset parameter
from the current time.
● If DST has not taken effect, removing the configurations will not affect the
system time.

Precautions

● The DST is configured in the summer. The DST duration ranges from one day
to one year.
● You can configure the start time and end time for periodic DST in one of the
following modes: date+date, week+week, date+week, and week+date.

Example
# Set periodic DST.
<Huawei> clock daylight-saving-time bj repeating 0 first sun jan 0 first sun apr 2 2009 2009

# Set periodic DST by day.


<Huawei> clock daylight-saving-time bj repeating 12:11 1-1 1:0 3-4 1

# Set absolute DST.


<Huawei> clock daylight-saving-time bj one-year 12:11 2010-10-2 1:00 2010-11-4 1

Related Topics
3.7.3 clock timezone

3.7.3 clock timezone

Function
The clock timezone command sets the local time zone.

The undo clock timezone command deletes the local time zone.

If you do not specify the time zone name, the system uses Default Zone Name.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 104


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Format
clock timezone time-zone-name { add | minus } offset
undo clock timezone

Parameters
Parameter Description Value
time-zone- Specifies the time zone name. The name is a string of 1 to 32
name case-sensitive characters without
spaces.
add Specifies the offset from the -
UTC for the time zone
specified by time-zone-name.
That is, the sum of the default
UTC time zone and offset is
equal to the time zone
specified by time-zone-name.
minus Specifies the offset from the -
UTC for the time zone
specified by time-zone-name.
That is, the remainder
obtained by subtracting offset
from the default UTC time
zone is equal to the time zone
specified by time-zone-name.
offset Specifies the offset from the Format: HH:MM:SS
UTC.
● HH specifies the hour.
– If the local time is earlier
than the UTC, the value is an
integer ranging from 0 to 14.
– If the local time is later than
the UTC, the value is an
integer ranging from 0 to 12.
● MM and SS specify the minute
and second respectively, and
both range from 0 to 59.
● When HH is set to the
maximum value, the MM and
SS values must be 0.

Views
User view

Default Level
3: Management level

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 105


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Usage Guidelines
Usage Scenario

The system clock is the time indicated by the system timestamp. Because the rules
governing local time differ in different regions, the system clock can be configured
to comply with the rules of any given region.

System clock = UTC + Time zone offset + DST offset

To ensure normal communication between devices, set an accurate system clock.


You can run the clock timezone and clock daylight-saving-time commands to
set the time zone and DST offsets.

Precautions

● The specified time must be in 24-hour format. If you do not specify MM and
SS, their values are 0. You must enter at least one digit to specify HH. For
example, when you enter 0, the time is 00:00:00.
● After configuring the local time zone, run the display clock command to view
the configuration. The time in logs and diagnostic information uses the local
time adjusted based on the time zone and DST.

Example
# Set the local time zone name for Beijing China to BJ.

If the default UTC is London time 2012-12-01 00:00:00, Beijing time is London
time plus 08:00 because the offset from UTC is 8 hours.
<Huawei> clock datetime 0:0:0 2012-12-01
<Huawei> clock timezone BJ add 08:00:00

Related Topics
3.7.2 clock daylight-saving-time

3.7.4 display clock

Function
The display clock command displays the current date and clock setting.

Format
display clock

Parameters
None

Views
All views

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 106


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Default Level
1: Monitoring level

Usage Guidelines
Usage Scenario

You can run the display clock command to view the system date and clock setting
and adjust the setting if necessary.

Precautions

The system clock is set using the clock datetime, clock timezone, and clock
daylight-saving-time commands.

● If the three commands are not used, the original system clock is displayed
after you run the display clock command.
● You can use any combination of the three commands to configure the system
time. Table 3-12 lists the formats of the configured time.

The table assumes that the original system time is 08:00:00 on January 1, 2010.
● 1: indicates that the clock datetime command is used, in which the current
time and date is date-time.
● 2: indicates that the clock timezone command is used, in which the time
zone parameter is set and the time offset is zone-offset.
● 3: indicates that the clock daylight-saving-time command is used, in which
the DST parameters are set and the time offset is offset.
● [1]: indicates that the clock datetime command is optional.

Table 3-12 System clock setting examples

Action Configured System Example


Time

1 date-time Command: clock datetime 8:0:0


2011-11-12
Configured system time:
2011-11-12 08:00:02
Saturday
Time Zone(Default Zone Name) : UTC+00:00

2 Original system time Command: clock timezone BJ add 8


± zone-offset Configured system time:
2010-01-01 16:00:27
Friday
Time Zone(BJ) : UTC+08:00

1, 2 date-time ± zone- Commands: clock datetime 8:0:0


offset 2011-11-12 and clock timezone BJ add 8
Configured system time:
2011-11-12 16:00:17
Saturday
Time Zone(BJ) : UTC+08:00

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 107


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Action Configured System Example


Time

[1], 2, 1 date-time Commands: clock timezone NJ add 8 and


clock datetime 9:0:0 2011-11-12
Configured system time:
2011-11-12 09:00:03
Saturday
Time Zone(NJ) : UTC+08:00

3 If the original system Command: clock daylight-saving-time BJ


time is not in the DST one-year 6:0 2011-8-1 6:0 2011-10-01 1
segment, the original Configured system time:
system time is
2010-01-01 08:00:51
displayed. Friday
Time Zone(Default Zone Name) : UTC+00:00
Daylight saving time :
Name : BJ
Repeat mode : one-year
Start year : 2011
End year : 2011
Start time : 08-01 06:00:00
End time : 10-01 06:00:00
Saving time : 01:00:00

If the original system Command: clock daylight-saving-time BJ


time is in the DST one-year 6:0 2010-1-1 6:0 2010-9-1 2
segment, the Configured system time:
configured system
2010-01-01 10:00:08 DST
time is the original Friday
system time plus Time Zone(BJ) : UTC+00:00
offset. Daylight saving time :
Name : BJ
Repeat mode : one-year
Start year : 2010
End year : 2010
Start time : 01-01 06:00:00
End time : 09-01 06:00:00
Saving time : 02:00:00

1, 3 If date-time is not in Commands: clock datetime 9:0:0


the DST segment, the 2011-11-12 and clock daylight-saving-
configured system time BJ one-year 6:0 2012-8-1 6:0
time is date-time. 2012-10-01 1
Configured system time:
2011-11-12 09:00:26
Saturday
Time Zone(Default Zone Name) : UTC+00:00
Daylight saving time :
Name : BJ
Repeat mode : one-year
Start year : 2012
End year : 2012
Start time : 08-01 06:00:00
End time : 10-01 06:00:00
Saving time : 01:00:00

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 108


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Action Configured System Example


Time

If date-time is in the Commands: clock datetime 9:0:0


DST segment, the 2011-11-12 and clock daylight-saving-
configured system time BJ one-year 9:0 2011-11-12 6:0
time is date-time 2011-12-01 2
+offset. Configured system time:
2011-11-12 11:02:21 DST
Saturday
Time Zone(BJ) : UTC+00:00
Daylight saving time :
Name : BJ
Repeat mode : one-year
Start year : 2011
End year : 2011
Start time : 11-12 09:00:00
End time : 12-01 06:00:00
Saving time : 02:00:00

[1], 3, 1 If date-time is not in Commands: clock daylight-saving-time BJ


the DST segment, the one-year 6:0 2012-8-1 6:0 2012-10-01 1
configured system and clock datetime 9:0 2011-11-12
time is date-time. Configured system time:
2011-11-12 09:00:02
Saturday
Time Zone(Default Zone Name) : UTC+00:00
Daylight saving time :
Name : BJ
Repeat mode : one-year
Start year : 2012
End year : 2012
Start time : 08-01 06:00:00
End time : 10-01 06:00:00
Saving time : 01:00:00

If date-time is in the Commands: clock daylight-saving-time BJ


DST segment, the one-year 1:0 2011-1-1 1:0 2011-9-1 2 and
configured system clock datetime 3:0 2011-1-1
time is date-time. Configured system time:
2011-01-01 03:00:19 DST
Saturday
Time Zone(BJ) : UTC+00:00
Daylight saving time :
Name : BJ
Repeat mode : one-year
Start year : 2011
End year : 2011
Start time : 01-01 01:00:00
End time : 09-01 01:00:00
Saving time : 02:00:00

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 109


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Action Configured System Example


Time

2, 3 or 3, If the result of Commands: clock timezone BJ add 8 and


2 original system time clock daylight-saving-time BJ one-year
± zone-offset is not in 6:0 2011-1-1 6:0 2011-9-1 2
the DST segment, the Configured system time:
configured system
2010-01-01 16:01:29
time is equal to the Friday
original system time Time Zone(BJ) : UTC+08:00
± zone-offset. Daylight saving time :
Name : BJ
Repeat mode : one-year
Start year : 2011
End year : 2011
Start time : 01-01 06:00:00
End time : 09-01 06:00:00
Saving time : 02:00:00

If the result of Commands: clock daylight-saving-time BJ


original system time one-year 1:0 2010-1-1 1:0 2010-9-1 2 and
± zone-offset is in the clock timezone BJ add 8
DST segment, the Configured system time:
configured system
2010-01-01 18:05:31 DST
time is equal to the Friday
original system time Time Zone(BJ) : UTC+08:00
± zone-offset ± Daylight saving time :
Name : BJ
offset. Repeat mode : one-year
Start year : 2010
End year : 2010
Start time : 01-01 01:00:00
End time : 09-01 01:00:00
Saving time : 02:00:00

1, 2, 3 or If the value of date- Commands: clock datetime 8:0:0


1, 3, 2 time ± zone-offset is 2011-11-12, clock timezone BJ add 8, and
not in the DST clock daylight-saving-time BJ one-year
segment, the 6:0 2012-1-1 6:0 2012-9-1 2
configured system Configured system time:
time is equal to date-
2011-11-12 08:01:40
time ± zone-offset. Saturday
Time Zone(BJ) : UTC+08:00
Daylight saving time :
Name : BJ
Repeat mode : one-year
Start year : 2012
End year : 2012
Start time : 01-01 06:00:00
End time : 09-01 06:00:00
Saving time : 02:00:00

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 110


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Action Configured System Example


Time

If the value of date- Commands: clock datetime 8:0:0


time ± zone-offset is 2011-1-1, clock daylight-saving-time BJ
in the DST segment, one-year 6:0 2011-1-1 6:0 2011-9-1 2 and
the configured clock timezone BJ add 8
system time is equal Configured system time:
to date-time ± zone-
2011-01-01 10:00:43 DST
offset + offset. Saturday
Time Zone(BJ) : UTC+08:00
Daylight saving time :
Name : BJ
Repeat mode : one-year
Start year : 2011
End year : 2011
Start time : 01-01 06:00:00
End time : 09-01 06:00:00
Saving time : 02:00:00

[1], 2, 3, 1 If date-time is not in Commands: clock daylight-saving-time BJ


or [1], 3, the DST segment, the one-year 6:0 2012-1-1 6:0 2012-9-1 2,
2, 1 configured system clock timezone BJ add 8, and clock
time is date-time. datetime 8:0:0 2011-11-12
Configured system time:
2011-11-12 08:00:03
Saturday
Time Zone(BJ) : UTC+08:00
Daylight saving time :
Name : BJ
Repeat mode : one-year
Start year : 2012
End year : 2012
Start time : 01-01 06:00:00
End time : 09-01 06:00:00
Saving time : 02:00:00

If date-time is in the Commands: clock timezone BJ add 8,


DST segment, the clock daylight-saving-time BJ one-year
configured system 1:0 2011-1-1 1:0 2011-9-1 2, and clock
time is date-time. datetime 3:0:0 2011-1-1
Configured system time:
2011-01-01 03:00:03 DST
Saturday
Time Zone(BJ) : UTC+08:00
Daylight saving time :
Name : BJ
Repeat mode : one-year
Start year : 2011
End year : 2011
Start time : 01-01 01:00:00
End time : 09-01 01:00:00
Saving time : 02:00:00

Example
# Display the current system date and time.
<Huawei> display clock

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 111


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

2012-05-15 20:34:53
Tuesday
Time Zone(Default Zone Name) : UTC+00:00
Daylight saving time :
Name : BJ
Repeat mode : one-year
Start year : 2012
End year : 2012
Start time : 08-01 06:00:00
End time : 10-01 06:00:00
Saving time : 01:00:00

Table 3-13 Description of the display clock command output

Item Description

Time Zone Time zone.

Daylight saving time DST.

Name DST name.

Repeat mode DST mode.


● one-year: absolute DST
● repeating: periodic DST

Start year Year from which DST takes effect.

End year Year when DST becomes ineffective.

Start time Time when DST takes effect.

End time Time when DST becomes ineffective.

Saving time Storage time.

Related Topics
3.7.1 clock datetime
3.7.2 clock daylight-saving-time

3.7.5 sysname

Function
The sysname command sets the device host name.

The undo sysname command restores the default device host name.

By default, the device host name is Huawei.

Format
sysname host-name

undo sysname

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 112


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Parameters
Parameter Description Value
host-name Specifies the host The value is a string of 1 to 246 case-
name. sensitive characters with spaces, "?" not
supported.

Views
System view

Default Level
2: Configuration level

Usage Guidelines
Changing the host name affects the command interface prompt. For example, if
the host name is Huawei, the user interface prompt is <Huawei>.

Example
# Set the host name to HuaweiA.
<Huawei> system-view
[Huawei] sysname HuaweiA
[HuaweiA]

Related Topics
3.1.17 system-view

3.8 UI Configuration Commands

3.8.1 acl (user interface view)

Function
The acl command uses an ACL to restrict login rights of users on a terminal.

The undo acl command cancels the configuration.

By default, login rights are not restricted.

Format
acl [ ipv6 ] acl-number { inbound | outbound }

undo acl [ ipv6 ] { inbound | outbound }

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 113


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Parameters
Parameter Description Value
ipv6 Indicates an ACL6 number. -

acl-number Specifies the number of an ACL. The value is an integer ranging


from 2000 to 3999.
● 2000-2999: restricts the
source address using the
basic ACL.
● 3000-3999: restricts the
source and destination
addresses using the
advanced ACL.

inbound Restricts users with an address or -


within an address segment to log
in to the device.

outbound Restricts users that have logged in -


to the device from logging in to
other devices.

Views
User interface view

Default Level
2: Configuration level

Usage Guidelines
Usage Scenario
This command restricts the login rights of a user interface based on the source IP
address, destination IP address, source port, or destination port. You can use this
command to permit or deny access to a destination or from a source.
Prerequisites
Before running this command, run the acl (system view) in the system view and
run the rule (basic ACL view) or rule (advanced ACL view) command to
configure an ACL.
If no rule is configured, login rights on the user interface are not restricted when
the acl command is executed.
Precautions
After the configurations of the ACL take effect, all users on the user interface are
restricted by the ACL.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 114


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

You can configure all of the following ACL types: IPv4 inbound, IPv4 outbound,
IPv6 inbound, and IPv6 outbound on a user interface. Only one ACL of each type
can be configured on a user interface, and only the latest configuration of an ACL
takes effect.

Example
# Restrict the Telnet login rights on user interface VTY 0.
<Huawei> system-view
[Huawei] acl 3001
[Huawei-acl-adv-3001] rule deny tcp source any destination-port eq telnet
[Huawei-acl-adv-3001] quit
[Huawei] user-interface vty 0
[Huawei-ui-vty0] acl 3001 outbound

# Remove the restriction on the Telnet login rights on user interface VTY 0.
<Huawei> system-view
[Huawei] user-interface vty 0
[Huawei-ui-vty0] undo acl outbound

Related Topics
3.8.25 user-interface

3.8.2 authentication-domain
Function
The authentication-domain command configures an authentication domain for a
type of users.
The undo authentication-domain command restores the default authentication
domain configuration.
By default, the authentication domain is default.

Format
authentication-domain domain-name
undo authentication-domain

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 115


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Parameters
Parameter Description Value

domain-name Specifies the name of an The name is a string of 1


authentication domain. to 64 case-sensitive
characters without
spaces. If the string is
enclosed in double
quotation marks (" "),
the string can contain
spaces. The string cannot
contain the following
characters: * " ? - --.
NOTE
The value must be the
name of an existing
authentication domain in
AAA mode.

Views
User interface view

Default Level
3: Management level

Usage Guidelines
Usage Scenario

You can run the authentication-domain command to change the currently used
authentication domain so that users of different access types can be authenticated
in different authentication domains.

Currently, the device supports console and virtual type terminal (VTY) user interfaces.

Prerequisites

An authentication domain must have been created in AAA mode and the
authentication mode has been set to AAA using the authentication-mode
command.

Precautions

If you change the authentication mode to a non-AAA mode using the


authentication-mode command, the authentication domain configured using the
authentication-domain command restores to default.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 116


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Example
# Configure the authentication domain domain1 for users on the console user
interface.
<Huawei> system-view
[Huawei] aaa
[Huawei-aaa] domain domain1
[Huawei-aaa] quit
[Huawei] user-interface console 0
[Huawei-ui-console0] authentication-mode aaa
[Huawei-ui-console0] authentication-domain domain1

3.8.3 authentication-mode (user interface view)


Function
The authentication-mode command configures the authentication mode for
accessing the user interface.
The undo authentication-mode command deletes the authentication mode for
accessing the user interface.
By default, no authentication mode for accessing the user interface is configured.
For the users logging in to the interface, an authentication method must be
configured; otherwise, users cannot log in.

Format
authentication-mode { aaa | password }
undo authentication-mode

Parameters
Parameter Description Value
aaa Indicates the AAA authentication mode. -
password Indicates the password authentication mode. -

Views
User interface view

Default Level
3: Management level

Usage Guidelines
Usage Scenario
When a user logs in to the device using the console interface for the first time, the
system prompts the user to set the login password. After the user logs in to the
device, the user can run the authentication-mode command to change the
authentication mode.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 117


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Before Telnet or SSH users log in to the device using VTY user interface, they must
run the authentication-mode command to configure the authentication mode.

Precautions

To ensure that users can log in to the device successfully, configure the
authentication mode.

● After you set the authentication mode for accessing a user interface to
password, run the set authentication password command to configure an
authentication password. Keep the password safe. You need to enter the
password when logging in to the device. The levels of commands accessible to
a user depend on the level configured for the user interface to which the user
logs in.
● When the authentication mode is set to aaa, the authentication password is
deleted at the same time. Users are required to enter the login user name and
password to log in to the device. After login, the level of the commands the
user can run depends on the level of the local user specified in AAA
configuration.
● If the current login channel has a password, enter the password when you
want to modify or delete the authentication mode of a VTY channel range
that contains the current login channel.

Example
# Configure the authentication mode for accessing the user interface.
<Huawei> system-view
[Huawei] user-interface vty 0
[Huawei-ui-vty0] authentication-mode aaa

3.8.4 auto-execute command

Function
The auto-execute command command configures auto-run commands.

The undo auto-execute command command cancels auto-run commands.

By default, the auto-run function is disabled.

Format
auto-execute command command

undo auto-execute command

Parameters

Parameter Description Value


command Specifies an auto-run command. -

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 118


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Views
User interface view

Default Level
3: Management level

Usage Guidelines
Usage Scenario
You can run the auto-execute command command to make the device run a
command automatically on the corresponding interface.
You can run the auto-execute command command to enable automatic
execution for the Telnet command.
Precautions
● The auto-execute command command is applicable to the VTY user
interface.
● When you log in to the device, the device automatically runs the commands
that are configured by the auto-execute command command. The user's
terminal disconnects from the device.
● Before saving the configuration of the auto-execute command command,
ensure that you can log in to the device in other ways so that you can cancel
the command configuration.
● If you use the auto-execute command command, you cannot configure the
device in the user interface view. Therefore, use this command with caution.

Example
# Configure the telnet 10.110.100.1 command to automatically run after a user
logs in to the device using the VTY0 interface.
<Huawei> system-view
[Huawei] user-interface vty 0
[Huawei-ui-vty0] auto-execute command telnet 10.110.100.1
Warning: The system will not be configured through ui-vty0.Continue? [Y/N]: y

3.8.5 databits
Function
The databits command sets the number of data bits of the user interface.
The undo databits command restores the default number of data bits.
By default, the number of data bits of the user interface is 8.

Format
databits { 5 | 6 | 7 | 8 }
undo databits

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 119


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Parameters

Parameter Description Value


5 Indicates that the number of data bits is 5. -
6 Indicates that the number of data bits is 6. -
7 Indicates that the number of data bits is 7. -
8 Indicates that the number of data bits is 8. -

Views
User interface view

Default Level
3: Management level

Usage Guidelines
Use this command only when necessary. If the number of data bits of a device's
user interface is changed, ensure that the same number of data bits is set on the
Putty used for login.

The setting is valid only when the serial port is configured to work in
asynchronous mode.

The data bit of the console user interface does not support 5 and 6.

Example
# Set the number of data bits to 7.
<Huawei> system-view
[Huawei] user-interface console 0
[Huawei-ui-console0] databits 7

3.8.6 display mib-index interface

Function
The display mib-index interface command displays the index value of an
interface in the MIB.

Format
display mib-index interface [ interface-type [ interface-number ] ]

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 120


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Parameters

Parameter Description Value


interface-type Specifies the interface for which the index value is -
interface- displayed.
number
● interface-type: specifies the interface type, for
example, Ethernet.
If the interface type is not specified, the index values
of all interfaces are displayed.
● interface-number: specifies the number of an
interface. It is used with interface-type to specify an
interface.
If the interface number is not specified, the index
values of all interfaces of the type are displayed.

Views
All views

Default Level
1: Monitoring level

Usage Guidelines
You can run the display mib-index interface command as an NMS user to view
the index values of interfaces.

Example
# Display indexes of all interfaces.
<Huawei> display mib-index interface
IfName IfIndex PortIndex
--------------------------------------------------
GigabitEthernet0/0/0 3 --
GigabitEthernet0/0/1 4 --
GigabitEthernet0/0/2 5 --

Table 3-14 Description of the display mib-index interface command output

Item Description

IfName Interface name.

IfIndex Index value of an interface.

PortIndex Index value of a port.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 121


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

3.8.7 display user-interface


Function
The display user-interface command displays information about a user interface.

Format
display user-interface [ ui-type ui-number1 | ui-number ] [ summary ]

Parameters
Parameter Description Value
ui-type Displays information about a The value can be Console, VTY, or
specified user interface. TTY.
ui-number1 Displays information about a The minimum value is 0. The
user interface with a specified maximum value is smaller by 1
relative number. than the number of user interfaces
the system supports.
ui-number Displays information about a The value is an integer ranging
user interface with a specified from 0 to 177. The value varies
absolute number. according to the device type.

summary Displays the summary of a -


user interface.

Views
All views

Default Level
1: Monitoring level

Usage Guidelines
Using the display user-interface command, you can view detailed configuration
information about all user interfaces or a specified user interface.

Example
# Display detailed information about the user interface with the absolute number
0.
<Huawei> display user-interface 0
Idx Type Tx/Rx Modem Privi ActualPrivi Auth Int
0 CON 0 9600 - 3 - P -
+ : 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.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 122


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

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.

# Display detailed information about all user interfaces.


<Huawei> display user-interface
Idx Type Tx/Rx Modem Privi ActualPrivi Auth Int
0 CON 0 9600 - 3 - P -
+ 129 VTY 0 - 3 3 A -
+ 130 VTY 1 - 1 2 A -
+ 131 VTY 2 - 3 2 A -
132 VTY 3 - 1 - P -
133 VTY 4 - 1 - A -
...
UI(s) not in async mode -or- with no hardware support:
1-128
+ : 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.

Table 3-15 Description of the display user-interface command output

Parameter Description

+ Active user interface.

F Active user interface in asynchronous mode.

Idx Absolute number of a user interface.

Type Type and relative number of a user interface.

Tx/Rx Data transfer rate of the user interface.

Modem Type of the modem.

Privi Authority configured on a user interface.

ActualPrivi Actual permission of a user interface. In the case of


the AAA authentication mode, the level of a local
user in AAA configuration is the actual permission.

Auth Authentication mode on a user interface.

Int User interface.

A AAA authentication.

N No authentication on the current user interface.

P Password authentication.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 123


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Related Topics
19.1.34 display access-user (All views)

3.8.8 display user-interface maximum-vty


Function
The display user-interface maximum-vty command displays the maximum
number of VTY users.

Format
display user-interface maximum-vty

Parameters
None

Views
All views

Default Level
1: Monitoring level

Usage Guidelines
You can run the display user-interface maximum-vty command to view the
maximum number of users who connect to the device using Telnet or SSH. By
default, the total number of Telnet users and SSH users is five maximum.

Example
# Display the maximum number of VTY users.
<Huawei> display user-interface maximum-vty
Maximum of VTY user : 5

Table 3-16 Description of the display user-interface maximum-vty command


output
Parameter Description

Maximum of VTY user Maximum number of VTY users.


The maximum number of VTY users can be
configured using the user-interface maximum-
vty command.

Related Topics
3.8.27 user-interface maximum-vty

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 124


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

3.8.9 display users

Function
The display users command displays login information for each user interface.

Format
display users [ all ]

Parameters

Parameter Description Value


all Displays information about all users who log in to the device -
through user interfaces, including information about user
interfaces that are not used. If the all parameter is not used,
the command displays only information about user interfaces
that have been connected.

Views
All views

Default Level
3: Management level

Usage Guidelines
You can run this command to view information about users who are connected to
the device. The information includes the user name, IP address, and authentication
and authorization information.

Example
# Run the display users command to view information about users who log in to
the device through the user interface.
<Huawei> display users
User-Intf Delay Type Network Address AuthenStatus AuthorcmdFlag
129 VTY 0 00:00:00 TEL 10.164.6.10 pass
Username : user1
+ 130 VTY 1 00:00:00 TEL 10.164.6.15 pass
Username : user2

Table 3-17 Description of the display users command output

Item Description

+ Terminal line in use.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 125


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Item Description

User-Intf The number in the first column indicates the absolute


number of the user interface, and the number in the second
column indicates the relative number of the user interface.
User Interface type.
● Console: Users who log in through the console port
● VTY: Users who log in using VTY
● TTY: Users who log in using TTY
● WEB: Users who log in through Web system

Delay Interval from the user's latest input to the current time, in
seconds.

Type Connection type.


● Console
● Telnet
● SSH
● Web

Network IP address of the login user.


Address

Username User name for logging in to the device. If the user name is
not specified, Unspecified is displayed.

AuthenStatus Whether the authentication succeeds.

AuthorcmdFlag Command line authorization status.

3.8.10 display vty mode

Function
The display vty mode command displays the current VTY mode.

Format
display vty mode

Parameters
None

Views
All views

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 126


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Default Level
1: Monitoring level

Usage Guidelines
VTY modes are classified into the man-to-machine mode and machine-to-machine
mode.

Example
# Display the VTY mode.
<Huawei> display vty mode
current VTY mode is Human-Machine interface

3.8.11 display vty lines

Function
The display vty lines command lists the number of rows displayed on the VTY
screen.

Format
display vty lines

Parameters
None

Views
All views

Default Level
1: Monitoring level

Usage Guidelines
None

Example
# List the number of lines displayed on the VTY screen.
<Huawei> display vty lines
Current VTY lines is 24.

Related Topics
3.8.18 screen-length

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 127


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

3.8.12 flow-control

Function
The flow-control command configures the flow control mode.

The undo flow-control command restores the default flow control mode.

The default flow control mode is none, that is, flow control is disabled.

Only the AR100&AR120&AR150&AR160&AR200 series and AR2220E do not support this


command.

Format
flow-control { hardware | none }

undo flow-control

Parameters

Parameter Description Value


hardware Specifies that the flow control mode is hardware flow -
control, and it applies only to the console port.
none Specifies that the flow control mode is no flow control. -

Views
User interface view

Default Level
3: Management level

Usage Guidelines
The configuration is effective only when the serial interface works in asynchronous
interaction mode.

Example
# Set the flow control mode to hardware flow control in the user view.
<Huawei> system-view
[Huawei] user-interface console 0
[Huawei-ui-console0] flow-control hardware

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 128


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

3.8.13 free user-interface


Function
The free user-interface command disconnects the device from a specified user
interface.

Format
free user-interface { ui-number | ui-type ui-number1 }

Parameters
Parameter Description Value
ui-number Specifies the absolute The value is an integer ranging from 0
number of a user to 177. The value varies according to
interface. the device type.

ui-type Specifies the type of a user The value can be TTY, Console, or VTY.
interface.
ui-number1 Specifies the relative The minimum value is 0. The maximum
number of a user value is smaller by 1 than the number
interface. of user interfaces the system supports.

Views
User view

Default Level
3: Management level

Usage Guidelines
Usage Scenario
If a user logs in to the device and does not perform an operation or you want to
forbid a user from performing operations on the device, you can run the free
user-interface command to disconnect a specified user's terminal from the device.
After the command is executed, the device logs out the user.
Precautions
The free user-interface command cannot be executed on the current user
interface. For example, if the current user interface is VTY 2, the free user-
interface vty 2 command fails to be executed on VTY 2 and an error message is
displayed.

Example
# Disconnect the device from user-interface 0.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 129


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

<Huawei> free user-interface 0


Warning: User interface Console1 will be freed. Continue? [Y/N]:y

Related Topics
3.1.14 quit
3.8.15 idle-timeout

3.8.14 history-command max-size


Function
The history-command max-size command sets the size of the historical
command buffer.
The undo history-command max-size command restores the default size of the
historical command buffer.
By default, a maximum of 10 previously-used commands can be saved in the
buffer.

Format
history-command max-size size-value
undo history-command max-size

Parameters
Parameter Description Value
size-value Specifies the size of the historical The value is an integer ranging
command buffer. from 0 to 256.

Views
User interface view

Default Level
2: Configuration level

Usage Guidelines
The CLI can automatically save the historical commands that you enter. This
function is similar to that of Doskey. You can invoke and run the historical
commands at any time.

Example
# Set the size of the historical command buffer to 20.
<Huawei> system-view
[Huawei] user-interface console 0
[Huawei-ui-console0] history-command max-size 20

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 130


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Related Topics
3.1.7 display history-command

3.8.15 idle-timeout

Function
The idle-timeout command sets the timeout duration for disconnection from a
user interface.

The undo idle-timeout command restores the default timeout duration.

By default, the timeout duration is 5 minutes.

Format
idle-timeout minutes [ seconds ]

undo idle-timeout

Parameters
Parameter Description Value
minutes Specifies the idle timeout The value is an integer ranging from
duration, in minutes. 0 to 35791, in minutes.
seconds Specifies the idle timeout The value is an integer ranging from
duration, in seconds. 0 to 59, in seconds.

Views
User interface view

Default Level
3: Management level

Usage Guidelines
Usage Scenario

If a user logs in to the device and does not perform an operation, the user
interface is occupied unnecessarily. You can run the idle-timeout command to
disconnect the user's terminal from the device.

Precautions

● If you set the time to zero, then the line connection remains alive until you
close it.
● If the user interface disconnection function is not configured, other users may
fail to log in to the device.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 131


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

● If the idle timeout interval is set to 0 or a large value, the terminal will remain
in the login state, resulting in security risks. You are advised to run the lock
command to lock the current connection.
● You are advised to set the timeout duration to 10-15 minutes.

If AAA authentication is required for login users, the timeout duration configured by the
local-user idle-timeout command takes effect. If no timeout duration is configured or the
undo local-user idle-timeout command is executed in the AAA view, the timeout duration
configured by the idle-timeout command on the user interface takes effect.

Example
# Set the timeout duration to 1 minute and 30 seconds.
<Huawei> system-view
[Huawei] user-interface console 0
[Huawei-ui-console0] idle-timeout 1 30

Related Topics
3.8.13 free user-interface
19.1.57 local-user

3.8.16 parity

Function
The parity command sets the parity bit of a user interface.

The undo parity command disables the parity check.

By default, no parity check is configured.

Format
parity { even | none | odd

undo parity

Parameters
Parameter Description Value
even Specifies even parity check. -
none Specifies no parity check. -
odd Specifies odd parity check. -

Views
User interface view

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 132


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Default Level
3: Management level

Usage Guidelines
The setting is valid only when the serial port is configured to work in
asynchronous mode.

Example
# Set the transmission parity bit on the console interface to no parity.
<Huawei> system-view
[Huawei] user-interface console 0
[Huawei-ui-console0] parity none

3.8.17 protocol inbound

Function
The protocol inbound command specifies the protocols that the VTY user
interface supports.

By default, the system supports SSH and Telnet.

Format
protocol inbound { all | ssh | telnet }

Parameters
Parameter Description Value
all Indicates that all protocols including SSH and Telnet are -
supported.
ssh Indicates that only SSH is supported. -
telnet Indicates that only Telnet is supported. -

Views
User interface view

Default Level
3: Management level

Usage Guidelines
Usage Scenario

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 133


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

To manage and monitor login users, configure the VTY user interface for login
users and run the protocol inbound command to configure the protocols that the
VTY user interface supports.

Prerequisites

If SSH is configured for the user interface using the protocol inbound command,
you must configure the authentication-mode aaa authentication mode to ensure
successful logins. If the password authentication mode is configured, the protocol
inbound ssh command cannot be executed.

Precautions

● The configuration takes effect at the next login.


● When SSH is specified for the VTY user interface, the SSH server function is
enabled, and the RSA key is not configured, a user cannot log in to the SSH
server using SSH.
● Telnet is an insecure protocol. Using SSH is recommended.

Example
# Configure SSH for user interfaces VTY0 to VTY4.
<Huawei> system-view
[Huawei] user-interface vty 0 4
[Huawei-ui-vty0-4] authentication-mode aaa
[Huawei-ui-vty0-4] protocol inbound ssh

Related Topics
3.8.3 authentication-mode (user interface view)

3.8.18 screen-length

Function
The screen-length command sets the number of lines on each terminal screen
after you run a command.

The undo screen-length command restores the default configuration.

By default, the number of lines to be displayed on a terminal screen is 24.

Format
In the user interface view:

screen-length screen-length [ temporary ]

undo screen-length [ temporary ]

In the user view:

screen-length screen-length temporary

undo screen-length temporary

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 134


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Parameters
Parameter Description Value
screen-length Specifies the number of lines The value is an integer that
displayed on a terminal screen. ranges from 0 to 512. The value
0 indicates that all command
output is displayed on one
screen.
temporary Specifies the number of lines -
temporarily displayed on a
terminal screen.

Views
User interface view, user view

Default Level
3: Management level

Usage Guidelines
If you run a command and its output is displayed in more lines than you can see
on one screen, you can reduce the number of lines displayed on each screen.
In general, you do not need to change the number of lines displayed on each
screen. Setting the number of lines to 0 is not recommended. The configuration
takes effect after you log in to the system again.

In the user view, the temporary parameter is mandatory and this command is at the
Monitoring level. The configured value takes effect only on the current VTY user interface
but does not take effect on the next login on the same user interface or login on other VTY
user interfaces.

Example
# Set the number of lines on each screen of the terminal to 30.
<Huawei> system-view
[Huawei] user-interface console 0
[Huawei-ui-console0] screen-length 30

3.8.19 screen-width
Function
The screen-width command sets the number of columns displayed on a terminal
screen.
The undo screen-width command restores the default configuration.
By default, 80 columns are displayed on a terminal screen.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 135


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Format
screen-width screen-width

undo screen-width

Parameters
Parameter Description Value
screen-width Specifies the width of a The value is an integer ranging
terminal screen. from 60 to 512.

Views
All views

Default Level
3: Management level

Usage Guidelines
Usage Scenario

When you log in to the device from a console interface and run the display
interface description [ interface-type [ interface-number ] ] command to view
the interface information, output information does not automatically change to
another line, resulting in wrong format of the output information.

To resolve this problem, run the screen-width command to adjust the information
format. In general, you do not need to adjust the number of columns displayed on
the terminal screen. Setting the number of columns displayed on a screen is not
recommended.

Precautions

The number of columns set using the screen-width command is valid only for the
current interface. The setting is not saved after you log out. When you log in to
the device from the console interface and configure this command, the number of
columns displayed on the terminal screen is valid only for the current console
interface, which has no impact on other users who log in to the device from the
VTY interface or other interfaces. If you log out of the console interface and log in
to the device again, the default width is used for the terminal screen.

This command is valid only for information displayed by the display interface
description [ interface-type [ interface-number ] ] command.

Example
# Set the screen width to 100.
<Huawei> screen-width 100
Warning: This command will change the default screen width. Continue? [Y/N]:y
Info: Succeeded in setting the screen width to 100.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 136


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

3.8.20 set authentication password

Function
The set authentication password command configures a local authentication
password.

By default, the local authentication password is not configured for the device.

Format
set authentication password cipher

Parameters
Parameter Description Value
cipher Indicates a password in cipher text. -

Views
User interface view

Default Level
3: Management level

Usage Guidelines
Usage Scenario

If password authentication is configured for users, you can run the set
authentication password command to change the password or set a password in
cipher text.

Pre-configuration Tasks

Before running the set authentication password command, ensure that password
authentication has been configured for the user interface.

Precautions

● The passwords must meet the following requirements:


– The password is a string of 8 to 128 case-sensitive characters.
– The password must contain at least two of the following characters:
upper-case character, lower-case character, digit, and special character.
The special characters include spaces and the following:
`~!@#$%^&*()-_=+\|[{}];:'",<.>/?
● Password entered in interactive mode is not displayed on the screen.
● Users can press CTRL_C to cancel password modification in the interaction
mode.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 137


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

● If the current login channel has a password, enter the password when you
want to set an authentication password for a VTY channel range that contains
the current login channel.
● If the password authentication is configured but the password is not
configured for the user interface, the user cannot log in to the device.
● If the set authentication password command is executed multiple times, the
latest configuration overrides the previous ones. You can run the set
authentication password command to change the local authentication
password. After the password is changed, a user who wants to log in to the
device must enter the latest password for identity authentication.

Example
# Set the local authentication password for the user interfaces VTY 0-4.
<Huawei> system-view
[Huawei] user-interface vty 0 4
[Huawei-ui-vty0-4] set authentication password cipher
Enter Password(<8-128>):
Confirm Password:
[Huawei-ui-vty0-4]

Related Topics
3.8.3 authentication-mode (user interface view)

3.8.21 shell

Function
The shell command enables terminal services on a user interface.

The undo shell command disables terminal services on a user interface.

By default, terminal services are enabled on Console user interface and a VTY user
interface and disabled on a TTY user interface.

Format
shell

undo shell

Parameters
None

Views
User interface view

Default Level
3: Management level

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 138


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Usage Guidelines
You can use the shell command on a user interface to enable terminal services.
This command enables users to enter commands through this interface to query
device information and configure the device.
You can use the undo shell command on the user interface to disable terminal
services. This command does not allow users to perform any operations through
this interface. After the undo shell command is configured on the console user
interface view, the user interface does not provide access through the console
interface and MiniUSB interface. After using the undo shell command in the VTY
view and TTY view, this user interface does not provide Telnet, STelnet, and SFTP
access.

Example
# Disable terminal services on VTY 0 to VTY 4.
<Huawei> system-view
[Huawei] user-interface vty 0 4
[Huawei-ui-vty0-4] undo shell

3.8.22 speed (user interface view)


Function
The speed command sets the data transfer rate of a user interface.
The undo speed command restores the default data transfer rate of a user
interface.
By default, the data transfer rate is 9600 bit/s.

Format
speed speed-value
undo speed

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 139


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Parameters
Parameter Description Value
speed-value Specifies the data The value is expressed in bit/s.
transfer rate of a
user interface. The asynchronous serial interface supports the
following data transfer rates:
● 600 bit/s
● 1200 bit/s
● 4800 bit/s
● 9600 bit/s
● 19200 bit/s
● 38400 bit/s
● 57600 bit/s
● 115200 bit/s
NOTE
● The console user interface does not support 600
bit/s and 1200 bit/s.

Views
User interface view

Default Level
3: Management level

Usage Guidelines
The setting is valid only when the serial port is configured to work in
asynchronous mode.

Example
# Set the data transfer rate of a user interface to 115200 bit/s.
<Huawei> system-view
[Huawei] user-interface console 0
[Huawei-ui-console0] speed 115200

3.8.23 stopbits

Function
The stopbits command sets the stop bit of a user interface.

The undo stopbits command restores the default stop bit of a user interface.

By default, the stop bit is 1.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 140


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Format
stopbits { 1.5 | 1 | 2 }
undo stopbits

Parameters
Parameter Description Value
1.5 Sets the stop bit to 1.5. -
1 Sets the stop bit to 1. -
2 Sets the stop bit to 2. -

Views
User interface view

Default Level
3: Management level

Usage Guidelines
If the stop bit is 1, the corresponding data bit is 7 or 8.
If the stop bit is 1.5, the corresponding data bit is 5.
If the stop bit is 2, the corresponding data bit is 6, 7, or 8.
The setting is valid only when the serial port is configured to work in
asynchronous mode.

On the console user interface, the stop bit 1.5 is not supported.

Example
# Set the stop bit of a user interface to 2.
<Huawei> system-view
[Huawei] user-interface console 0
[Huawei-ui-console0] stopbits 2

3.8.24 user privilege


Function
The user privilege command configures the user level.
The undo user privilege command restores the default user level.
By default, users who log in to the device using the console interface are at level
15 and other users are at level 0.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 141


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Format
user privilege level level
undo user privilege level

Parameters
Parameter Description Value
level level Specifies the user level. The value is an integer
NOTE ranging from 0 to 15.
The larger the value, the higher the
priority.

Views
User interface view

Default Level
3: Management level

Usage Guidelines
Usage Scenario
The system manages users at levels to control their access permissions. Users who
log in to the device can use only commands at the same or lower level than their
own levels.
Commands are classified into the visit level, monitoring level, configuration level,
and management level that map levels 0, 1, 2, and 3, as listed in Table 3-18.

Table 3-18 Introduction to command levels

User Comm Name Description


Level and
Level

0 0 Visit Commands at this level are diagnosis commands


such as ping and tracert commands and
commands that are used to access a remote
device such as Telnet clients.

1 0 and 1 Monitor Commands at this level are system maintenance


ing commands such as display commands.
NOTE
Some display commands are not at this level. For
example, the display current-configuration and
display saved-configuration commands are at level 3.

2 0, 1, Configu Commands at this level are service configuration


and 2 ration commands.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 142


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

User Comm Name Description


Level and
Level

3-15 0, 1, 2, Manage Commands at this level are system basic


and 3 ment operation commands that support services,
including file system, FTP, TFTP, user management
commands, command level configuration
commands, and debugging commands.

Precautions

If refined right management is required, run the command-privilege level


command to upgrade command levels.

Example
# Set the user level on the VTY0 user interface to 2.
<Huawei> system-view
[Huawei] user-interface vty 0
[Huawei-ui-vty0] user privilege level 2

# Log in to the device using Telnet and view detailed information about the VTY0
user interface.
<Huawei> display user-interface vty 0
Idx Type Tx/Rx Modem Privi ActualPrivi Auth Int
+ 129 VTY 0 - 2 15 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.

Table 3-19 Description of the user privilege level command output.

Item Description

+ Current user interface is active.

F Current user interface is active and work is in


asynchronous mode.

Idx Absolute index of user interface.

Type Type and relative index of user interface.

Privi The privilege of user interface.

ActualPrivi The actual privilege of user interface.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 143


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Item Description

Auth The authentication mode of user interface.

Int The physical location of UIs.

A Authenticate use AAA.

N The current user interface need not be


authenticated.

P Authenticates the user using the password


configured on the current user interface.

Related Topics
3.12.5 display current-configuration
3.12.8 display saved-configuration
3.8.7 display user-interface

3.8.25 user-interface
Function
The user-interface command displays one or multiple user interface views.

Format
user-interface [ ui-type ] first-ui-number [ last-ui-number ]

Parameters
Parameter Description Value
ui-type Specifies the type of a user The value can be console, tty,
interface. or vty.

● If the user interface is


specified, the relative number
is used.
● If the user interface is not
specified, the absolute number
is used.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 144


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Parameter Description Value


first-ui- Specifies the number of the first ● If ui-type is set to console,
number user interface. the first-ui-number value is
0.
● If ui-type is set to vty, the
first-ui-number value
ranges from 0 to the
maximum number of VTY
user interfaces.
● If ui-type is set to tty, the
first-ui-number value
ranges from 1 to the
maximum number of TTY
user interfaces.
last-ui- Specifies the number of the last -
number user interface. When you select
this parameter, you enter multiple
user interface views at the same
time.
This parameter is valid only when
ui-type is set to VTY or TTY. The
last-ui-number value must be
larger than the first-ui-number
number.

Views
System view

Default Level
3: Management level

Usage Guidelines
Usage Scenario
When the network administrator logs in to the device using the console interface,
asynchronous serial interface, Telnet, or SSH, the system manages and monitors
the session between the user and the device on the corresponding user interface.
Each user interface corresponds a user interface view. The network administrator
can set parameters such as authentication and user level to manage sessions in a
unified manner.
Precautions
Only users at level 15 can use this command.
The user interface varies according to the login mode. The user interface views can
be numbered using absolute numbers or relative numbers. Table 3-20 describes
absolute and relative numbers of user interfaces.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 145


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

● The relative numbering uniquely specifies a user interface or a group of user interfaces
of the same type.
● The absolute numbering specifies a user interface or a group of user interfaces.

Table 3-20 Absolute and relative numbers of user interfaces


User Description Absolute Relative Number
Interface Number

Console Manages and controls 0 0


user users that log in to the
interface device using the console
interface.

TTY user Manages and controls 1 to 128 The first one is TTY 1,
interface users that log in to the the second one is TTY
device using the 2, and so forth.
asynchronous serial Absolute numbers 1 to
interface. 128 map relative
NOTE numbers TTY 1 to TTY
The AR150&160&200&510 128.
series does not support the
TTY user interface.

VTY user Manages and controls 129 to 143 The first one is VTY 0,
interface users that log in to the the second one is VTY
device using Telnet or 1, and so forth.
SSH. Absolute numbers 129
to 143 map relative
numbers VTY 0 to VTY
14.

After you log in to the device, you can run the display user-interface command
to view the supported user interfaces and the corresponding relative and absolute
numbers.

Example
# Enter the Console 0 user interface.
<Huawei> system-view
[Huawei] user-interface console 0
[Huawei-ui-console0]

# Enter the VTY 1 user interface.


<Huawei> system-view
[Huawei] user-interface vty 1
[Huawei-ui-vty1]

# Enter the VTY 1 to VTY 3 user interfaces.


<Huawei> system-view
[Huawei] user-interface vty 1 3

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 146


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

[Huawei-ui-vty1-3]

Related Topics
3.8.7 display user-interface

3.8.26 user-interface current


Function
The user-interface current command displays the current user interface view.

Format
user-interface current

Parameters
None

Views
System view

Default Level
3: Management level

Usage Guidelines
Usage Scenario
To enter the current user interface view, run the display user-interface command
without the user interface number.
Precautions
Only users at level 15 can use this command.
The user interface varies according to the login mode. The user interface views can
be numbered using absolute numbers or relative numbers. Table 3-20 describes
absolute and relative numbers of user interfaces.

● The relative numbering uniquely specifies a user interface or a group of user interfaces
of the same type.
● The absolute numbering specifies a user interface or a group of user interfaces.

Example
# Enter the current user view.
<Huawei> system-view
[Huawei] user-interface current
[Huawei-ui-vty1]

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 147


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Related Topics
3.8.25 user-interface
3.8.7 display user-interface

3.8.27 user-interface maximum-vty


Function
The user-interface maximum-vty command configures the maximum number of
login users.

The undo user-interface maximum-vty command restores the default maximum


number of login users.

By default, the maximum number of Telnet and SSH users is 5.

Format
user-interface maximum-vty number

undo user-interface maximum-vty

Parameters
Parameter Description Value
number Specifies the maximum number of The value is an integer ranging
Telnet and SSH users. from 0 to 15.

Views
System view

Default Level
3: Management level

Usage Guidelines
Usage Scenario

The user-interface maximum-vty command configures the maximum number of


login users.

Precautions

● If the maximum number that you set is smaller than the number of current
online users, the system displays a configuration failure message.
● The maximum number of login users set by the user-interface maximum-vty
command is the total number of Telnet and SSH users.
● If the maximum number of login users is set to 0, no user is allowed to log in
to the device using Telnet or SSH.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 148


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Example
# Set the maximum number of Telnet users to 7.
<Huawei> system-view
[Huawei] user-interface maximum-vty 7

Related Topics
3.8.8 display user-interface maximum-vty

3.9 User Login Configuration Commands

3.9.1 connect

Function
The connect command establishes a control connection between a dumb terminal
and a remote server.

The undo connect command closes a control connection between a dumb


terminal and a remote server.

By default, a dumb terminal and a remote server do not establish a control


connection.

Format
connect host [ port-number ] [ -a source-ip-address | -i interface-type interface-
number ] [ -t interval ]

undo connect

Parameters

Parameter Description Value


host Specifies the IP address or host The value is a string of 1 to
name of the remote server. 255 case-insensitive
characters without spaces.
port-number Specifies the port number of a The value is an integer that
remote server. ranges from 1 to 55535. The
default value 23 is the
standard Telnet server port
number.
-a source-ip- Specifies the source IP address The value is in dotted
address of the local router. decimal notation.
-i interface-type Specifies the outbound -
interface-number interface of the local router.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 149


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Parameter Description Value


-t interval Specifies the interval at which The value is an integer that
the local router automatically ranges from 5 to 60, in
establishes a connection to the seconds.
remote server.

Views
TTY user interface view

Default Level
3: Management level

Usage Guidelines
Usage Scenario
If a dumb terminal that has no IP address configured initiates a control connection
setup request to a remote server through the router, run the connect command
on the router to establish a control connection between the dumb terminal and
remote server.
Precautions
The dumb terminal must connect to the asynchronous serial interface of the
router.
If -t interval is not specified, the local router does not automatically establish a
control connection to the remoter server.

Example
# Establish a control connection between the dumb terminal and remote server.
<Huawei> system-view
[Huawei] user-interface tty 41
[Huawei-ui-tty41] undo shell
[Huawei-ui-tty41] connect 1.1.1.2 1025 -a 1.1.1.1

3.9.2 config lock


Function
The config lock command locks the system configuration.
The undo config lock command unlocks the system configuration.
By default, the system configuration is unlocked.

Format
config lock
undo config lock

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 150


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Parameters
None

Views
System view

Default Level
2: Configuration level

Usage Guidelines
Usage Scenario

To prevent other users from modifying or deleting configured data, you can run
the config lock command to lock the configuration management plane before
data configuration. After completing data configuration, run the undo config lock
command to unlock the configuration management plan so that other users can
perform data configuration.

Precautions

The locked system configuration can be unlocked by only the user who locks it,
the super administrator (run the user privilege command to set the user level to
15), or the network management system (NMS) user.

Example
# Lock the system configuration.
<Huawei> system-view
Enter system view, return user view with Ctrl+Z.
[Huawei] config lock
The system config is locked

# Unlock the system configuration.


<Huawei> system-view
Enter system view, return user view with Ctrl+Z.
[Huawei] undo config lock
The system config is unlocked

Related Topics
3.9.4 display config lock

3.9.3 config unlock interval

Function
The config unlock interval command configures the interval for unlocking a
device.

The default interval is 5 minutes.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 151


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Format
config unlock interval time

Parameters
Parameter Description Value
time Specifies the interval for The value is an integer ranging from
unlocking a device. 1 to 255, in minutes.

Views
System view

Default Level
3: Management level

Usage Guidelines
Usage Scenario

If the device configuration is clocked by the config lock command, other users
cannot modify the configuration. In this case, the config unlock interval
command can be used to configure the unlock interval, after which the device
configuration is unlocked automatically.

Precautions

This command can be used by only the super administrator (run the user
privilege command to set the user level to 15) and NMS user.

If you run the command multiple times, only the latest configuration takes effect.

The unlocking interval starts from the last time the current user configures the
system.

Example
# Set the unlock interval to 2 minutes.
<Huawei>system-view
[Huawei]config unlock interval 2

# The following message is displayed when the configured unlock interval arrives.
[Huawei]
The system config is unlocked

Related Topics
3.9.2 config lock
3.9.4 display config lock

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 152


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

3.9.4 display config lock


Function
The display config lock command displays lock information about the system
configuration.

Format
display config lock

Parameters
None

Views
All views

Default Level
2: Configuration level

Usage Guidelines
The information includes whether the system configuration is locked and the lock
duration If you cannot configure the Router after login, run this command. The
command output helps you locate faults. If the system configuration is locked, the
command output includes the following: type, name, and IP address of the user
who locks the configuration. If no IP address is available, locked user IP address
is blank.
If the current system configuration is locks by a user (user A), only users at the
same level as or higher level than user A can query user A information. If users at
a lower level queries user A information, the system displays a message indicating
that the system configuration is locked by a user with a higher level.

Example
# Display lock information about the system configuration (when configuration is
not locked).
<Huawei> display config lock
------------------------------------------------------------------------------
automatically unlocked interval(minute): 5
locked state: unlocked
------------------------------------------------------------------------------

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 153


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Table 3-21 Description of the display config lock command output

Item Description

automatically unlocked Interval after which the system


interval(minute) automatically unlocks the
configuration, in minutes.

locked state Whether the system configuration is


locked. The values are as follows:
● locked: indicates that the system
configuration is locked.
● unlocked: indicates that the system
configuration is not locked.

# Display lock information about the system configuration (when configuration is


locked).
<Huawei> display config lock
------------------------------------------------------------------------------
automatically unlocked interval(minute): 5
locked state: locked
locked user type: telnet
locked user name: huawei
locked user IP address: 192.168.0.1
------------------------------------------------------------------------------

Table 3-22 Description of the display config lock command output

Item Description

automatically unlocked Interval after which the system


interval(minute) automatically unlocks the
configuration, in minutes.

locked state Whether the system configuration is


locked. The values are as follows:
● locked: indicates that the system
configuration is locked.
● unlocked: indicates that the system
configuration is not locked.

locked user type Type of the user who locks the system
configuration. The user can be any of
the following types: NMS user, serial
port user, Telnet user, and web user.

locked user name Name of the user who locks the system
configuration.

locked user IP address IP address of the user who locks the


system configuration. If no IP address is
available, locked user IP address is
blank.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 154


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Related Topics
3.9.2 config lock

3.9.5 display ecc local-key-pair public


Function
The display ecc local-key-pair public command displays information about the
public key in the local Elliptic Curves Cryptography (ECC) key pair.

Format
display ecc local-key-pair public

Parameters
None

Views
All views

Default Level
3: Management level

Usage Guidelines
Usage Scenario
You can run the display ecc local-key-pair public command to check information
about the public key in the local ECC key pair on a client and then copy the public
key to the server. The public key enables a server to authenticate users and
ensures the login of authorized users.
Pre-configuration Tasks
You must run the ecc local-key-pair create command to generate a local ECC
host key pair before using the command.

Example
# Display information about the public key in the local ECC key pair on a client.
<Huawei> display ecc local-key-pair public
=====================================================
Time of Key pair created:2016-06-10 04:45:43+00:00
Key name : localhost_Host_ECC
Key modulus : 256
Key type : ECC encryption Key
Key fingerprint:
=====================================================
Key code:

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 155


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

04B8EC97 382591C6 BE764727 0B06F673 4E3FF3C9 C10F98F9 4D7D9B09 593DF604


D1465979 107F638D 59771BD1 C1C2D325 B7C3A331 9646B76F A9BACA98 4C0F19D2
BC

Host public key for PEM format code:


---- BEGIN SSH2 PUBLIC KEY ----
AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBLjslzglkca+
dkcnCwb2c04/88nBD5j5TX2bCVk99gTRRll5EH9jjVl3G9HBwtMlt8OjMZZGt2+p
usqYTA8Z0rw=
---- END SSH2 PUBLIC KEY ----

Public key code for pasting into OpenSSH authorized_keys file :


ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBLjslzglkca
+dkcnCwb2c04/88nBD5j5TX2bCVk99gTRRll5EH9jjVl3G9HB
wtMlt8OjMZZGt2+pusqYTA8Z0rw= ecdsa-key

Table 3-23 Description of the display ecc local-key-pair public command output
Item Description

Time of Key pair created Time when the public key in the local
ECC key pair is generated, in the format
of YYYY-MM-DD HH:MM:SS.

Key Name Name of the public key in the local ECC


key pair.

Key modulus Length of the public key in the local ECC


key pair.

Key Type Type of the public key in the local ECC


key pair.

Key Code Code of the public key in the local ECC


key pair configured using the ecc local-
key-pair command.

Host public key for PEM format PEM code of the public key in the local
code ECC key pair.

Public key code for pasting into Public key in the local ECC key pair used
OpenSSH authorized_keys file for OpenSSH authentication. Copy the
public key to the authorized_keys file of
OpenSSH to make the key effective.

Related Topics
3.9.13 ecc local-key-pair

3.9.6 display ecc peer-public-key


Function
The display ecc peer-public-key command displays information about the ECC
public key configured on the remote end.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 156


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Format
display ecc peer-public-key [ brief | name key-name ]

Parameters

Parameter Description Value


brief Displays brief information about -
the ECC public key configured on
the remote end.
name key-name Displays the ECC public key with The value is a string of 1
the specified name. to 30 case-sensitive
characters without spaces.

Views
All views

Default Level
3: Management level

Usage Guidelines
Usage Scenario

You can run the display ecc peer-public-key command on a client to check
information about the public key configured on the remote end. The public key
enables a server to authenticate users and ensures the login of authorized users.

Example
# Display brief information about all the ECC public keys.
<Huawei> display ecc peer-public-key brief
------------------------------------------
Bits Name
------------------------------------------
256 testecc
------------------------------------------

# Display detailed information about the ECC public key named testecc.
<Huawei> display ecc peer-public-key name testecc
=====================================
Key name: testecc
Encoding type: OPENSSH
=====================================
Key Code:
ecdsa-sha2-nistp256
AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBHYuJAsMAHPFT53pXNlXAE1YjXvjhdultL
zcDcrzJLqvPxhKALn1WXGPaNfQ
sAFQnsHzUYgICcBz/Cpxb5atVeg= ecdsa-key

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 157


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Table 3-24 Description of the display ecc peer-public-key command output

Item Description

Bits Length of the ECC public key configured


on the remote end.

Name Name of the ECC public key configured


on the remote end.

Key name Name of the ECC public key configured


on the remote end.

Encoding type Encoding format of the ECC public key


configured on the remote end.
● OPENSSH
If OpenSSH is specified, data is Base64
encoded.
OpenSSH is derived from PEM.
● PEM
If PEM is specified, data is Base64
encoded.
● DER
If DER is specified, data is Base16
encoded.

Key Code Code of the public key in the local ECC


key pair configured using the ecc local-
key-pair command.

Related Topics
3.9.14 ecc peer-public-key

3.9.7 display rsa local-key-pair public

Function
The display rsa local-key-pair public command displays the public key in the
local key pair.

Format
display rsa local-key-pair public

Parameters
None

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 158


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Views
All views

Default Level
1: Monitoring level

Usage Guidelines
You can run this command on the client and configure the client public key in the
command output to the SSH server, which ensures that the SSH client validity
check by the SSH server is successful and enables the secure data exchange
between the SSH server and client.

Example
# Display the public key in the local key pair.
<Huawei> display rsa local-key-pair public
=====================================================

Time of Key pair created: 2011-10-06 16:26:37+00:00


Key name: Host
Key type: RSA encryption Key
=====================================================

Key code:
3047
0240
D538B7FC 3AFE1F5B F6C921F9 3D8C5322
905F623A
F0123161 3DA61EEB F5E897CF DC126060
546CC84E
B2AB7424 3EFF5D71 D84C5FE2 3E2BF5B3
D82DD979
A22E4AA1
0203
010001

=====================================================

Time of Key pair created: 2011-10-06 16:26:53+00:00


Key name: Server
Key type: RSA encryption Key
=====================================================

Key code:
3067
0260
C51C2C01 56B06E6C EBF9055C F7AD9781
46B41A31
5FC87282 E53CFE30 8E6321D3 AC74E948
0A010339
E67C290E 2E0E8E40 BF5E1C97 F9C856EF
568DC159
1A6D28ED AFFB474B 43EFB632 CFB0875F
85420EEA
1919095B A5BC38D0 5FFF169E
0BDB3DC3
0203
010001

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 159


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Table 3-25 Description of the display rsa local-key-pair public command output
Item Description

Time of Key pair created Time and date when the public key is
created.

Key Name The value can be the host or server public


key. The server public key is saved only
when the key type is RSA.

Key Type Type of the public key.

Key Code Code of the public key.

Related Topics
3.9.25 rsa local-key-pair create

3.9.8 display rsa peer-public-key


Function
The display rsa peer-public-key command displays the peer public key saved on
the local host. If no parameter is specified, the command displays detailed
information about all peer public keys.

Format
display rsa peer-public-key [ brief | name key-name ]

Parameters
Parameter Description Value
brief Displays the brief information -
about all peer public keys.
name key-name Specifies the key name. The value is a string of 1 to 30
case-insensitive characters
without spaces.

Views
All views

Default Level
1: Monitoring level

Usage Guidelines
Usage Scenario

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 160


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

You can run this command to check detailed information about the RSA public key
and whether the local and peer public keys are the same.
Precautions
You must complete the RSA public key configuration before running this
command.

Example
# Display the brief information about all RSA public keys.
<Huawei> display rsa peer-public-key brief
Name Bits
-------------------------------------
rsakey001 780

Table 3-26 Description of the display rsa peer-public-key brief command output
Item Description

Bits Bits in the public key.

Name Name of the public key.

# Display the detailed information about the RSA public key named rsakey001.
<Huawei> display rsa peer-public-key name rsakey001

=====================================
Key name: rsakey001
=====================================
Key Code:
3067
0260
A3158E6C F252C039 135FFC45 F1E4BA9B 4AED2D88 D99B2463 3E42E13A 92A95A37
45CDF037 1AF1A910 AAE3601C 2EB70589 91AF1BB5 BD66E31A A9150911 859CAB0E
1E10548C D70D000C 55A1A217 F4EA2F06 E44BD438 DA472F14 3FB7087B 45E77C05
0203
010001

Table 3-27 Description of the display rsa peer-public-key name command output
Item Description

Key name Name of the public key.

Key Code Code of the public key.

Related Topics
3.9.27 rsa peer-public-key

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 161


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

3.9.9 display ssh server

Function
The display ssh server command displays the SSH server information.

Format
display ssh server { status | session }

Parameters

Parameter Description Value


status Displays the global configuration on the SSH server. -
session Displays the current session connection information on the -
SSH server.

Views
All views

Default Level
3: Management level

Usage Guidelines
After configuring the SSH attributes, you can run this command to view the
configuration or session connection information on the SSH server to verify that
the SSH connection has been established.

Example
# Display the global configuration on the SSH server.
<Huawei> display ssh server status
SSH version :1.99
SSH connection timeout :120 seconds
SSH server key generating interval :0 hours
SSH Authentication retries :3 times
SFTP Server :Enable
Stelnet server :Enable

Table 3-28 Description of the display ssh server status command output

Item Description

SSH version SSH protocol version. The value can be 1.99 or 2.0.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 162


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Item Description

SSH connection timeout SSH connection timeout interval. The value ranges
from 60 to 120. The default value is 60. The unit is
second.
Run the ssh server timeout command to set this
item.

SSH server key generating Key updating period of the SSH server. The default
interval value is 0. The unit is hour.
Run the ssh server rekey-interval command to
set this item.

SSH authentication retries Number of times for retrying SSH authentication.


The default value is 3.
Run the ssh server authentication-retries
command to set this item.

SFTP Server Status of the SFTP server. By default, it is disabled.


Run the sftp server enable command to set this
item.

Stelnet server Status of the STelnet server. By default, it is


disabled.
Run the stelnet server enable command to set
this item.

# Display the current session connection information on the SSH server.


<Huawei> display ssh server session
--------------------------------------------------------------------
Conn Ver Encry State Auth-type Username
--------------------------------------------------------------------
VTY 0 2 AES run password john
--------------------------------------------------------------------

Table 3-29 Description of the display ssh server session command output
Item Description

Conn VTY connection.

Ver Version number.

Encry Encryption mode.

State Session status on the SSH server.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 163


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Item Description

Auth-type Authentication mode for an SSH user.


The options are as follows:
● password
● rsa
● password-rsa (password and RSA)
● all (password or RSA)
Run the ssh user authentication-type
command to set this item.

Username User name for SSH server


authentication.

Related Topics
3.11.64 sftp server enable
3.9.37 ssh server port
3.9.44 stelnet server enable

3.9.10 display ssh user-information

Function
The display ssh user-information command displays the configuration of all SSH
users.

Format
display ssh user-information [ username ]

Parameters

Parameter Description Value


username Displays the SSH user The value is a string of 1 to 64 case-
name. insensitive characters without spaces.

Views
All views

Default Level
1: Monitoring level

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 164


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Usage Guidelines
This command displays the SSH user name, bound RSA public key name, and
service type.

Example
# Display the configuration of all SSH users.
<Huawei> display ssh user-information
-------------------------------------------------------------------------------
Username Auth-type User-public-key-name
-------------------------------------------------------------------------------
a password null
-------------------------------------------------------------------------------

Table 3-30 Description of the display ssh user-information command output

Item Description

Username SSH user name.

Auth-type Authentication mode for an SSH user. The options


are as follows:
● password
● rsa
● password-rsa (password and RSA)
● all (password or RSA)
Run the ssh user authentication-type command
to set this item.

User-public-key-name Peer RSA public key assigned to an SSH user.


Run the rsa peer-public-key command to set this
item.

Related Topics
3.9.27 rsa peer-public-key
3.9.42 ssh user authentication-type

3.9.11 display telnet server status

Function
The display telnet server status command displays the status and configuration
of the Telnet server.

Format
display telnet server status

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 165


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Parameters
None

Views
All views

Default Level
3: Management level

Usage Guidelines
● You can run this command to check whether the device functions as a Telnet
server.
● You can run this command to check the listening port number of the Telnet
server if you have set the port number by running the telnet server port
port-number command.

Example
# Display the status and configuration of the Telnet server.
<Huawei> display telnet server status
TELNET IPv4 server :Enable
TELNET IPv6 server :Enable
TELNET server port :23

Table 3-31 Description of the display telnet server status command output
Item Description

TELNET IPv4 server IPv4 Telnet server.

TELNET IPv6 server IPv6 Telnet server.

TELNET server port Listening port number of the Telnet


server.

3.9.12 display telnet-client


Function
The display telnet-client command displays the source parameters when the
device works as a Telnet client.

Format
display telnet-client

Parameters
None

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 166


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Views
All views

Default Level
3: Management level

Usage Guidelines
After setting source parameters of the Telnet client, you can run this command to
check the setting result. If you have not set telnet client-source, the default
source IP address is 0.0.0.0.

Example
# Display the source parameters for the device that works as a Telnet client.
<Huawei> display telnet-client
The source address of telnet client is 10.1.1.1

Table 3-32 Description of the display telnet-client command output


Item Description

The source address of telnet client is The source IP address of the Telnet
10.1.1.1 client is 10.1.1.1.

3.9.13 ecc local-key-pair


Function
The ecc local-key-pair create command generates a local ECC host key pair.
The ecc local-key-pair destroy command deletes the local ECC key.

Format
ecc local-key-pair create
ecc local-key-pair destroy

Parameters
None

Views
System view

Default Level
3: Management level

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 167


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Usage Guidelines
Usage Scenario
A local key pair is a prerequisite to a successful SSH login. Compared with the RSA
algorithm used by the rsa local-key-pair create command, the ECC algorithm
shortens the key length, accelerates the encryption, and improves the security. The
length of the server key pair can be 256 bits, 384 bits and 521 bits. By default, the
length of the key pair is 256 bits.
If you no longer need the local ECC key pairs, run the ecc local-key-pair destroy
command to delete them.
Configuration Impact
The ecc local-key-pair destroy command deletes the local ECC host key pair, from
the files on the master and slave main control boards. Exercise caution when you
run this command.
Precautions
● The generated ECC host key pair is named in the format of the Router
name_Host_ECC, such as HUAWEI_Host_ECC.
● The ecc local-key-pair create and ecc local-key-pair destroy commands are
not saved in the configuration file. They only need to be run once and take
effect even after the Router restarts.
● Do not delete the ECC key file from the Router. If the ECC key file is deleted,
the ECC key pair cannot be restored after the Router is restarted.

Example
# Generate a local ECC host key pair
<Huawei> system-view
[Huawei] ecc local-key-pair create
Info: The key name will be: HUAWEI_Host_ECC.
Info: The ECC host key named HUAWEI_Host_ECC already exists.
Warning: Do you want to replace it ? [Y/N]: Y
Info: The key modulus can be any one of the following : 256, 384, 521.
Info: If the key modulus is greater than 512, it may take a few minutes.
Please input the modulus [default=256]:256
Info: Generating keys...
Info: Succeeded in creating the ECC host keys.

# Delete the local ECC host key pair.


<Huawei> system-view
[Huawei] ecc local-key-pair destroy
Info: The name of the key which will be destroyed is HUAWEI_Host_ECC.
Warning: These keys will be destroyed. Continue? [Y/N]:Y
Info: Succeeded in destroying the ECC host keys.

Related Topics
3.9.5 display ecc local-key-pair public

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 168


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

3.9.14 ecc peer-public-key

Function
The ecc peer-public-key command generates an ECC public key and enters the
ECC public key view.

The undo ecc peer-public-key command deletes the ECC public key.

By default, no ECC public key is generated.

Format
ecc peer-public-key key-name encoding-type { der | openssh | pem }

undo ecc peer-public-key key-name

Parameters

Parameter Description Value


key-name Specifies the ECC public key name. The value is a
string of 1 to 30
case-sensitive
characters without
spaces.
encoding-type Specifies the encoding format of the ECC -
public key.
der Sets the encoding format of the ECC public -
key to DER.
DER uses hexadecimal notation to encode
data.

openssh Sets the encoding format of the ECC public -


key to OpenSSH.
OpenSSH uses base64 notation to encode
data.
OpenSSH is revised from PEM.

pem Sets the encoding format of the ECC public -


key to PEM.
PEM uses base64 notation to encode data.

Views
System view

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 169


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Default Level
3: Management level

Usage Guidelines
Usage Scenario
When you use an ECC public key for authentication, specify the public key on the
server for the client of SSH users. When the client logs in to the server, the server
uses the specified public key to authenticate the client.
After you enter the ECC public key view, run the public-key-code begin
command, and copy the ECC public key to the server.
The public key on the client is randomly generated by the client software.
If an ECC public key has been assigned to an SSH user, delete the mapping
between the ECC public key and the SSH user. If you do not delete the mapping,
the undo ecc peer-public-key command cannot delete the ECC public key.
Follow-up Procedure
After you copy the ECC public key generated on the client to the server, perform
the following operations to exit the ECC public key view:
1. Run the public-key-code end command to return to the ECC public key view.
2. Run the peer-public-key end command to exit the ECC public key view and
return to the system view.
Precautions
A maximum of 20 ECC public keys can be configured.
The peer public key supports only PKCS#1. Other PKCS versions are not supported.

Example
# Create an ECC public key and enter the ECC public key view.
<Huawei> system-view
[Huawei] ecc peer-public-key ecc-peer-key encoding-type pem
Info: Enter "ECC public key" view, return system view with "peer-public-key end".
[Huawei-ecc-public-key] public-key-code begin
Info: Enter "ECC key code" view, return the last view with "public-key-code end".
[Huawei-ecc-key-code] ---- BEGIN SSH2 PUBLIC KEY ----
[Huawei-ecc-key-code] AAAAE2VjZHNhLXNoYTItbmlzdHA1MjEAAAAIbmlzdHA1MjEAAACDBL5J4v3pqi5S
[Huawei-ecc-key-code] ALI9lvLw4cdvtpD2AC6sEJXg9GDCD5vGBnkXlKmnOy6d1TyrXx57ZPNnrSdqVkHC
[Huawei-ecc-key-code] sMBa63vSwg1XsVW2qZgx8H57+FJiTPY61b1Vfst9GUif1ymfpB7XrbdYZDownoh0
[Huawei-ecc-key-code] FZNadZtIf2CRc0OeiKXbCSPP25dfoT/DTcc=
[Huawei-ecc-key-code] ---- END SSH2 PUBLIC KEY ----
[Huawei-ecc-key-code] public-key-code end
[Huawei-ecc-public-key] peer-public-key end

# Delete an ECC public key.


<Huawei> system-view
[Huawei] undo ecc peer-public-key ecc-peer-key

Related Topics
3.9.20 public-key-code begin

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 170


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

3.9.21 public-key-code end


3.9.19 peer-public-key end

3.9.15 exline-breaker

Function
The exline-breaker enable command enables the function of adding a line break.

The exline-breaker disable command disables the function of adding a line


break.

By default, the function of adding a line break is disabled.

Format
exline-breaker { enable | disable }

Parameters

Parameter Description Value


enable Enables the function of adding a line break. -
disable Disables the function of adding a line break. -

Views
TTY user interface view

Default Level
3: Management level

Usage Guidelines
The device functions as a calling end to send a line break \r\n. When receiving the
line break, the called end discards \n in the line break. As a result, data of the
calling end differs from that of the called end. In this case, you can run the exline-
breaker enable command to enable the function of adding a line break. After the
function is enabled, the calling end adds a line break \n to \r\n when sending it.
When the called end receives the data, it removes only one \n from the line break.

Example
# Enable the function of adding a line break.
<Huawei> system-view
[Huawei] user-interface tty 41
[Huawei-ui-tty41] undo shell
[Huawei-ui-tty41] exline-breaker enable

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 171


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

3.9.16 language character-set


Function
The language character-set command configures the character set in the system.
The default character set in the system is ISO8859-1, that is, the system only
supports English input.

Format
language character-set character

Parameters
Parameter Description Value
character Specifies the character set in Currently, the system supports the
the system. following character sets: GBK, UTF-8,
and ISO8859-1.

Views
System view

Default Level
3: Management level

Usage Guidelines
Usage Scenario
You can configure the character set so that the system just supports Chinese or
supports Chinese and English input. The character set facilitates device
identification and management, for example, Chinese interface description can be
configured.
Currently, the system supports the following character sets: GBK, UTF-8, and
ISO8859-1. GBK and UTF-8 support both English and Chinese input, whereas
ISO8859-1 supports only English input. GBK is a Chinese character set and UTF-8
is an international character set. To enter Chinese characters on the device,
configure GBK or UTF-8 according to the character set supported on the terminal
login software.
Precaution
The character set supported by the terminal login software affects the display of
Chinese characters. If the character sets in the system and on the terminal login
software are different, Chinese characters may be displayed as garbled characters.
After the character set function is configured, the device cannot work together
with eSight or iManager U2000. The web system only displays the UTF-8 character
set and does not support Chinese input.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 172


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Example
# Configure GBK as the character set in the system.
<Huawei> system-view
[Huawei] language character-set GBK

3.9.17 lock
Function
The lock command locks the current user interface to prevent unauthorized users
from operating the interface.
By default, the system does not automatically lock the current user interface.

Format
lock

Parameters
None

Views
User view

Default Level
3: Management level

Usage Guidelines
Usage Scenario
Lock the current user interface using this command to prevent other users from
operating the interface. The user interfaces consist of console ports, and Virtual
Type Terminals (VTYs).
After using the lock command, you are prompted to input the password twice. If
you input the correct password for twice, the user interface is locked.
Precautions
● The passwords must meet the following requirements:
– The password is a string of 8 to 128 case-sensitive characters.
– The password must contain at least two of the following characters:
upper-case character, lower-case character, digit, and special character.
The special characters include spaces and the following:
`~!@#$%^&*()-_=+\|[{}];:'",<.>/?
● Password entered in interactive mode is not displayed on the screen.
● When you run the lock command to lock the user interface and set a locking
password, you can press CTRL_C to cancel the operation.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 173


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

● To unlock the user interface, press Enter, and then input the correct password
as prompted by the system.

Example
# Lock the current user interface after logging in through the console port.
<Huawei> lock
Enter Password(<8-128>):
Confirm Password:
Info: The terminal is locked.

# To log in to the system after the system is locked, you must press Enter. The
following information is displayed:
Enter Password:

# Enter the correct password and return to the user view.


<Huawei>

3.9.18 matched upper-view


Function
The matched upper-view command allows the system to search for the undo
command in the upper view, and returns to the upper view.
The undo matched upper-view command prohibits the system from searching for
the undo command in the upper view.
By default, the system does not search for the undo command in the upper view.

Format
matched upper-view
undo matched upper-view

Parameters
None

Views
System view

Default Level
3: Management level

Usage Guidelines
When you run the undo command in a view, which is not registered in the current
view, the system searches for the command in the upper view if the system is
allowed to search for the undo command in the upper view. If the system finds
the same undo command, the system executes this command in the upper view. If

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 174


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

the system does not find the same undo command in the upper view, the system
continues to search for this command in other upper views till the system view.
Running this command brings security risks. For example, if you run the undo ftp
server command in the interface view, while this command is not registered in the
interface view, the system automatically searches for it in the upper view, that is,
the system view. In this manner, the system disables the FTP function.
The matched upper-view command is valid only for current login users who run
this command.

Example
# Allow the undo command to be searched for in the upper view.
<Huawei> system-view
[Huawei] matched upper-view
[Huawei] interface gigabitethernet1/0/1
[Huawei-GigabitEthernet1/0/1] undo ftp server
Info: Succeeded in closing the FTP server.
[Huawei]

# Prohibit the undo command from being searched for in the upper view.
<Huawei> system-view
[Huawei] undo matched upper-view
[Huawei] interface gigabitethernet1/0/1
[Huawei-GigabitEthernet1/0/1] undo ftp server
^
Error: Unrecognized command found at '^' position.
[Huawei-GigabitEthernet1/0/1]

Related Topics
3.1.14 quit

3.9.19 peer-public-key end


Function
The peer-public-key end command returns to the system view from the public
key view and saves the configured public keys.

Format
peer-public-key end

Parameters
None

Views
Public key view

Default Level
3: Management level

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 175


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Usage Guidelines
Usage Scenario

You must save the public key generated on the remote host to the local host,
which ensures that the validity check on the remote end is successful. After editing
a public key in the public key view, you can run this command to return to the
system view.

Prerequisites

Before you run this command, the rsa peer-public-key command has been run to
enter the RSA public key view or the ecc peer-public-keycommand has been run
to enter the ECC public key view.

Example
# Return to the system view from the public key view.
<Huawei> system-view
[Huawei] rsa peer-public-key rsakey001
[Huawei-rsa-public-key] public-key-code begin
[Huawei-rsa-key-code] 308188
[Huawei-rsa-key-code] 028180
[Huawei-rsa-key-code] B21315DD 859AD7E4 A6D0D9B8 121F23F0 006BB1BB
[Huawei-rsa-key-code] A443130F 7CDB95D8 4A4AE2F3 D94A73D7 36FDFD5F
[Huawei-rsa-key-code] 411B8B73 3CDD494A 236F35AB 9BBFE19A 7336150B
[Huawei-rsa-key-code] 40A35DE6 2C6A82D7 5C5F2C36 67FBC275 2DF7E4C5
[Huawei-rsa-key-code] 1987178B 8C364D57 DD0AA24A A0C2F87F 474C7931
[Huawei-rsa-key-code] A9F7E8FE E0D5A1B5 092F7112 660BD153 7FB7D5B2
[Huawei-rsa-key-code] 171896FB 1FFC38CD
[Huawei-rsa-key-code] 0203
[Huawei-rsa-key-code] 010001
[Huawei-rsa-key-code] public-key-code end
[Huawei-rsa-public-key] peer-public-key end
[Huawei]

Related Topics
3.9.20 public-key-code begin
3.9.21 public-key-code end
3.9.27 rsa peer-public-key

3.9.20 public-key-code begin

Function
The public-key-code begin command displays the public key editing view.

Format
public-key-code begin

Parameters
None

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 176


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Views
Public key view

Default Level
3: Management level

Usage Guidelines
Usage Scenario
You must save the public key generated on the remote host to the local host,
which ensures that the validity check on the remote end is successful. Run the
public-key-code begin command to display the public key editing view, and enter
the key data. The key characters can contain spaces. You can press Enter to enter
data in another line.
Prerequisite
A key name has been specified by running the rsa peer-public-key, or ecc peer-
public-key command.
Precautions
● The public key must be a hexadecimal character string in the public key
encoding format, and generated by the client or server that supports SSH.
● The public keys displayed by running the display rsa local-key-pair public, or
display ecc local-key-pair public command can be used as the key data to
enter.
● You can successfully edit the public key in a public key pair by entering the
public key in the server key pair or client key pair. In SSH application, only the
public key in the client key pair can be entered as key data. If you enter the
public key in the server key pair, authentication fails during SSH login.

Example
# Display the public key editing view and enter the key data.
<Huawei> system-view
[Huawei] rsa peer-public-key rsakey001
[Huawei-rsa-public-key] public-key-code begin
[Huawei-rsa-key-code] 308188
[Huawei-rsa-key-code] 028180
[Huawei-rsa-key-code] B21315DD 859AD7E4 A6D0D9B8 121F23F0 006BB1BB
[Huawei-rsa-key-code] A443130F 7CDB95D8 4A4AE2F3 D94A73D7 36FDFD5F
[Huawei-rsa-key-code] 411B8B73 3CDD494A 236F35AB 9BBFE19A 7336150B
[Huawei-rsa-key-code] 40A35DE6 2C6A82D7 5C5F2C36 67FBC275 2DF7E4C5
[Huawei-rsa-key-code] 1987178B 8C364D57 DD0AA24A A0C2F87F 474C7931
[Huawei-rsa-key-code] A9F7E8FE E0D5A1B5 092F7112 660BD153 7FB7D5B2
[Huawei-rsa-key-code] 171896FB 1FFC38CD
[Huawei-rsa-key-code] 0203
[Huawei-rsa-key-code] 010001
[Huawei-rsa-key-code] public-key-code end
[Huawei-rsa-public-key] peer-public-key end
[Huawei]

Related Topics
3.9.7 display rsa local-key-pair public

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 177


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

3.9.19 peer-public-key end


3.9.21 public-key-code end
3.9.27 rsa peer-public-key

3.9.21 public-key-code end

Function
The public-key-code end command returns to the public key view from the public
key editing view and saves the configured public keys.

Format
public-key-code end

Parameters
None

Views
Public key editing view

Default Level
3: Management level

Usage Guidelines
Usage Scenario

After this command is run, the process of editing the public key ends. Before
saving the public key, the system will check the validity of the key.
● If there are illegal characters in the public key character string configured by
the user, the system will display a relevant error prompt. The public key
previously configured by the user is discarded, thus the configuration fails.
● If the public key configured is valid, it is saved in the public key chain table of
the client.

Prerequisites

Before you run this command, the public-key-code begin command has been run
to enter the public key edit view.

Precautions

● Generally, in the public key view, only the public-key-code end command can
be used to exit. Thus, in this instance the quit command cannot be used.
● If the legal key coding is not input, the key cannot be generated after the
public-key-code end command is used. The system prompts that generating
the incorrect key fails.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 178


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

● If the key is deleted in another window, the system prompts that the key does
not exist and returns to the system view directly after you run the public-key-
code end command.

Example
# Exit from the RSA public key editing view and saves the RSA key configuration.
<Huawei> system-view
[Huawei] rsa peer-public-key rsakey001
[Huawei-rsa-public-key] public-key-code begin
[Huawei-rsa-key-code] 308188
[Huawei-rsa-key-code] 028180
[Huawei-rsa-key-code] B21315DD 859AD7E4 A6D0D9B8 121F23F0 006BB1BB
[Huawei-rsa-key-code] A443130F 7CDB95D8 4A4AE2F3 D94A73D7 36FDFD5F
[Huawei-rsa-key-code] 411B8B73 3CDD494A 236F35AB 9BBFE19A 7336150B
[Huawei-rsa-key-code] 40A35DE6 2C6A82D7 5C5F2C36 67FBC275 2DF7E4C5
[Huawei-rsa-key-code] 1987178B 8C364D57 DD0AA24A A0C2F87F 474C7931
[Huawei-rsa-key-code] A9F7E8FE E0D5A1B5 092F7112 660BD153 7FB7D5B2
[Huawei-rsa-key-code] 171896FB 1FFC38CD
[Huawei-rsa-key-code] 0203
[Huawei-rsa-key-code] 010001
[Huawei-rsa-key-code] public-key-code end
[Huawei-rsa-public-key] peer-public-key end
[Huawei]

Related Topics
3.9.20 public-key-code begin
3.9.27 rsa peer-public-key

3.9.22 redirect binding vpn-instance


Function
The redirect binding vpn-instance command associates the redirection function
with a VPN instance.
The undo redirect binding vpn-instance command cancels the association
between the redirection function and a VPN instance.
By default, the redirection function is not associated with any VPN instance.

Format
redirect binding vpn-instance vpn-instance-name
undo redirect binding vpn-instance

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 179


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Parameters
Parameter Description Value

vpn-instance-name Specifies the name of a VPN The value is a string


instance. of 1 to 31 case-
sensitive characters,
spaces not supported.
When double
quotation marks are
used around the
string, spaces are
allowed in the string.

Views
User interface view

Default Level
2: Configuration level

Usage Guidelines
Usage Scenario

By default, all users on public and private networks can log in to remote devices
after the redirection function is enabled. To allow only users in a VPN to log in to
a remote device, associate the redirection function with the VPN instance on the
device.

Prerequisite

A VPN instance has been created on the router, and the user-side interface of the
router has been bound to the VPN instance.

The redirection function has been enabled by using the redirect enable command.

Precautions

After the redirection function is associated with a VPN instance, only users in the
VPN instance can use the redirection function to log in to the device remotely.
Users on the public network or other private networks connected to the router are
prevented from logging in to the device remotely.

Example
# Associate the redirection function with the VPN instance vpna.
<Huawei> system-view
[Huawei] user-interface tty 1
[Huawei-ui-tty1] undo shell
[Huawei-ui-tty1] redirect enable
[Huawei-ui-tty1] redirect binding vpn-instance vpna

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 180


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Related Topics
3.9.23 redirect enable

3.9.23 redirect enable

Function
The redirect enable command enables the redirection function on a TTY user
interface.

The undo redirect enable command disables the redirection function on a TTY
user interface.

By default, the redirection function is disabled.

Format
redirect [ ssh ] enable

undo redirect [ ssh ] enable

Parameters
Parameter Description Value
ssh Enables the SSH-based redirection function on a serial port. -

Views
User interface view

Default Level
2: Configuration level

Usage Guidelines
Usage Scenario

The redirection function is used in the following scenarios:

● An electricity system or finance system usually uses serial port terminals to


collect data. These terminals are connected to asynchronous serial ports of a
device. The device receives data flows from the terminals and encapsulates
received data into Ethernet frames to transmit the data on an Ethernet
network. With the redirection function, users can manage and maintain the
terminals remotely.
● Some devices can be managed only through their console ports. In this
scenario, connect their console ports to asynchronous serial ports of a device.
The device can function as a serial port server to manage these devices.

Prerequisite

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 181


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

● There are reachable routes between the operation terminal and the device
that provides the redirection function.
● The 8AS board on the device has registered successfully and asynchronous
serial port corresponding to the TTY user interface on the board is in Up state.
● The asynchronous serial port corresponding to the TTY user interface has
been configured to work in flow mode using the async mode flow command.
Precautions
If the modem function is enabled on a TTY user interface, the redirection function
does not take effect.

Example
# Enable the redirection function on a TTY user interface.
<Huawei> system-view
[Huawei] user-interface tty 9
[Huawei-ui-tty9] undo shell
[Huawei-ui-tty9] redirect enable

Related Topics
3.9.24 redirect listen-port

3.9.24 redirect listen-port


Function
The redirect listen-port command sets a port number for the redirection function
on a TTY user interface.
The undo redirect listen-port command restores the default port number for the
redirection function.
By default, the port number for the redirection function is 2000 plus the TTY user
interface number.

Format
redirect [ ssh ] listen-port port-number
undo redirect [ ssh ] listen-port

Parameters
Parameter Description Value

ssh Enables the SSH-based -


redirection function on a serial
port.

port-number Specifies the port number for the The value is an


redirection function. integer that ranges
from 2129 to 3999.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 182


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Views
User interface view

Default Level
2: Configuration level

Usage Guidelines
Usage Scenario

If the default port number for the redirection function is used by another service,
run the redirect listen-port command to set a new port number.

Prerequisite

The redirection function has been enabled using the redirect enable command.

Example
# Set the port number for the redirection function to 2500.
<Huawei> system-view
[Huawei] user-interface tty 1
[Huawei-ui-tty1] undo shell
[Huawei-ui-tty1] redirect enable
[Huawei-ui-tty1] redirect listen-port 2500

Related Topics
3.9.23 redirect enable

3.9.25 rsa local-key-pair create

Function
The rsa local-key-pair create command generates the local RSA host and server
key pairs.

By default, the local RSA host and server key pairs are not configured.

Format
rsa local-key-pair create

Parameters
None

Views
System view

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 183


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Default Level
2: Configuration level

Usage Guidelines
Usage Scenario
To implement secure data exchange between the server and client, run this
command to generate a local key pair.
Precautions
If the RSA key pair exists, the system prompts you to confirm whether to replace
the original key pair.
After you run this command, the system prompts you to enter the number of bits
in the host key. The difference between the bits in the server and host key pairs
must be at least 128 bits. For a server or host key pair, the minimum length is 512
bits, the maximum length is 2048 bits, and the default length is 2048 bits.

Because a longer key pair provides higher security, you are advised to use key pairs of the
largest length.

After you run this command, the generated key pair is saved in the device and will
not be lost after the device restarts.
This command is not saved in a configuration file.

Example
# Generate the local RSA host and server key pairs.
<Huawei> system-view
[Huawei] rsa local-key-pair create
The key name will be: Host
RSA keys defined for Host already exist.
Confirm to replace them? (y/n)[n]:y
The range of public key size is (512 ~ 2048).
NOTES: If the key modulus is less than 2048,
It will introduce potential security risks.
Input the bits in the modulus[default = 2048]:2048
Generating keys...
......................................................................................+++
....+++
.......................................++++++++
..............++++++++

Related Topics
3.9.26 rsa local-key-pair destroy

3.9.26 rsa local-key-pair destroy


Function
The rsa local-key-pair destroy command deletes all local RSA host and server key
pairs.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 184


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Format
rsa local-key-pair destroy

Parameters
None

Views
System view

Default Level
2: Configuration level

Usage Guidelines
Usage Scenario
To delete the local key pair, run rsa local-key-pair destroy command. If the host
key pair and the service key pair of an SSH server are deleted, run the rsa local-
key-pair create command to create the new host key pair and service key pair for
the SSH server.
After you run this command, verify that all local RSA keys are deleted. This
command is not saved in a configuration file.
Prerequisite
The local RSA keys that can be deleted exist.

Example
# Delete all RSA server keys.
<Huawei> system-view
[Huawei] rsa local-key-pair destroy
% The name for the keys which will be destroyed is Host.
% Confirm to destroy these keys? (y/n)[n]:y

Related Topics
3.9.25 rsa local-key-pair create

3.9.27 rsa peer-public-key


Function
The rsa peer-public-key command configures an encoding format for an RSA
public key and displays the RSA public key view.
The undo rsa peer-public-key command deletes a public key.
By default, the encoding format is distinguished encoding rules (DER) for an RSA
public key.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 185


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Format
rsa peer-public-key key-name [ encoding-type { der | openssh | pem } ]
undo rsa peer-public-key key-name

Parameters
Parameter Description Value
key-name Specifies the rsa public key name. The value is a string of
1 to 30 case-
insensitive characters
without spaces.
NOTE
When double quotation
marks are used around
the string, spaces are
allowed in the string.

encoding- Specifies an encoding format for an RSA -


type public key.
der Specifies the DER format for an RSA -
public key.
DER encodes data in hexadecimal
format.

openssh Specifies the OpenSSH format for an -


RSA public key.
OpenSSH encodes data in base-64
format.
OpenSSH is an encoding format based
on PEM.

pem Specifies the PEM format for an RSA -


public key.
PEM encodes data in base-64 format.

Views
System view

Default Level
2: Configuration level

Usage Guidelines
Usage Scenario

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 186


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

When you use an RSA public key for authentication, you must specify the public
key of the corresponding client for an SSH user on the server. When the client logs
in to the server, the server uses the specified public key to authenticate the client.
You can also save the public key generated on the server to the client. Then the
client can be successfully authenticated by the server when it logs in to the server
for the first time.

Huawei data communications devices support the DER, OpenSSH and PEM
formats for RSA keys. If you use an RSA key in non-DER/OpenSSH/PEM format,
use a third-party tool to convert the key into a key in DER, OpenSSH or PEM
format.

Because a third-party tool is not released with Huawei system software, RSA
usability is unsatisfactory. In addition to DER, RSA keys need to support the
privacy-enhanced mail (PEM) and OpenSSH formats to improve RSA usability.

Third-party software, such as PuTTY, OpenSSH, and OpenSSL, can be used to


generate RSA keys in different formats. The details are as follows:
● The SecureCRT and PuTTY generate RSA keys in PEM format.
● The OpenSSH generates RSA keys in OpenSSH format.
● The OpenSSL generates RSA keys in DER format.

OpenSSL is an open source software. You can download related documents at


http://www.openssl.org/.

After you configure an encoding format for an RSA public key, Huawei data
communications device automatically generates an RSA public key in the
configured encoding format and enters the RSA public key view. Then you can run
the public-key-code begin command and manually copy the RSA public key
generated on the peer device to the local device.

Prerequisite

The public key on the remote host has been obtained and recorded.

Follow-up Procedure

After you copy the RSA public key generated on the peer device to the local
device, perform the following operations to exit the RSA public key view:
1. Run the public-key-code end command to return to the RSA public key view.
2. Run the peer-public-key end command to exit the RSA public key view and
return to the system view.

Precautions

The public key on the client is randomly generated by the client software.

If an RSA public key has assigned to an SSH client, release the binding relationship
between the public key and the SSH client. If you do not release the binding
relationship between them, the undo rsa peer-public-key command will fail to
delete the RSA public key.

The peer public key supports only PKCS#1. Other PKCS versions are not supported.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 187


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Example
# Configure the encoding format for an RSA public key and displays the RSA
public key view.
<Huawei> system-view
[Huawei] rsa peer-public-key rsakey001
Enter "RSA public key" view, return system view with "peer-public-key end".
NOTE: The number of the bits of public key must be between 769 and 2048.
[Huawei-rsa-public-key]

Related Topics
3.9.8 display rsa peer-public-key
3.9.20 public-key-code begin
3.9.21 public-key-code end
3.9.19 peer-public-key end

3.9.28 send

Function
The send command sends messages to all user interfaces.

Format
send { all | ui-number | ui-type ui-number1 }

Parameters
Parameter Description Value
all Specifies that the system sends -
messages to all user interfaces.
ui-number Specifies the absolute number of the The minimum value is 0. The
user interface. maximum value is smaller by
1 than the number of the
user interfaces that the
system supports.
ui-type Specifies the type of the user -
interface.
ui-number1 Specifies the relative number of the -
user interface.

Views
User view

Default Level
1: Monitoring level

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 188


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Usage Guidelines
After you run the send command, the system prompts you to enter the message
to send. After you confirm to send this message, the user who logs in to the
system from the specified user interface can receive this message.

Example
# Send a message to the user interface VTY 0.
<Huawei> send vty 0
Enter message, end with CTRL+Z or Enter; abort with CTRL+C:Hello, good morning!^Z
Warning: Send the message? [Y/N]: y

# After you confirm to send the message, the user who logs in to the Huawei
from VTY 0 can receive this message.
<Huawei>
Info: Receive a message from VTY2:Hello, good morning!

3.9.29 ssh client assign


Function
The ssh client assign command specifies the host public key of the SSH server to
connect on the SSH client.
The undo ssh client assign command cancels the specified host public key of the
SSH server to connect on the SSH client.
By default, the host public key of the server to connect is not specified on the
client.

Format
ssh client servername assign { rsa-key | ecc-key } keyname
undo ssh client servername assign { rsa-key | ecc-key }

Parameters
Parameter Description Value
servername Specifies the host name or IP The value is a string of 1 to
address of the SSH server. 64 characters without spaces.
rsa-key Specifies the RSA public key. -
ecc-key Specifies the ECC public key. -
keyname Specifies the SSH server public key The value is a string of 1 to
name that has been configured on 64 case-insensitive characters
the SSH client. without spaces.

Views
System view

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 189


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Default Level
3: Management level

Usage Guidelines
Usage Scenario

If the SSH client connects to the SSH server for the first time and the first
authentication is not enabled on the SSH client using the ssh client first-time
enable command, the SSH client rejects the access from unauthorized SSH
servers. You need to specify the host public key of the SSH server and the
mapping between the key and SSH server on the SSH client. After that, the client
will determine whether the server is reliable using the correct public key based on
the mapping.

Precautions

The RSA or ECC public key to be assigned to the SSH server must have been
configured on the SSH client using the rsa peer-public-key or ecc peer-public-
key command. If the key has not been configured, the verification for the RSA or
ECC public key of the SSH server on the SSH client fails.

Example
# Assign the RSA public key to the SSH server.
<Huawei> system-view
[Huawei] ssh client 10.164.39.120 assign rsa-key sshrsakey01

# Delete the RSA public key of the SSH server.


<Huawei> system-view
[Huawei] undo ssh client 10.164.39.120 assign rsa-key

Related Topics
3.9.30 ssh client first-time enable

3.9.30 ssh client first-time enable

Function
The ssh client first-time enable command enables the first authentication on the
SSH client.

The undo ssh client first-time enable command disables the first authentication
on the SSH client.

By default, first authentication is disabled on the SSH client.

Format
ssh client first-time enable

undo ssh client first-time enable

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 190


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Parameters
None

Views
System view

Default Level
3: Management level

Usage Guidelines
Usage Scenario
When the SSH client accesses the SSH server for the first time and the public key
of the SSH server is not configured on the SSH client, you can enable the first
authentication for the SSH client to access the SSH server and save the public key
on the SSH client. When the SSH client accesses the SSH server next time, the
saved public key is used to authenticate the SSH server.
Precautions
You can run the ssh client assign command to pre-assign a public key to the SSH
server. In this manner, you can log in to the SSH server successfully at the first
time.

Example
# Enable the first authentication on the SSH client.
<Huawei> system-view
[Huawei] ssh client first-time enable

Related Topics
3.9.29 ssh client assign

3.9.31 ssh server authentication-retries


Function
The ssh server authentication-retries command sets the maximum number of
authentication retries for an SSH connection.
The undo ssh server authentication-retries command restores the default
maximum number of authentication retries for an SSH connection.
The default maximum number of authentication retries for an SSH connection is
3.

Format
ssh server authentication-retries times

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 191


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

undo ssh server authentication-retries

Parameters
Parameter Description Value
times Specifies the maximum number of The value is an integer that
authentication retries for an SSH ranges from 1 to 5.
connection.

Views
System view

Default Level
3: Management level

Usage Guidelines
Usage Scenario
You can run this command to configure the maximum number of authentication
retries for an SSH connection, which prevents server overload due to malicious
access.
Precautions
The configured number of retries takes effect upon the next login.
The total number of RSA and password authentication retries on the SSH client
cannot exceed the maximum number that is set using this command.

Example
# Set the maximum number of times for retrying login authentication to 4.
<Huawei> system-view
[Huawei] ssh server authentication-retries 4

Related Topics
3.9.9 display ssh server

3.9.32 ssh server compatible-ssh1x enable


Function
The ssh server compatible-ssh1x enable command enables the SSH server's
compatibility with earlier versions.
The undo ssh server compatible-ssh1x enable command disables the SSH
server's compatibility with earlier versions.
By default, the server's compatibility with earlier versions is disabled.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 192


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Format
ssh server compatible-ssh1x enable

undo ssh server compatible-ssh1x enable

Parameters
None

Views
System view

Default Level
3: Management level

Usage Guidelines
Usage Scenario

An SSH server needs to be configured with backward compatibility for the version
negotiation between the client and the server. When a TCP connection is set up
between the client and server, the client negotiates with the server on the version
of which the client and the server can work together.

The server compares the version of its own with that sent by the client, and
determines whether it can work with the client.

● If the protocol version on the client is earlier than 1.3 or later than 2.0,
version negotiation fails and the server disconnects from the client.
● If the protocol version on the client is equal to or later than 1.3 and earlier
than 1.99, the SSH1.5 server module is invoked and the SSH1.X process is
performed when the SSH1.X-compatible mode is configured. When the
SSH1.X-incompatible mode is configured, version negotiation fails and the
server disconnects from the client.
● If the protocol version on the client is 1.99 or 2.0, the SSH2.0 server module is
invoked and the SSH2.0 process is performed.

Precautions

● The configuration takes effect upon the next login.


● SSH2.0 has an extended structure and supports more authentication modes
and key exchange methods than SSH1.X. SSH 2.0 can eliminate the security
risks that SSH 1.X has. SSH 2.0 is more secure and therefore is recommended.

Example
# Enable the SSH server's compatibility with earlier versions.
<Huawei> system-view
[Huawei] ssh server compatible-ssh1x enable

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 193


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Related Topics
3.9.9 display ssh server

3.9.33 ssh server cipher

Function
The ssh server cipher command configures the encryption algorithm list of the
SSH server.

The undo ssh server cipher command restores default encryption algorithms of
the SSH server.

By default, an SSH server supports the following encryption algorithms: 3des_cbc,


aes128_cbc, aes128_ctr, aes192_ctr, aes256_ctr, and blowfish_cbc.

Format
ssh server cipher { 3des_cbc | aes128_cbc | aes128_ctr | aes192_ctr | aes256_ctr
| blowfish_cbc | des_cbc } *

undo ssh server cipher

Parameters

Parameter Description Value


3des_cbc Adds the 3DES encryption algorithm in CBC encryption -
mode to the encryption algorithm list of the SSH server.

aes128_cbc Adds the AES128 encryption algorithm in CBC encryption -


mode to the encryption algorithm list of the SSH server.

aes128_ctr Adds the AES128 encryption algorithm in CTR encryption -


mode to the encryption algorithm list of the SSH server.

aes192_ctr Adds the AES192 encryption algorithm in CTR encryption -


mode to the encryption algorithm list of the SSH server.

aes256_ctr Adds the AES256 encryption algorithm in CTR encryption -


mode to the encryption algorithm list of the SSH server.

blowfish_cbc Adds the BLOWFISH encryption algorithm in CBC -


encryption mode to the encryption algorithm list of the
SSH server.

des_cbc Adds the DES encryption algorithm in CBC encryption -


mode to the encryption algorithm list of the SSH server.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 194


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Views
System view

Default Level
3: Management level

Usage Guidelines
Usage Scenario

The server and client negotiate the algorithm for encrypting packets transmitted
between them. You can run the ssh server cipher command to configure the
encryption algorithm list of the SSH server. The server compares the encryption
algorithm list sent from the client with its own encryption algorithm list, and
selects the first matched encryption algorithm for encrypting transmitted packets.
If the encryption algorithm lists of the server and client have no common
encryption algorithm, the encryption algorithm negotiation fails.

For example, run the ssh server cipher { aes256_ctr | aes192_ctr | aes128_ctr } *
command to add the high-security aes256_ctr, aes192_ctr, and aes128_ctr
encryption algorithms to the encryption algorithm list of the SSH server, improving
device security.

Precautions

You are advised not to add the following encryption algorithms to the encryption
algorithm list of the SSH server because they provide low security: 3des_cbc,
aes128_cbc, blowfish_cbc, and des_cbc.

Example
# Add aes256_ctr to the encryption algorithm list of the SSH server.
<Huawei> system-view
[Huawei] ssh server cipher aes256_ctr

3.9.34 ssh server hmac

Function
The ssh server hmac command configures the check algorithm list of the SSH
server.

The undo ssh server hmac command restores default check algorithms of the
SSH server.

By default, an SSH server supports all the check algorithms.

Format
ssh server hmac { md5 | md5_96 | sha1 | sha1_96 | sha2_256 | sha2_256_96 } *

undo ssh server hmac

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 195


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Parameters

Parameter Description Value


md5 Adds the MD5 check algorithm to the HMAC check -
algorithm list of the SSH server.

md5_96 Adds the MD5_96 check algorithm to the HMAC check -


algorithm list of the SSH server.

sha1 Adds the SHA1 check algorithm to the HMAC check -


algorithm list of the SSH server.

sha1_96 Adds the SHA1_96 check algorithm to the HMAC check -


algorithm list of the SSH server.

sha2_256 Adds the SHA2_256 check algorithm to the HMAC check -


algorithm list of the SSH server.

sha2_256_96 Adds the SHA2_256_96 check algorithm to the HMAC -


check algorithm list of the SSH server.

Views
System view

Default Level
3: Management level

Usage Guidelines
Usage Scenario

The server and client negotiate the algorithm for checking packets transmitted
between them. You can run the ssh server hmac command to configure the check
algorithm list of the SSH server. The server compares the check algorithm list sent
from the client with its own check algorithm list, and selects the first matched
check algorithm for checking transmitted packets. If the check algorithm lists of
the server and client have no common check algorithm, the check algorithm
negotiation fails.

For example, run the ssh server hmac sha2_256 command to add the high-
security sha2_256 check algorithm to the HMAC check algorithm list of the SSH
server, improving device security.

Precautions

The check algorithms are arranged in descending order of priority as follows:


sha2_256, sha2_256_96, sha1, sha1_96, md5, and md5_96.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 196


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

You are advised not to add the following HMAC check algorithms to the HMAC
check algorithm list of the SSH server because they provide low security:
sha2_256_96, sha1, sha1_96, md5, and md5_96.

Example
# Add sha2_256 to the check algorithm list of the SSH server.
<Huawei> system-view
[Huawei] ssh server hmac sha2_256

3.9.35 ssh server key-exchange


Function
The ssh server key-exchange command configures a key exchange algorithm list
for an SSH server.
The undo ssh server key-exchange command restores the default setting.
By default, an SSH server supports all key exchange algorithms.

Format
ssh server key-exchange { dh_group_exchange_sha1 | dh_group1_sha1 } *

undo ssh server key-exchange

Parameters
Parameter Description Value
dh_group_exchange_sha1 Adds the Diffie-hellman-group-exchange- -
sha1 algorithm to the key exchange
algorithm list of the SSH server.
dh_group1_sha1 Adds the Diffie-hellman-group1-sha1 -
algorithm to the key exchange algorithm list
of the SSH server.

Views
System view

Default Level
3: Management level

Usage Guidelines
Usage Scenario
An SSH user and a client need to negotiate a key exchange algorithm for the
packets exchanged between them. You can run the ssh server key-exchange
command to configure a key exchange algorithm list for the SSH server. After the

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 197


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

server receives a packet from the client, the server matches the key exchange
algorithm list of the client against its local list and selects the first matched key
exchange algorithm. If no key exchange algorithm is matched, the negotiation
fails.

Precautions

The key exchange algorithms are listed as follows in descending order of security
levels: dh_group_exchange_sha1 and dh_group1_sha1. The
dh_group_exchange_sha1 algorithm is recommended.

You are advised not to add the dh_group1_sha1 algorithm to the key exchange
algorithm list of the SSH server because it provides low security.

Example
# Configure a key exchange algorithm list containing dh_group_exchange_sha1
for the SSH server.
<Huawei> system-view
[Huawei] ssh server key-exchange dh_group_exchange_sha1

3.9.36 ssh server permit interface

Function
The ssh server permit interface command specifies physical interfaces on the
SSH server to which clients can connect.

The undo ssh permit interface command restores the default physical interfaces
on the SSH server to which clients can connect.

By default, clients can connect to all the physical interfaces on the SSH server.

Format
ssh server permit interface { interface-type interface-number } &<1-5>

undo ssh server permit interface

Parameters
Parameter Description Value
interface-type interface-type: specifies the interface type. -
interface-number
interface-number: specifies the interface number.
interface-number and interface-type specify an
interface.

Views
System view

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 198


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Default Level
3: Management level

Usage Guidelines
Usage Scenario
To prevent a client from connecting to the SSH server through an unauthorized
physical interface, you can run the ssh server permit interface command to
specify physical interfaces on the SSH server to which the client can connect.
Precautions
● By default, the client can connect to all the physical interfaces on the SSH
server. When you run this command to specify one physical interface on the
SSH server, the client cannot connect to the other physical interfaces on the
SSH server.
● You can specify a maximum of five interfaces each time you run the ssh
server permit interface command. The latest configuration overrides the
previous one. For example, before you run the command, clients can connect
to three physical interfaces GigabitEthernet 1/0/0, GigabitEthernet 2/0/0, and
GigabitEthernet 3/0/0 on the SSH server. After you run the command to
specify the interface GigabitEthernet 1/0/0, clients can only connect to the
interface GigabitEthernet 1/0/0.

Example
# Specify physical interfaces on the SSH server to which clients can connect.
<Huawei> system-view
[Huawei] ssh server permit interface gigabitethernet 1/0/0 gigabitethernet 2/0/0
Info: Succeeded in setting ssh permit interface.

# Restore the default physical interfaces on the SSH server to which clients can
connect.
<Huawei> system-view
[Huawei] undo ssh server permit interface

3.9.37 ssh server port


Function
The ssh server port command changes the listening port number of the SSH
server.
The undo ssh server port command restores the default listening port number of
the SSH server.
The default listening port number of the SSH server is 22.

Format
ssh server port port-number
undo ssh server port

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 199


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Parameters
Parameter Description Value
port-number Specifies the listening port The value is 22 or an integer
number of the SSH server. ranging from 1025 to 55535.

Views
System view

Default Level
3: Management level

Usage Guidelines
Usage Scenario

Configure the listening port number of the SSH server to prevent from malicious
access to the SSH service standard port and ensure security.

Precautions

The SSH client can log in successfully with no port specified only when the server
is listening on port 22. If the server is listening on another port, the port number
must be specified upon login.

Before changing the current port number, disconnect all devices from the port.
After the port number is changed, the server starts to listen on the new port.

Example
# Set the listening port number of the SSH server is 1025.
<Huawei> system-view
[Huawei] ssh server port 1025

Related Topics
3.9.9 display ssh server
3.11.62 sftp
3.9.43 stelnet

3.9.38 ssh server rekey-interval

Function
The ssh server rekey-interval command sets the interval for updating the SSH
server key pair.

The undo ssh server rekey-interval command restores the default interval for
updating the SSH server key pair.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 200


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

The default interval for updating the SSH server key pair is 0, indicating that the
key pair is never updated.

Format
ssh server rekey-interval hours

undo ssh server rekey-interval

Parameters

Parameter Description Value


hours Specifies the interval for The value is an integer that ranges
updating the server key pair. from 1 to 24, in hours.

Views
System view

Default Level
3: Management level

Usage Guidelines
Usage Scenario

If the server key pair is not updated for a long time, the key is easy to decrypt and
the server is insecure. After the interval for updating the SSH server key pair is set
using this command, the system will automatically update the key pair at
intervals.

Precautions

If the client is connected to the server, the server public key on the client is not
updated immediately. This key is updated only when the client is reconnected to
the server.

Example
# Set the interval for updating the SSH server key pair to 2 hours.
<Huawei> system-view
[Huawei] ssh server rekey-interval 2

Related Topics
3.9.9 display ssh server

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 201


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

3.9.39 ssh server timeout


Function
The ssh server timeout command sets the timeout interval for SSH connection
authentication.
The undo ssh server timeout restores the default timeout interval for SSH
connection authentication.
The default timeout interval for SSH connection authentication is 60 seconds.

Format
ssh server timeout seconds
undo ssh server timeout

Parameters
Parameter Description Value
seconds Specifies the timeout interval for The value is an integer ranging
SSH connection authentication. from 60 to 120, in seconds.

Views
System view

Default Level
3: Management level

Usage Guidelines
Usage Scenario
If you have not logged in successfully at the timeout interval for SSH connection
authentication, the current connection is terminated to ensure security. You can
run the display ssh server command to query the current timeout interval.
Precautions
The setting for the timeout interval takes effect upon next login.

Example
# Set the SSH connection authentication timeout interval to 90 seconds.
<Huawei> system-view
[Huawei] ssh server timeout 90

Related Topics
3.9.9 display ssh server

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 202


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

3.9.40 ssh server-source


Function
The ssh server-source command specifies a source IP address for an SSH server.
The undo ssh server-source command deletes the source IP address of an SSH
server.
By default, the source IP address of an SSH server is not specified.

Format
ssh server-source { -a [ ipv6 ] source-ip-address | -i [ ipv6 ] interface-type
interface-number }
undo ssh [ ipv6 ] server-source

Parameters
Parameter Description Value
ipv6 Configures the SSH server to support an IPv6 -
source address.

-a source-ip-address Specifies the source IP address for the SSH server. -


The loopback IP address is recommended.

-i interface-type Specifies the loopback interface of the SSH server -


interface-number as the source interface.
If no loopback interface is configured or no IP
address is configured for the source interface, the
command fails to be executed.

Views
System view

Default Level
3: Management level

Usage Guidelines
Usage Scenario
If no source IP address is specified, the SSH server uses the source IP address
specified by routes to send and receive packets. The source IP address must be
configured for an interface with stable performance, such as the loopback
interface. Using the loopback interface as the source IP address simplifies the ACL
rule and security policy configuration. This shields the IP address differences and

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 203


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

interface status impact, filters incoming and outgoing packets, and implements
security authentication.
Precautions
● After the source IP address is specified for the SSH server, you must use the
specified IP address to log in to the SSH server.
● If the configured source IP address does not exist on the SSH server, configure
this IP address on the device and then restart the SSH service. Then you can
log in to the device.
● If the SSH service has been enabled, the SSH service restarts after the ssh
server-source command is executed.
● If the specified source interface has been bound to a VPN instance, the SSH
server is automatically bound to the same VPN instance.

Example
# Set the source IP address of the SSH server to LoopBack0.
<Huawei> system-view
[Huawei] ssh server-source -i loopback 0
Info: Succeeded in closing the STELNET server.
Info: Succeeded in setting the source interface of the ssh server to LoopBack0
Info: Succeeded in starting the STELNET server.

Related Topics
3.9.43 stelnet
3.9.44 stelnet server enable
3.9.37 ssh server port

3.9.41 ssh user assign


Function
The ssh user assign command assigns an existing public key to a user.
The undo ssh user assign command deletes the mapping between the user and
public key.
By default, no public key is assigned to a user.

Format
ssh user user-name assign { rsa-key | ecc-key } key-name
undo ssh user user-name assign { rsa-key | ecc-key }

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 204


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Parameters
Parameter Description Value
user-name Specifies the SSH user name. The value is a string of 1 to 64 case-
insensitive characters without spaces.

rsa-key Specifies the RSA public key. -


ecc-key Specifies the ECC public key. -
key-name Specifies the client public key The name is a string of 1 to 30 case-
name. insensitive characters without a blank
space.

Views
System view

Default Level
3: Management level

Usage Guidelines
Usage Scenario
When an SSH client needs to log in to the SSH server in RSA or ECC mode, run
this command to assign a public key to the client. If the client has been assigned
keys, the latest assigned key takes effect.
Precautions
The newly configured public key takes effect upon next login.
If the user named user-name to whom a public key is assigned does not exist, the
system automatically creates an SSH user named user-name and performs the
configured authentication for the SSH user.

Example
# Assign key1 to a user named John.
<Huawei> system-view
[Huawei] ssh user john assign rsa-key key1

Related Topics
3.9.10 display ssh user-information

3.9.42 ssh user authentication-type


Function
The ssh user authentication-type command configures the authentication mode
for an SSH user.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 205


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

The undo ssh user authentication-type command restores the default


authentication mode for an SSH user.

By default, the password authentication mode is configured for an SSH user.

Format
ssh user [ user-name ] authentication-type { password | rsa | password-rsa |
ecc | password-ecc | all }

undo ssh user user-name authentication-type

Parameters

Parameter Description Value


user-name Specifies the SSH user name. The value is a
string of 1 to 64
case-insensitive
characters
without spaces.

password Specifies the password authentication mode. -


rsa Specifies the RSA authentication mode. -
password-rsa Specifies the password and RSA authentication -
mode.
ecc Specifies the ECC authentication mode. -
password-ecc Specifies the password and ECC authentication -
mode.
all Specifies the password, RSA or ECC -
authentication mode.
NOTE
In all authentication mode, the user priority depends
on the authentication mode selected.
● If password authentication is selected, the user
priority is the same as that specified on the AAA
module.
● If RSA/ECC authentication is selected, the user
priority depends on the priority of the VTY
window used during user access.
If all authentication is selected and an AAA user with
the same name as the SSH user exists, user priorities
may be different in password authentication and
RSA/ECC authentication modes. Set relevant
parameters as needed.

Views
System view

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 206


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Default Level
3: Management level

Usage Guidelines
Usage Scenario
When you configure the authentication mode for an SSH user, the system
automatically creates an SSH user named user-name if the user-name user does
not exist.
Table 3-33 describes the usage scenarios for different authentication modes.

Table 3-33 Usage scenarios for authentication modes

Authentication Mode Usage Scenario

RSA It is a public key encryption


architecture and an asymmetric
encryption algorithm. Based on the
problem of factoring large numbers,
RSA is mainly used to transmit the
keys of the symmetric encryption
algorithm, which can improve
encryption efficiency and simplify key
management. The server checks
whether the SSH user, public key, and
digital user signature are valid. If all of
them are valid, the user is permitted to
access the server. If any of them is
invalid, the authentication fails and
the user is denied to access the server.

ECC Like RSA authentication, the server


first checks the validity of the SSH user
and whether the public key and the
numeric signature are valid. If all of
them are consistent with those
configured on the server, user
authentication succeeds. If any of the
three cannot pass authentication, the
user access is denied. Compared with
the RSA algorithm, the ECC
authentication has the following
advantages:
● Provides the same security with
shorter key length.
● Features a shorter computing
process and higher processing
speed.
● Requires less storage space.
● Requires lower bandwidth.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 207


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Authentication Mode Usage Scenario

password On the server, the AAA module assigns


each authorized user a password for
login. The server has the mapping
between user names and passwords.
When a user requests to access the
server, the server authenticates the
user name and password. If either of
them fails to be authenticated, the
access request of the user is denied.
The account information of users who
are configured with the password
authentication mode can be
configured on devices or remote
authentication servers (for example,
RADIUS servers).

password-rsa, or password-ecc The SSH server authenticates a client


by checking both the public key and
password. The client can be
authenticated only when both the
public key and password meet the
requirement.

all In this authentication mode, the SSH


server authenticates a client by
checking the public key or password.
The client can be authenticated when
either the public key or password
meets the requirement.

Precautions
A new SSH user cannot log in to the SSH server unless being configured with an
authentication mode. The newly configured authentication mode takes effect
upon next login.

Example
# Configure the password authentication mode for an SSH user John.
<Huawei> system-view
[Huawei] ssh user john authentication-type password

Related Topics
3.9.10 display ssh user-information

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 208


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

3.9.43 stelnet
Function
The stelnet command enables you to use the STelnet protocol to log in to another
device from the current device.

Format
# IPv4 address
stelnet [ -a source-address ] host-ip [ port-number ] [ [ -vpn-instance vpn-
instance-name ] | [ identity-key { rsa | ecc } ] | [ user-identity-key { rsa | ecc } ] |
[ prefer_kex { dh_group1 | dh_exchange_group } ] | [ prefer_ctos_cipher { 3des |
aes128 | aes128-ctr | aes192-ctr | aes256-ctr } ] | [ prefer_stoc_cipher { 3des |
aes128 | aes128-ctr | aes192-ctr | aes256-ctr } ] | [ prefer_ctos_hmac { sha1 |
sha1_96 | md5 | md5_96 | sha2_256 | sha2_256_96 } ] | [ prefer_stoc_hmac
{ sha1 | sha1_96 | md5 | md5_96 | sha2_256 | sha2_256_96 } ] ] * [ -ki
aliveinterval [ -kc alivecountmax ] ]
# IPv6 address
stelnet ipv6 [ -a source-address ] host-ipv6 [ -oi interface-type interface-
number ] [ port-number ] [ [ -vpn6-instance vpn-instance-name ] | [ identity-
key { rsa | ecc } ] | [ user-identity-key { rsa | ecc } ] | [ prefer_kex { dh_group1 |
dh_exchange_group } ] | [ prefer_ctos_cipher { 3des | aes128 | aes128-ctr |
aes192-ctr | aes256-ctr } ] | [ prefer_stoc_cipher { 3des | aes128 | aes128-ctr |
aes192-ctr | aes256-ctr } ] | [ prefer_ctos_hmac { sha1 | sha1_96 | md5 |
md5_96 | sha2_256 | sha2_256_96 } ] | [ prefer_stoc_hmac { sha1 | sha1_96 |
md5 | md5_96 | sha2_256 | sha2_256_96 } ] ] * [ -ki aliveinterval [ -kc
alivecountmax ] ]

Parameters
Parameter Description Value
ipv6 Specifies an IPv6 address. -

-a source-address Specifies the STelnet source -


IP address.
host-ip Specifies the IP address or The value is a string of 1
host name of the remote IPv4 to 255 case-insensitive
STelnet server. characters without spaces.
When double quotation
marks are used around
the string, spaces are
allowed in the string.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 209


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Parameter Description Value


host-ipv6 Specifies the IPv6 address or The value is a string of 1
host name of the remote IPv6 to 255 case-insensitive
STelnet server. characters without spaces.
When double quotation
marks are used around
the string, spaces are
allowed in the string.
-oi interface-type Specifies the outbound If the IPv6 address of the
interface-number interface on the local device. remote host is linked to a
local address, the
outbound interface must
be specified.
port-number Specifies the port number The value is an integer
that the SSH server is that ranges from 1 to
listening on. 65535. The default value
22 is the standard port
number.
identity-key Specifies the public key for The public key algorithm
server authentication. include RSA and ECC.
user-identity-key Specifies the public key The public key algorithm
algorithm for the client include RSA and ECC.
authentication. NOTE
If the user-identity-key
parameter is not used, RSA
authentication is used by
default. You can specify ECC
authentication using the
user-identity-key
parameter.

prefer_kex Specifies the preferred key The default key exchange


exchange algorithm. The algorithm is dh_group1.
dh_group1 and
dh_exchange_group
algorithms are supported
currently.

prefer_ctos_cipher Specifies the preferred Encryption algorithms


encryption algorithm from 3des, aes128, aes128-ctr,
the client to the server. aes192-ctr, and aes256-
ctr are supported
currently.
The default algorithm is
aes128.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 210


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Parameter Description Value


prefer_stoc_cipher Specifies the preferred The default algorithm is
encryption algorithm from aes128.
the server to the client.
Encryption algorithms 3des,
aes128, aes128-ctr, aes192-
ctr, and aes256-ctr are
supported currently.

prefer_ctos_hmac Specifies the preferred HMAC The default algorithm is


algorithm from the client to sha1_96.
the server. The sha2_256,
sha2_256_96, sha1, sha1_96,
md5, and md5_96 algorithms
are supported currently.

prefer_stoc_hmac Specifies the preferred HMAC The default algorithm is


algorithm from the server to sha1_96.
the client. The sha2_256,
sha2_256_96, sha1, sha1_96,
md5, and md5_96 algorithms
are supported currently.

-vpn-instance vpn- Specifies the name of the The value is a string of 1


instance-name VPN instance to which the to 31 case-sensitive
IPv4 server belongs. characters, spaces not
supported. When double
quotation marks are used
around the string, spaces
are allowed in the string.
-vpn6-instance vpn- Specifies the name of the The value is a string of 1
instance-name VPN instance to which the to 31 case-sensitive
IPv6 server belongs. characters, spaces not
supported. When double
quotation marks are used
around the string, spaces
are allowed in the string.
-ki aliveinterval Specifies the interval for The value is an integer
sending keepalive packets that ranges from 1 to
when no packet is received. 3600, in seconds.
-kc alivecountmax Specifies the number of times The value is an integer
for no reply of keepalive that ranges from 3 to 10.
packets. The default value is 5.

Views
System view

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 211


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Default Level
3: Management level

Usage Guidelines
Usage Scenario

Logins through Telnet bring security risks because Telnet does not provide any
authentication mechanism and data is transmitted using TCP in plain text.
Compared with Telnet, SSH guarantees secure file transfer on a traditional
insecure network by authenticating clients and encrypting data in bidirectional
mode. The SSH protocol supports STelnet. You can run this command to use
STelnet to log in to another device from the current device.

STelnet is a secure Telnet service. SSH users can use the STelnet service in the
same way as the Telnet service.

When a fault occurs in the connection between the client and server, the client
needs to detect the fault in real time and proactively release the connection. You
need to set the interval for sending keepalive packets and the maximum number
of times on the client that logs in to the server through STelnet.

● Interval for sending keepalive packets: If a client does not receive any packet
within the specified interval, the client sends a keepalive packet to the server.
● Maximum number of times the server has no response: If the number of
times that the server does not respond exceeds the specified value, the client
proactively releases the connection.
Precautions
● Enable the STelnet service on the SSH server by stelnet server enable
command, before connecting the SSH server by using the STelnet command.
● The SSH client can log in to the SSH server with no port specified only when
the server is listening on port 22. If the server is listening on another port, the
port number must be specified upon login.
● 3DES, MD5, MD5_96, SHA1, and SHA1_96 encryption algorithm cannot
ensure security. sha2_256, sha2_256_96, AES128, AES128-CTR, AES192-CTR or
AES256-CTR encryption algorithm is recommended.

Example
# Set keepalive parameters when the client logs in to the server through STelnet.
<Huawei> system-view
[Huawei] stelnet 10.164.39.209 -ki 10 -kc 4

# Remotely connect to the STelnet server that uses an IPv6 address.


<Huawei> system-view
[Huawei] stelnet ipv6 fc00:2001:db8::1 prefer_ctos_cipher aes128

Related Topics
3.9.44 stelnet server enable
3.9.37 ssh server port

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 212


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

3.9.44 stelnet server enable

Function
The stelnet server enable command enables the STelnet service on the SSH
server.

The undo stelnet server enable command disables the STelnet service on the
SSH server.

By default, the STelnet service is disabled on the SSH server.

Format
stelnet server enable

undo stelnet server enable

Parameters
None

Views
System view

Default Level
3: Management level

Usage Guidelines
Usage Scenario

To connect a client to the SSH server through STelnet, you must enable the
STelnet service on the SSH server.

Precautions

After you disable the STelnet service on the SSH server, all clients that have logged
in through STelnet are disconnected.

Example
# Enable the STelnet service.
<Huawei> system-view
[Huawei] stelnet server enable

Related Topics
3.9.43 stelnet

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 213


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

3.9.45 super

Function
The super command switches a user from the current level to a specified level.

Format
super [ level ]

Parameters
Parameter Description Value
level Specifies the target The value is an integer that ranges from 0
user level. to 15. By default, a user is switched to level
3.

Views
User view

Default Level
0: Visit level

Usage Guidelines
Usage Scenario

Users are assigned one of 16 levels, and these levels correspond to command
levels. After logging in to the device, users can use only the commands whose
levels are equal to or lower than their user levels.

When a user is switched from a lower level to a higher level, the device requires
the user to enter the authentication password for the higher user level to
authenticate the user identity, preventing unauthorized users from logging in to
the device. You can run the super password command to set an authentication
password used to switch a user from a lower level to a higher level.

If the entered target user level is lower than or equal to the current user level, the
system directly sets the entered user level as the target user level, and displays a
message. If the target level is higher than the current user level, the system asks
the user to enter the authentication password.

The password entered by a user is not displayed on the screen. If the user enters
the correct password within three times, the system switches the user to the
higher user level; otherwise, the user level remains unchanged.

Precautions

● The configured target level takes effect only for the current user. The user
level restores to the original level the next time the user logs in.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 214


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

● AR3200 series routers do not support this command in active/standby


switchover scenarios.
● The password is a string of 8 to 16 characters.
● The password must be a combination of at least two of the following:
uppercase letters, lowercase letters, digits, and special characters.
Special characters include ` ~ ! @ # $ % ^ & * ( ) - _ = + \ | [ { } ] ; : ' " , < .
> / ? spaces.
● The password must be the same as the password set using the super
password command.

Example
# Switch a user to level 10.
<Huawei> super 10
Password:
Now user privilege is level 10, and only those commands whose level is
equal to or less than this level can be used.
Privilege note: 0-VISIT, 1-MONITOR, 2-SYSTEM, 3-MANAGE

Related Topics
3.9.46 super password

3.9.46 super password


Function
The super password command sets an authentication password used to switch a
user from a lower level to a higher level.
The undo super password command deletes an authentication password used to
switch a user from a lower level to a higher level.
By default, no switching password is configured. You must set the authentication
password before switching a user from a lower level to a higher level; otherwise,
the switching fails.

Format
super password [ level user-level ] cipher
undo super password [ level user-level ]

Parameters
Parameter Description Value
level user-level Specifies the target The value is an integer that ranges from
user level. 1 to 15. The target user level must be
lower than or equal to the current user
level. By default, the authentication
password is set to switch a user to level
3.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 215


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Parameter Description Value


cipher Indicates that the -
configured password
is displayed in cipher
text.

Views
System view

Default Level
3: Management level

Usage Guidelines
Usage Scenario
If rights are reconfigured, you need to run the super command to switch a user
from a lower level to a higher level. When a user is switched from a lower level to
a higher level, the device authenticates the user identity to prevent unauthorized
users from logging in to the device. Users at a higher level can run the super
password command to set an authentication password used to switch a user from
a lower level to a higher level, so that the device can authenticate the user
identity.
Precautions
● AR3200 series routers do not support this command in active/standby
switchover scenarios.
● The target user level must be lower than or equal to the current user level.
● The entered authentication password must meet the following requirements:
– It is a string of 8 to 16 characters entered only in plain text.
– It must be a combination of at least two of the following: uppercase
letters, lowercase letters, digits, and special characters.
Special characters include ` ~ ! @ # $ % ^ & * ( ) - _ = + \ | [ { } ] ; : ' " ,
< . > / ? spaces.
● The password entered in interactive mode is not displayed on the screen.
● When setting the password in interactive mode, you can press CTRL+C to
cancel the password setting.
● If this command is run, passwords entered by users will be saved in cipher
text in the configuration file. Therefore, a configured password cannot be
retrieved from the system. Keep the password safe.

Example
# Set an authentication password used to switch a user from a lower level to level
5.
<Huawei> system-view
[Huawei] super password level 5 cipher

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 216


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Enter Password(<8-16>):
Confirm password:

Related Topics
3.9.45 super

3.9.47 telnet
Function
The telnet command enables you to use the Telnet protocol to log in to another
device from the current device.

Format
# Log in to another device through Telnet based on IPv4.
telnet [ vpn-instance vpn-instance-name ] [ -a source-ip-address ] host-ip [ port-
number ]
# Log in to another device through Telnet based on IPv6.
telnet ipv6 [ -a source-ip-address ] [ vpn6-instance vpn6-instance-name ] host-
ipv6 [ -oi interface-type interface-number ] [ port-number ]

Parameters
Parameter Description Value
vpn-instance Specifies the VPN4 instance The value is a string of 1 to
vpn-instance- name of the device to log in 31 case-sensitive characters,
name through Telnet. spaces not supported. When
double quotation marks are
used around the string,
spaces are allowed in the
string.
-a source-ip- By specifying a source IP -
address address, you can use this
address to communicate with
the server for high network
security. If no source address is
specified, the system will use
the IP address of the local
outbound interface to initiate a
Telnet connection.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 217


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Parameter Description Value


vpn6-instance Specifies the VPN6 instance The value is a string of 1 to
vpn6-instance- name of the device to log in 31 case-sensitive characters,
name through Telnet. spaces not supported. When
double quotation marks are
used around the string,
spaces are allowed in the
string.
host-ip Specifies the IPv4 address or The value is a string of 1 to
host name of the remote 255 case-insensitive
device. characters without spaces.
host-ipv6 Specifies the IPv6 address or The value is a string of 1 to
host name of the remote 255 case-insensitive
device. characters without spaces.
-oi interface- Specifies the outbound interface If the IPv6 address of the
type interface- on the local device. remote host is linked to a
number local address, the outbound
interface must be specified.
port-number Specifies the number of the TCP The value is an integer that
port that is used by the remote ranges from 1 to 65535. The
device to provide the Telnet default value is 23.
service.

Views
User view

Default Level
0: Visit level

Usage Guidelines
Usage Scenario
If one or multiple devices on the network need to be configured and managed,
you do not need to connect each device to your terminal for local maintenance. If
you have learned the IP address of the device, you can run this command to log in
to the device from your terminal for remote device configuration. By doing this,
you can use one terminal to maintain multiple devices on the network.
You can press Ctrl_] to terminate an active connection between the local and
remote devices.
Precautions
● Before you run the telnet command to connect to the Telnet server, the
Telnet client and server must be able to communicate through Layer 3 and
the Telnet service must be enabled on the Telnet server.
● Logins through Telnet bring security risks because Telnet does not provide any
authentication mechanism and data is transmitted using TCP in plain text.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 218


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

The STelnet mode is recommended for the network that has the high security
requirement.

Example
# Connect to a remote device through Telnet.
<Huawei> telnet 192.168.1.6

# Use the IPv6 address to connect to a remote device through Telnet.


<Huawei> telnet ipv6 fc00:0:0:11::158

Related Topics
3.9.51 telnet server enable
3.9.52 telnet server port

3.9.48 telnet client-source


Function
The telnet client-source command specifies the source IP address and interface
for a Telnet client.
The undo telnet client-source command restores the default settings.
The default source IP address of the Telnet client is 0.0.0.0.

Format
telnet client-source { -a source-ip-address | -i interface-type interface-number }
undo telnet client-source

Parameters
Parameter Description Value
-a source-ip-address Specifies the IPv4 address of the local -
router.
-i interface-type interface- Specifies the outbound interface of the -
number local router.

Views
System view

Default Level
3: Management level

Usage Guidelines
Usage Scenario

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 219


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

If the source IP address and interface are not specified in the telnet command,
use the default settings specified by telnet client-source. If the source IP address
and interface are specified in the telnet command, use the specified settings.
Check the current Telnet connection on the server. The IP address displayed is the
specified source IP address or the primary IP address of the specified interface.

Precautions

If the specified source interface has been bound to a VPN instance, the client is
automatically bound to the same VPN instance.

Example
# Set the source IP address of the Telnet client to 10.1.1.1.
<Huawei> system-view
[Huawei] telnet client-source -a 10.1.1.1

Related Topics
3.9.47 telnet

3.9.49 telnet server-source

Function
The telnet server-source command specifies a source IP address for a Telnet
server.

The undo telnet server-source command deletes the source IP address of a Telnet
server.

By default, the source interface of a Telnet server is not specified.

Format
telnet server-source { -a [ ipv6 ] source-ip-address | -i [ ipv6 ] interface-type
interface-number }

undo telnet [ ipv6 ] server-source

Parameters

Parameter Description Value


ipv6 Configures the Telnet server to support an IPv6 -
source address.

-a source-ip-address Specifies the source IP address for the Telnet server. -


The loopback IP address is recommended.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 220


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Parameter Description Value


-i interface-type Specifies the loopback interface of the Telnet -
interface-number server as the source interface.
If no loopback interface is configured or no IP
address is configured for the source interface, the
command fails to be executed.

Views
System view

Default Level
3: Management level

Usage Guidelines
Usage Scenario
If no source IP address is specified, the Telnet server uses the source IP address
specified by routes to send packets. The source IP address must be configured for
an interface with stable performance, such as the loopback interface. Using the
loopback interface as the source IP address simplifies the ACL rule and security
policy configuration. This shields the IP address differences and interface status
impact, filters incoming and outgoing packets, and implements security
authentication.
Precautions
● After the source IP address is specified for the Telnet server, you must use the
specified IP address to log in to the Telnet server.
● If the Telnet service has been enabled, the Telnet service restarts after the
telnet server-source command is executed.
● If the specified source interface has been bound to a VPN instance, the server
is automatically bound to the same VPN instance.

Example
# Set the source IP address of the Telnet server to LoopBack0.
<Huawei> system-view
[Huawei] telnet server-source -i loopback 0
Warning: To make the server source configuration take effect, the telnet server will be restarted. Continue?
[Y/N]: y
Info: Succeeded in setting the source interface of the telnet server to LoopBack0
Info: Telnet is insecure, recommended to use stelnet with encryption features.

Related Topics
3.9.47 telnet
3.9.51 telnet server enable
3.9.52 telnet server port

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 221


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

3.9.50 telnet server permit interface


Function
The telnet server permit interface command specifies physical interfaces on the
Telnet server to which clients can connect.
The undo telnet permit interface command restores the default physical
interfaces on the Telnet server to which clients can connect.
By default, clients can connect to all the physical interfaces on the Telnet server.

Format
telnet server permit interface { interface-type interface-number } &<1-5>
undo telnet server permit interface

Parameters
Parameter Description Value
interface-type interface-type: specifies the interface type. -
interface-number
interface-number: specifies the interface number.
interface-number and interface-type specify an
interface.

Views
System view

Default Level
3: Management level

Usage Guidelines
Usage Scenario
To prevent a client from connecting to the Telnet server through an unauthorized
physical interface, you can run the telnet server permit interface command to
specify physical interfaces on the Telnet server to which the client can connect.
Precautions
● By default, the client can connect to all the physical interfaces on the Telnet
server. When you run this command to specify one physical interface on the
Telnet server, the client cannot connect to the other physical interfaces on the
Telnet server.
● You can specify a maximum of five interfaces each time you run the telnet
server permit interface command. The latest configuration overrides the
previous one. For example, before you run the command, clients can connect

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 222


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

to three physical interfaces GigabitEthernet 1/0/0, GigabitEthernet 2/0/0, and


GigabitEthernet 3/0/0 on the Telnet server. After you run the command to
specify the interface GigabitEthernet 1/0/0, clients can only connect to the
interface GigabitEthernet 1/0/0.

Example
# Specify physical interfaces on the Telnet server to which clients can connect.
<Huawei> system-view
[Huawei] telnet server permit interface gigabitethernet 1/0/0 gigabitethernet 2/0/0
Info: Succeeded in setting telnet permit interface.

# Restore the default physical interfaces on the Telnet server to which clients can
connect.
<Huawei> system-view
[Huawei] undo telnet server permit interface

3.9.51 telnet server enable


Function
The telnet server enable command enables the Telnet server.
The undo telnet server enable command disables the Telnet server.
By default, the Telnet server is disabled.

Format
telnet [ ipv6 ] server enable
undo telnet [ ipv6 ] server enable

Parameters
Parameter Description Value
ipv6 Specifies a Telnet IPv6 server. -

Views
System view

Default Level
3: Management level

Usage Guidelines
You can run this command to enable and disable the Telnet server. A Telnet server
can be connected only when it is enabled.
When the undo telnet server enable command is executed to disable the Telnet
server, an online Telnet user goes offline because the Telnet service is disabled.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 223


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

When a Telnet server stops, you can log in to the device only through the console
port or SSH.

NOTICE

The Telnet protocol poses a security risk, and therefore the STelnet V2 mode is
recommended.

Example
# Enable a Telnet server.
<Huawei> system-view
[Huawei] telnet server enable

# Disable a Telnet server.


<Huawei> system-view
[Huawei] undo telnet server enable

# Enable an IPv6 Telnet server.


<Huawei> system-view
[Huawei] telnet ipv6 server enable

3.9.52 telnet server port

Function
The telnet server port command configures the listening port number of a Telnet
server.

The default listening port of a Telnet server is 23.

Format
telnet server port port-number

Parameters

Parameter Description Value


port-number Specifies the The value is an integer that is 23 or ranges from
listening port 1025 to 1999 or ranges from 5001 to 55535.
number of a The default value 23 is the standard Telnet
Telnet server. server port number.
NOTE
If the port number of the Telnet server is set in
versions earlier than V200R009C00 and the port
number is in the range from 2000 to 5000, the
original port number can still be used if system is
upgraded to V200R009C00.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 224


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Views
System view

Default Level
3: Management level

Usage Guidelines
Usage Scenario
To protect the Telnet standard port against attacks and ensure network security,
configure the listening port number of the Telnet server.
Precautions
A Telnet client can log in to the server with no port specified only when the server
is listening on port 23. If the server is listening on another port, the port number
must be specified upon login.
Before changing the current port number, disconnect all devices from the port.
After the port number is changed, the server starts to listen on the new port.

Example
# Configure the listening port number to 1026.
<Huawei> system-view
[Huawei] telnet server port 1026

3.9.53 transparent-mode enable


Function
The transparent-mode enable command enables the transparent transmission
mode for redirection on a serial port.
The undo transparent-mode enable command disables the transparent
transmission mode for redirection on a serial port.
By default, the transparent transmission mode for redirection on a serial port is
disabled.

Format
transparent-mode enable
undo transparent-mode enable

Parameters
None

Views
TTY user interface view

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 225


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Default Level
2: Configuration level

Usage Guidelines
Usage Scenario
By default, the device checks data redirected by a serial port and discards
unidentifiable data, damaging the original data. You can run the transparent-
mode enable command to ensure the original data integrity. The device will
transparently transmit data without checking it.
Prerequisites
The redirection function has been enabled using the redirect enable command.

Example
# Enable the transparent transmission mode for redirection on a serial port.
<Huawei> system-view
[Huawei] user-interface tty 44
[Huawei-ui-tty44] redirect enable
[Huawei-ui-tty44] transparent-mode enable

Related Topics
3.9.23 redirect enable

3.10 HTTP Server Commands

3.10.1 display http server


Function
The display http server command displays information about the current HTTP
server.

Format
display http server

Parameters
None

Views
All views

Default Level
3: Management level

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 226


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Usage Guidelines
You can view the HTTP server information, including the status of common and
security HTTP services, port number, maximum number of users allowed to access
the HTTP server, and number of current online users.

Example
# Display information about the current HTTP server.
<Huawei> display http server
HTTP server status : Enabled (default: disable)
HTTP server port : 80 (default: 80)
HTTP timeout interval :3 (default: 10 minutes)
Current online users :0
Maximum users allowed :5
HTTPS server status : Disabled (default: disable)
HTTPS server port : 443 (default: 443)
HTTPS server manager port :
HTTPS SSL Policy :

Table 3-34 Description of the display http server command output


Item Description

HTTP server status Status of the common HTTP server.


● Enabled: The HTTP service is enabled.
● Disabled: The HTTP service is disabled.
You can configure the common HTTP
server status by running the 3.10.6 http
server enable command.

HTTP server port Number of the listening port on the HTTP


server. The default port number is 80.
You can configure the HTTP server port
number by running the 3.10.10 http server
port command.

HTTP timeout interval Idle timeout duration of the HTTP server.


The default value is 10 minutes.
You can configure the idle timeout
duration by running the 3.10.12 http
timeout command.

Current online users Number of current online users.

Maximum users allowed Maximum number of users allowed to


access the HTTP server.
You can configure the maximum number
of users by running the 3.10.8 http server
max-online-users command.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 227


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Item Description

HTTPS server status Status of the security HTTP server.


● Enabled: The security HTTP service is
enabled.
● Disabled: The security HTTP service is
disabled.
You can configure the security HTTP server
status by running the 19.19.2 http secure-
server enable command.

HTTPS server port Port number of the security HTTP server.


The default value is 443.
You can configure the security HTTP server
port number by running the 19.19.5 http
secure-server port command.

HTTPS server manager port Management port number of the HTTPS


server.
You can configure the security HTTPS
server manager port by running the
19.19.3 http secure-server manager-port
command.

HTTPS SSL Policy security HTTP SSL policy.


You can configure the security HTTP SSL
policy by running the 19.18.10 ssl policy
command.

Related Topics
3.10.12 http timeout
3.10.6 http server enable
3.10.10 http server port

3.10.2 display http user


Function
The display http user command displays information about current online users.

Format
display http user [ username username ]

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 228


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Parameters
Parameter Description Value
username Specifies the name The value is a string of 1 to 64 case-
username of the current online insensitive characters, with no space or
user. wildcard. When double quotation marks
are used around the string, spaces are
allowed in the string.

Views
All views

Default Level
3: Management level

Usage Guidelines
If username is not specified, this command displays summary information about
all online users.
If username is specified, this command displays detailed information about the
specified online user.

Example
# Display general information about the current online user.
<Huawei> display http user
---------------------------------------------------------------------------
User Name IP Address Login Date
---------------------------------------------------------------------------
admin 192.168.0.1 2011-10-13 11:11:12+00:00
---------------------------------------------------------------------------
Total online users is 1

# Display detailed information about the current online user admin.


<Huawei> display http user username admin
Client IP Address : 192.168.0.1
Login Date : 2011-10-13 11:11:12+00:00
User timeouts : 3 minutes

Table 3-35 Description of the display http user command output

Item Description

User Name User name.

Client IP Address IP address of the HTTP client.

Login Date Login date and time.

User timeouts Idle timeout duration of online users.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 229


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Related Topics
3.10.12 http timeout

3.10.3 display fast-configuration state


Function
The display fast-configuration state command displays the state of the Internet
access wizard popup notification of the web system of the EasyOperation edition.

Format
display fast-configuration state

Only the AR100&AR120&AR150&AR160&AR200 support this command.

Parameters
None

Views
All views

Default Level
3: Management level

Usage Guidelines
Usage Scenario
To check the state of the Internet access wizard popup notification of the web
system of the EasyOperation edition, run this command.
Precautions
The models must support the web system of the EasyOperation edition.

Example
# Display the state of the Internet access wizard popup notification of the web
system of the EasyOperation edition.
<Huawei> display fast-configuration state
Fast-configuration is enabled

3.10.4 http acl


Function
The http acl command configures an ACL on the HTTP server.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 230


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

The undo http acl command deletes the ACL on the HTTP server.
By default, no ACL is configured on the HTTP server.

Format
http acl acl-number
undo http acl

Parameters
Parameter Description Value
acl-number Specifies the ACL number. The value is an integer that ranges from
2000 to 2999.

Views
System view

Default Level
3: Management level

Usage Guidelines
Usage Scenario
To ensure the security of an HTTP server, you need to configure an ACL for it to
specify clients that can log in to the current HTTP server.
Precautions
● The HTTP supports the ACL whose number ranges from 2000 to 2999.
● The http acl command takes effect only after you run the rule command to
configure the ACL rule.
● After an ACL rule is modified, the HTTP server does not forcibly log out an
online user who matches the ACL rule until the user sends the next login
request.
● If the http acl command is configured several times, only the latest
configuration takes effect.

Example
# Set the ACL number to 2000 for the HTTP server.
<Huawei> system-view
[Huawei] acl 2000
[Huawei-acl-basic-2000] rule 1 permit source any
[Huawei-acl-basic-2000] quit
[Huawei] http acl 2000

Related Topics
3.10.1 display http server

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 231


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

3.10.5 http get

Function
The http get command detects whether the URL server is reachable.

Format
http get [ -a source-ip-address | -c count | -t timeout | -v http-version ] * url url

Parameters

Parameter Description Value


-a source-ip- Specifies the source IP address of The value is in dotted
address outgoing HTTP request packets. decimal notation.
If this parameter is not specified, the IP
address of the outbound interface is
used as the source IP address of
outgoing HTTP request packets.

-c count Specifies the transmission count of The value is an integer


HTTP request packets. ranging from 1 to 100.
The default value is 5.
If the network works unstably, increase
the transmission count to detect
network quality based on the packet
loss ratio.

-t timeout Specifies the timeout interval for an The value is an integer


HTTP response packet. that ranges from 1 to
65535, in milliseconds.
The http get command sends an HTTP The default value is
request packet to an address and waits 5000 ms.
for a response. If the response is
received within the timeout interval,
the destination is reachable. If no
response is received within the timeout
interval, the sender displays a message
indicating that the request packet
times out.
A response is received within 1 to 10
seconds after an HTTP request packet
is sent. If the transmission speed is low,
properly prolong the timeout interval.

-v http-version Specifies the HTTP version number. The HTTP version


number is 1.0 or 1.1.
The default value is
1.0.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 232


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Parameter Description Value


url url Specifies the destination URL. The value is a string of
1 to 256 characters.

Views
System view

Default Level
1: Monitoring level

Usage Guidelines
The http get command detects whether the URL server is reachable. You can use
HTTP request packets to detect the following items:
● Whether the HTTP service is enabled on the URL server
● Round-trip delay in communication
● Packet loss

Example
# Check whether the HTTP service is enabled on the URL server with the URL of
http://w3.huawei.com, and set the source IP address of outgoing HTTP packets to
10.137.147.142, the transmission count to 5, the period for waiting for a response
packet to 100 ms, and the HTTP version number to 1.1.
<Huawei> system-view
[Huawei] http get -a 10.137.147.142 -c 5 -t 100 -v 1.1 url http://w3.huawei.com
Http getting http://w3.huawei.com[10.82.55.199]:

1:packets interaction time 90 ms,the link reachable


2:packets interaction time 100 ms,the link reachable
3:packets interaction time 100 ms,the link reachable
4:packets interaction time 100 ms,the link reachable
5:packets interaction time 90 ms,the link reachable
--http get result statistics--
Http Get 5 time(s),succeed 5 time(s),failed 0 time(s).
round-trip min/avg/max = 90/96/100 ms

Table 3-36 Description of the http get command output

Item Description

Http getting x.x.x URL and IP address of the URL server.

x: packets Response to each HTTP packet.


interaction time x ● Round-trip delay in communication
ms, the link
reachable ● Link reachability
If no response packet is received after the timeout
period, the message "Connect times out" is displayed.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 233


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Item Description

http get result HTTP test statistics:


statistics ● Http Get x time(s): number of outgoing HTTP packets
● succeed x time(s): number of HTTP request packets of
which corresponding HTTP response packets are
received
● failed x time(s): number of HTTP request packets of
which corresponding HTTP response packets fail to be
received
● round-trip min/avg/max: minimum, average, and
maximum round-trip delay

Related Topics
21.16.1 ping
21.16.3 tracert

3.10.6 http server enable


Function
The http server enable command enables the HTTP server function.
The undo http server enable command disables the HTTP server function.
By default, the HTTP server function is enabled.

Format
http server enable
undo http server enable

Parameters
None

Views
System view

Default Level
3: Management level

Usage Guidelines
After running the http server enable command to enable the HTTP server, you
can use the browser to access the web NMS to manage devices.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 234


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

If the web page to load does not exist, the HTTP service cannot be enabled.

Example
# Enable the HTTP server.
<Huawei> system-view
[Huawei] http server enable

Related Topics
3.10.1 display http server
3.10.7 http server load

3.10.7 http server load


Function
The http server load command loads a web page file.
The undo http server load command cancels loading of a specified web page file.
By default, the system loads the default web page file contained in the system
software when the HTTP or HTTPS service is enabled.

Format
http server load file-name
undo http server load

Parameters
Parameter Description Settings

file-name Specifies the name of The value is a string of 5


the web page file to to 64 characters without
load. spaces. The file name is
in the *.sfs format or has
no file name extension.

Views
System view

Default Level
3: Management level

Usage Guidelines
Usage Scenario

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 235


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

If you need to manage and maintain devices on the graphical user interface (GUI),
configure the Web network management function. When you need to update web
page file when using the Web network management function, run this command
to load web page file.

Prerequisites

Before loading the web page file using the http server load command, ensure
that the web page file has been stored to the device; otherwise, file loading will
fail.

Example
# Load the web page file web_1.
<Huawei> system-view
[Huawei] http server load web_1

Related Topics
3.10.1 display http server

3.10.8 http server max-online-users

Function
The http server max-online-users command sets the maximum number of
concurrent online users allowed by the web NMS.

The undo http server max-online-users command restores the number of


concurrent online users allowed by the web NMS to the default value.

By default, the maximum number of concurrent online users allowed by the web
NMS is 5.

Format
http server max-online-users max-online-users

undo http server max-online-users

Parameters
Parameter Description Value
max-online-users Specifies the maximum The value is an integer that
number of concurrent online ranges from 1 to 5. The
users allowed by the web default value is 5.
NMS.

Views
System view

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 236


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Default Level
3: Management level

Usage Guidelines
Usage Scenario
You can run this command to set the maximum number of concurrent online
users allowed by the web NMS. By doing so, the number of users allowed to
simultaneously access the web NMS is limited.
Precautions
When the number of users that have logged in is larger than the value specified
by this command, extra users will not be forced to go offline. For example, five
users have logged in to the web NMS. If you run this command to set the
maximum number of concurrent online users allowed by the web NMS to 3, two
extra users will not be forced to go offline.

Example
# Set the maximum number of concurrent online users allowed by the web NMS
to 3.
<Huawei> system-view
[Huawei] http server max-online-users 3

3.10.9 http server permit interface


Function
The http server permit interface command configures interfaces through which
users can access the web platform.
The undo http server permit interface command deletes the configured
interfaces so that users can access the web platform using all interfaces on the
device.
By default, all interfaces on the device allow clients to access the web system.

Format
http server permit interface { interface-type interface-number } &<1-5>
undo http server permit interface

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 237


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Parameters
Parameter Description Value
interface-type interface-type specifies the interface type. -
interface-number
interface-number specifies the number of an
interface. interface-number and interface-type
specify an interface.

Views
System view

Default Level
3: Management level

Usage Guidelines
Usage Scenario
To prevent unauthorized users from accessing the web platform through interfaces
on the device, run the http server permit interface command to configure
interfaces through which users can access the web platform.
Precautions
You can only run the http server permit interface command to configure physical
interfaces and VLANIF interfaces.
In the factory default settings of the device, users can only access the web
platform through management interfaces. For example, when the management
interface of the device is GE0, the http server permit interface
GigabitEthernet0/0/0 command is contained in the factory default settings of the
device.
A maximum of five interfaces can be configured. If you run the http server
permit interface command multiple times, only the latest configuration takes
effect, For example, if GigabitEthernet 1/0/0, GigabitEthernet 2/0/0, and
GigabitEthernet 3/0/0 has been configured, and then run the http server permit
interface command to configure GigabitEthernet 1/0/0, users can access the web
platform only through GigabitEthernet 1/0/0.

Example
# Configure the interfaces through which users can access the web platform.
<Huawei> system-view
[Huawei] http server permit interface GigabitEthernet 1/0/0 GigabitEthernet 2/0/0
Info: Successed in setting web permit interface.

# Delete the configured interfaces so that users can access the web platform using
all interfaces on the device.
<Huawei> system-view
[Huawei] undo http server permit interface

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 238


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

3.10.10 http server port

Function
The http server port command sets the listening port number of the HTTP server.

The undo http server port command restores the default listening port number
of the HTTP server.

By default, the listening port number of the HTTP server is 80.

Format
http server port port-number

undo http server port

Parameters
Parameter Description Value
port-number Specifies the listening The value is an integer that ranges from
port number of the The value is 80, or an integer that
HTTP server. ranges from 1025 to 51200. The default
value is 80.

Views
System view

Default Level
3: Management level

Usage Guidelines
Usage Scenario

By default, the listening port number of the security HTTP server is 80. Attackers
may frequently access the default listening port, which wastes bandwidth,
deteriorates server performance, and prevents authorized users from accessing the
HTTP server through the listening port. You can run the http server port
command to specify another listening port number to prevent attackers from
accessing the listening port.

Precautions

If the http server port command is configured several times, only the latest
configuration takes effect.

Example
# Set the listening port number of the HTTP server to 1025.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 239


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

<Huawei> system-view
[Huawei] http server port 1025

Related Topics
3.10.1 display http server

3.10.11 http server-source


Function
The http server-source command specifies a source IP address for an HTTP server.
The undo http server-source command deletes the source IP address of an HTTP
server.
By default, the source IP address of an HTTP server is not specified.

Format
http server-source { -a source-ip-address | -i interface-type interface-number }
undo http server-source

Parameters
Parameter Description Value
-a source-ip-address Specifies the source IP address for the HTTP -
server. The loopback IP address is recommended.

-i interface-type Specifies the loopback interface of the HTTP -


interface-number server as the source interface.
If no loopback interface is configured or no IP
address is configured for the source interface, the
command fails to be executed.

Views
System view

Default Level
3: Management level

Usage Guidelines
Usage Scenario
If no source IP address is specified, the HTTP server uses the source IP address
specified by routes to send and receive packets. The source IP address must be
configured for an interface with stable performance, such as the loopback
interface. Using the loopback interface as the source IP address simplifies the ACL

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 240


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

rule and security policy configuration. This shields the IP address differences and
interface status impact, filters incoming and outgoing packets, and implements
security authentication.

Precautions

● After the source IP address is specified for the HTTP server, you must use the
specified IP address to log in to the HTTP server.
● If the HTTP service has been enabled, the HTTP service restarts after the http
server-source command is executed.

Example
# Set the source IP address of the HTTP server to LoopBack0.
<Huawei> system-view
[Huawei] http server-source -i loopback 0
Warning: To make the server source configuration take effect, the HTTP server will be restarted. Continue?
(y/n)[n]:y
Info: Succeeded in setting the source IP or interface of the HTTP server

Related Topics
3.10.6 http server enable
3.10.10 http server port

3.10.12 http timeout

Function
The http timeout command sets the idle timeout duration of the web server.

The undo http timeout command restores the default idle timeout duration of
the webHTTP server.

By default, the idle timeout duration of the web server is 10 minutes.

Format
http timeout timeout

undo http timeout

Parameters
Parameter Description Value
timeout Specifies the idle timeout duration The value is an integer that
of the web server for online users. ranges from 1 to 35791, in
minutes.

Views
System view

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 241


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Default Level
3: Management level

Usage Guidelines
Usage Scenario
A maximum of five web users are supported at present. When the fifth web user
logs in to the web server, any other user cannot log in to the web server even if
any of the five users does not perform operations for a long time. The idle timeout
duration is configured to release web resources in time. To occupy web channels
for a long time, you must set the idle timeout duration to the maximum value.
Precautions
● After you run the http timeout command, the idle timeout durations are the
same for all web users who log in to the web server. If the idle timeout
duration expires, a user is disconnected from the web server and the web
server notifies the user only after the user sends the next login request.
● If the http timeout command is configured several times, only the latest
configuration takes effect.

Example
# Set the idle timeout duration of the webHTTP server to 6 minutes.
<Huawei> system-view
[Huawei] http timeout 6

Related Topics
3.10.1 display http server

3.10.13 set fast-configuration state disable


Function
The set fast-configuration state disable command disables the Internet access
wizard popup notification of the web system of the EasyOperation edition.
The undo set fast-configuration state disable command enables the Internet
access wizard popup notification of the web system of the EasyOperation edition.
By default, the Internet access wizard popup notification of the web system of the
EasyOperation edition is enabled.

Format
set fast-configuration state disable
undo set fast-configuration state disable

Only the AR100&AR120&AR150&AR160&AR200 support this command.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 242


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Parameters
None

Views
Web view

Default Level
2: Configuration level

Usage Guidelines
Usage Scenario

When a user has configured the Internet access wizard function and logs in to the
web system of the EasyOperation edition again, if the Internet access wizard
popup notification is not required, run the set fast-configuration state disable to
disable the Internet access wizard popup notification. If the Internet access wizard
popup notification is required, run the undo set fast-configuration state disable
command.

Precautions

The models must support the web system of the EasyOperation edition.

Example
# Disable the Internet access wizard popup notification of the web system of the
EasyOperation edition.
<Huawei> system-view
[Huawei] web
[Huawei-web] set fast-configuration state disable

3.10.14 set logo-path

Function
The set logo-path command sets the storage directory of the logo image on the
web page.

The undo set logo-path command cancels the configured storage directory of the
logo image on the web page.

By default, the storage directory of the Huawei logo image is used.

Format
set logo-path subpathname

undo set logo-path

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 243


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Parameters
Parameter Description Value

subpathname Specifies the name of The value is a string of 1


the subdirectory for to 31 characters without
storing the logo image. spaces.

Views
System view

Default Level
2: Configuration level

Usage Guidelines
Usage Scenario

The device supports customization of the logo image on the web page. You can
create a subdirectory for storing the logo image under the directory logo-path of
the default working directory on the device, and store the logo image to be
displayed in the subdirectory. You can run the set logo-path command to
configure the subdirectory as the storage directory of the logo image on the web
page. The required logo image then can be displayed on the web page.

The default working directory on the AR2220–AC, AR2220–DC, AR2240, AR2240C,


and AR3200 series is sd1:, and that on other models is flash:.

Prerequisites

When setting the storage directory of the logo image on the web page using the
set logo-path command, ensure that a subdirectory for storing the logo image
has been created using the mkdir command under the directory logo-path of the
default working directory.

Precautions

● Store the logo image using the required file name and size in the created
subdirectory. After the storage directory of the logo image on the web page is
set using the set logo-path command, the device automatically reads the file
under the directory and changes the logo image on the web page.
● Store three files with different pixel sizes of the required logo image in the
created subdirectory, and name them as required. Name the image with the
pixel size 16x16 logo1.png, the image with the pixel size 21x22 logo2.png,
and the image with the pixel size 44x44 logo3.png.

Configuration Impact

After the storage directory of the logo image on the web page is set using the set
logo-path command, the logo image on the web page varies depending on the
configuration.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 244


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Example
# Set the storage directory of the logo image on the web page to the directory
example_path.
<Huawei> system-view
[Huawei] set logo-path example_path
Info: Set the vendor picture directory: " example_path " successfully.

3.10.15 set web login-style


Function
The set web login-style command sets the edition for web platform login to a
router.
By default, the EasyOperation edition is used for web platform login to a router.

Only the AR100&AR120&AR150&AR160&AR200 series routers support this command.

Format
set web login-style { professional | simple }

Parameters
Parameter Description Value

professional Sets the Classics edition -


for web platform login to
the router.

simple Sets the EasyOperation -


edition for web platform
login to the router.

Views
System view

Default Level
3: Management level

Usage Guidelines
By default, the EasyOperation edition is used for web platform login to the
AR100&AR120&AR150&AR160&AR200 series routers. To log in to the Classics web
platform, run the set web login-style professional command to set the web
platform edition. To restore the EasyOperation edition, run the set web login-
style simple command.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 245


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Example
# Set the Classics edition for web platform login to the router.
<Huawei> system-view
[Huawei] set web login-style professional

3.11 File Management Commands

3.11.1 ascii
Function
The ascii command sets the file transfer mode to ASCII on an FTP client.
The default file transfer mode is ASCII.

Format
ascii

Parameters
None

Views
FTP client view

Default Level
3: Management level

Usage Guidelines
Files can be transferred in ASCII or binary mode.
ASCII mode is used to transfer plain text files, and binary mode is used to transfer
application files, such as system software, images, video files, compressed files,
and database files.

Example
# Set the file transfer mode to ASCII.
<Huawei> ftp 10.137.217.201
Trying 10.137.217.201 ...
Press CTRL+K to abort
Connected to 10.137.217.201.
220 FTP service ready.
User(10.137.217.201:(none)):huawei
331 Password required for huawei.
Enter password:
230 User logged in.
[Huawei-ftp] ascii
200 Type set to A.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 246


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Related Topics
3.11.2 binary

3.11.2 binary

Function
The binary command sets the file transmission mode to binary on an FTP client.

The default file transfer mode is ASCII.

Format
binary

Parameters
None

Views
FTP client view

Default Level
3: Management level

Usage Guidelines
Files can be transferred in ASCII or binary mode.

ASCII mode is used to transfer plain text files, and binary mode is used to transfer
application files, such as system software, images, video files, compressed files,
and database files.

Example
# Set the file transmission mode to binary.
<Huawei> ftp 10.137.217.201
Trying 10.137.217.201 ...
Press CTRL+K to abort
Connected to 10.137.217.201.
220 FTP service ready.
User(10.137.217.201:(none)):huawei
331 Password required for huawei.
Enter password:
230 User logged in.
[Huawei-ftp] binary
200 Type set to I.

Related Topics
3.11.1 ascii

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 247


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

3.11.3 bye

Function
The bye command terminates the connection with the remote FTP server and
enters the user view.

Format
bye

Parameters
None

Views
FTP client view

Default Level
3: Management level

Usage Guidelines
This command is equivalent to the quit command.

You can use the close and disconnect commands to terminate the connection
with the remote FTP server and retain the FTP client view.

Example
# Terminate the connection with the remote FTP server and enter the user view.
<Huawei> ftp 10.137.217.201
Trying 10.137.217.201 ...
Press CTRL+K to abort
Connected to 10.137.217.201.
220 FTP service ready.
User(10.137.217.201:(none)):huawei
331 Password required for huawei.
Enter password:
230 User logged in.
[Huawei-ftp] bye
221 Windows FTP Server (WFTPD, by Texas Imperial Software) says goodbye.
<Huawei>

Related Topics
3.11.9 close
3.11.16 disconnect
3.1.14 quit

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 248


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

3.11.4 cd (FTP client view)

Function
The cd command changes the working directory of the FTP server.

Format
cd remote-directory

Parameters

Parameter Description Value


remote- Specifies the name of a The value is a string of 1 to 64
directory working directory on the FTP case-insensitive characters
server. without spaces.

Views
FTP client view

Default Level
3: Management level

Usage Guidelines
The FTP server authorizes users to access files in certain directories and their
subdirectories.

Example
# Change the working directory to d:/temp.
<Huawei> ftp 10.137.217.201
Trying 10.137.217.201 ...
Press CTRL+K to abort
Connected to 10.137.217.201.
220 FTP service ready.
User(10.137.217.201:(none)):huawei
331 Password required for huawei.
Enter password:
230 User logged in.
[Huawei-ftp] cd d:/temp
250 "D:/temp" is current directory.

Related Topics
3.11.14 dir/ls (FTP client view)
3.11.47 pwd (FTP client view)

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 249


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

3.11.5 cd (SFTP client view)

Function
The cd command changes the working directory of the SFTP server.

Format
cd [ remote-directory ]

Parameters

Parameter Description Value


remote- Specifies the name of a The value is a string of 1 to 64
directory directory on the SFTP server. case-insensitive characters
without spaces.

Views
SFTP client view

Default Level
3: Management level

Usage Guidelines
● The SFTP server authorizes users to access files in certain directories and their
subdirectories.
● The specified working directory must exist on the SFTP server. If the remote-
directory parameter is not included in the cd command, only the current
working directory of an SSH user is displayed as the command output.

Example
# Change the current working directory of the SFTP server to /bill.
<Huawei> system-view
[Huawei] sftp 10.137.217.201
Please input the username:admin
Trying 10.137.217.201 ...
Press CTRL+K to abort
Connected to 10.137.217.201 ...
Enter password:
sftp-client> cd bill
Current directory is:
/bill

Related Topics
3.11.15 dir/ls (SFTP client view)

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 250


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

3.11.6 cd (user view)


Function
The cd command changes the current working directory of a user.
By default, the current working directory of only the AR2220–AC, AR2220–DC,
AR2240, AR2240C, AR3260 series are sd1:.

Format
cd directory

Parameters
Parameter Description Value
directory Specifies the The value is a string of 1 to 64 case-insensitive
current working characters without spaces in the [ drive ] path
directory of a format.
user.
In the preceding parameter, drive specifies the
storage device name, and path specifies the
directory and subdirectory.
You are advised to add : and / between the
storage device name and directory. Characters ~,
*, /, \, :, ', " cannot be used in the directory name.
For example, a directory name is flash:/selftest/
test/.

Views
User view

Default Level
2: Configuration level

Usage Guidelines
Usage Scenario
The following describes the drive name.
● drive is the storage device and is named as follows:
– sd1: root directory of the Micro SD card on the master SRU.
– flash: root directory of the flash memory on the master SRU.
– slave#sd1: root directory of the Micro SD card on the slave SRU. If the
device has no slave SRU, this drive is unavailable.
– slave#flash: root directory of the flash memory on the slave SRU. If the
device has no slave SRU, this drive is unavailable.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 251


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Only the AR3200 series supports dual SRUs.


drive is the storage device of the router. It is named flash: on the
AR100&AR120&AR150&AR160&AR200&AR1200 series, AR2201-48FE,
AR2202-48FE, AR2204-27GE, AR2204-24GE, AR2204-27GE-P, AR2204-51GE-P,
AR2204-48GE-P, AR2204EAR2204, AR2220L-DC, AR3670 and AR2220L-AC, is
named flash: or sd1: on the AR2220E, AR2240C, is named flash: or sd1: on
the AR2240 and AR3260 using SRU40, SRU60, SRU80, and is named sd1: on
the AR2240 and AR3260 using SRU200, SRU400, SRU100E, and SRU200E.

The path can be an absolute path or relative path.


● flash:/my/test/ is an absolute path.
● selftest/ is a path relative to the current working directory and indicates the
selftest directory in the current working directory.

Precautions
● The directory specified in the cd command must exist; otherwise, the error
messages will displayed:
You can perform the following operations to rectify faults:
a. Run the pwd command to view the current working directory.
b. Run the dir command to view the current working directory and verify
that the directory specified in the cd command exists.

Example
# Change the current working directory from flash:/temp to flash:.
<Huawei> pwd
flash:/temp
<Huawei> cd flash:
<Huawei> pwd
flash:

# Change the current working directory from flash: to flash:/t1/t2.


<Huawei> pwd
flash:
<Huawei> cd flash:/t1/t2
<Huawei> pwd
flash:/t1/t2

# Change the current working directory from flash:/selftest to flash:/logfile.


<Huawei> pwd
flash:/selftest
<Huawei> cd /logfile/
<Huawei> pwd
flash:/logfile

# Change the current working directory from flash:/selftest to flash:/selftest/test.


<Huawei> pwd
flash:/selftest
<Huawei> cd test/
<Huawei> pwd
flash:/selftest/test

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 252


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Related Topics
3.11.49 pwd (user view)

3.11.7 cdup (SFTP client view)


Function
The cdup command changes the current working directory of an SSH user to its
parent directory.

Format
cdup

Parameters
None

Views
SFTP client view

Default Level
3: Management level

Usage Guidelines
Usage Scenario
You can run the cdup command to change the current working directory to its
parent directory.
Precautions
If the current working directory is the SFTP authorization directory, the command
cannot change the current working directory.

Example
# Change the current working directory to its parent directory.
<Huawei> system-view
[Huawei] sftp 10.137.217.201
Please input the username:admin
Trying 10.137.217.201 ...
Press CTRL+K to abort
Connected to 10.137.217.201 ...
Enter password:
sftp-client> cd dhcp
Current directory is:
/dhcp
sftp-client> cdup
Current directory is:
/
sftp-client> cdup
Error: Failed to change the current directory.
sftp-client>

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 253


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

3.11.8 cdup (FTP client view)


Function
The cdup command enables you to return to the upper-level directory.

Format
cdup

Parameters
None

Views
FTP client view

Default Level
3: Management level

Usage Guidelines
Usage Scenario

To exit from the current directory and return to the upper-level directory, run the
cdup command.

Precautions

The directories accessible to an FTP user are restricted by the authorized


directories configured for the user.

Example
# Exit from the current directory and return to the upper-level directory.
<Huawei> ftp 10.137.217.201
Trying 10.137.217.201 ...
Press CTRL+K to abort
Connected to 10.137.217.201.
220 FTP service ready.
User(10.137.217.201:(none)):huawei
331 Password required for huawei.
Enter password:
230 User logged in.
[Huawei-ftp] cd security
250 CWD command successful.
[Huawei-ftp] cdup
250 "C:/" is current directory .

Related Topics
3.11.14 dir/ls (FTP client view)
3.11.47 pwd (FTP client view)

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 254


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

3.11.9 close

Function
The close command terminates the connection with the remote FTP server and
retains the FTP client view.

Format
close

Parameters
None

Views
FTP client view

Default Level
3: Management level

Usage Guidelines
Usage Scenario

This command is equivalent to the disconnect command.

You can run the bye and quit commands to terminate the connection with the
remote FTP server and enter the user view.

Precautions

To enter the user view from the FTP client view, you can run the bye or quit
command.

Example
# Terminate the connection with the remote FTP server and enter the FTP client
view.
<Huawei> ftp 10.137.217.201
Trying 10.137.217.201 ...
Press CTRL+K to abort
Connected to 10.137.217.201.
220 FTP service ready.
User(10.137.217.201:(none)):huawei
331 Password required for huawei.
Enter password:
230 User logged in.
[Huawei-ftp] close
221 Windows FTP Server (WFTPD, by Texas Imperial Software) says goodbye.

[Huawei-ftp]

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 255


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Related Topics
3.11.3 bye

3.11.10 copy
Function
The copy command copies a file.

Format
copy source-filename destination-filename

Parameters
Parameter Description Settings

source-filename Specifies the path and The value is a string of 1


the name of a source to 64 case-insensitive
file. characters without
spaces in the [ drive ]
[ path ] file name
format. When quotation
marks are used around
the string, spaces are
allowed in the string.
In the preceding
parameter, drive
specifies the storage
device name, and path
specifies the directory
and subdirectory.
You are advised to add :
and / between the
storage device name and
directory. Characters ~,
*, /, \, :, ', " cannot be
used in the directory
name.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 256


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Parameter Description Settings

destination-filename Specifies the path and The value is a string of 1


the name of a to 64 case-insensitive
destination file. characters without
spaces in the [ drive ]
[ path ] file name
format. When quotation
marks are used around
the string, spaces are
allowed in the string.
In the preceding
parameter, drive
specifies the storage
device name, and path
specifies the directory
and subdirectory.
You are advised to add :
and / between the
storage device name and
directory. Characters ~,
*, /, \, :, ', " cannot be
used in the directory
name.

Views
User view

Default Level
3: Management level

Usage Guidelines
Usage Scenario

The following describes the drive name.

● drive is the storage device and is named as follows:


– sd1: root directory of the Micro SD card on the master SRU.
– flash: root directory of the flash memory on the master SRU.
– slave#sd1: root directory of the Micro SD card on the slave SRU. If the
device has no slave SRU, this drive is unavailable.
– slave#flash: root directory of the flash memory on the slave SRU. If the
device has no slave SRU, this drive is unavailable.

Only the AR3200 series supports dual SRUs.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 257


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

drive is the storage device of the router. It is named flash: on the


AR100&AR120&AR150&AR160&AR200&AR1200 series, AR2201-48FE,
AR2202-48FE, AR2204-27GE, AR2204-24GE, AR2204-27GE-P, AR2204-51GE-P,
AR2204-48GE-P, AR2204EAR2204, AR2220L-DC, AR3670 and AR2220L-AC, is
named flash: or sd1: on the AR2220E, AR2240C, is named flash: or sd1: on
the AR2240 and AR3260 using SRU40, SRU60, SRU80, and is named sd1: on
the AR2240 and AR3260 using SRU200, SRU400, SRU100E, and SRU200E.
The path can be an absolute path or relative path.
● flash:/my/test/ is an absolute path.
● selftest/ is a path relative to the current working directory and indicates the
selftest directory in the current working directory.
Precautions
● If the destination file name is not specified, the designation file and the
source file have the same name. If the source file and the destination file are
in the same directory, you must specify the destination file name. If the
destination file name is not specified, you cannot copy the source file.
● If the destination file name is the same as that of an existing file, the system
prompts you whether to overwrite the existing file. The system prompt is
displayed only when file prompt is set to alert.
● When you use a USB drive, do not remove it during data transmission.

Example
# Copy the file config.cfg from the root directory of the flash card to flash:/temp.
The destination file name is temp.cfg.
<Huawei> copy flash:/config.cfg flash:/temp/temp.cfg
Info: Copy flash:/config.cfg to flash:/temp/temp.cfg?(y/n)[n]:y
100% complete
Info: Copied file flash:/config.cfg to flash:/temp/temp.cfg...Done

# If the current directory is the root directory of the flash card, you can perform
the preceding configuration using the relative path.
<Huawei> pwd
flash:
<Huawei> dir
Directory of flash:/

Idx Attr Size(Byte) Date Time(LMT) FileName


0 -rw- 6,721,804 Mar 19 2012 12:31:58 devicesoft.cc
1 -rw- 910 Mar 19 2012 12:32:58 config.cfg
2 drw- - Mar 05 2012 09:54:34 temp
...
468,560 KB total (197,728 KB free)
<Huawei> copy config.cfg temp/temp.cfg
Info: Copy flash:/config.cfg to flash:/temp/temp.cfg?(y/n)[n]:y
100% complete
Info: Copied file flash:/config.cfg to flash:/temp/temp.cfg...Done

# Copy the file config.cfg from the root directory of the flash card to flash:/temp.
The destination file name is config.cfg.
<Huawei> pwd
flash:
<Huawei> dir
Directory of flash:/

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 258


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Idx Attr Size(Byte) Date Time(LMT) FileName


0 -rw- 6,721,804 Mar 19 2012 12:31:58 devicesoft.cc
1 -rw- 910 Mar 19 2012 12:32:58 config.cfg
2 drw- - Mar 05 2012 09:54:34 temp
...
468,560 KB total (197,728 KB free)
<Huawei> copy config.cfg temp
Info: Copy flash:/config.cfg to flash:/temp/config.cfg?(y/n)[n]:y
100% complete
Info: Copied file flash:/config.cfg to flash:/temp/config.cfg...Done

# Copy the file backup.zip to backup1.zip in the test directory from the current
working directory flash:/test/.
<Huawei> pwd
flash:/test
<Huawei> copy backup.zip backup1.zip
Info: Copy flash:/test/backup.zip to flash:/test/backup1.zip?(y/n)[n]:y
100% complete
Info: Copied file flash:/test/backup.zip to flash:/test/backup1.zip...Done

Related Topics
3.11.42 move

3.11.11 delete (FTP client view)

Function
The delete command deletes a file from the FTP server.

Format
delete remote-filename

Parameters

Parameter Description Value


remote- Specifies the name of a file The value is a string of 1 to 64
filename to be deleted. case-insensitive characters
without spaces.

Views
FTP client view

Default Level
3: Management level

Usage Guidelines
A file deleted in the FTP client view cannot be restored.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 259


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Example
# Delete the file temp.c.
<Huawei> ftp 10.137.217.201
Trying 10.137.217.201 ...
Press CTRL+K to abort
Connected to 10.137.217.201.
220 FTP service ready.
User(10.137.217.201:(none)):huawei
331 Password required for huawei.
Enter password:
230 User logged in.
[Huawei-ftp] delete temp.c
Warning: The contents of file temp.c cannot be recycled. Continue? (y/n)[n]:y
250 File deleted from remote host.

Related Topics
3.11.14 dir/ls (FTP client view)

3.11.12 delete (user view)


Function
The delete command deletes a specified file in the storage device.

Format
delete [ /unreserved ] [ /force ] { filename | devicename }

Parameters
Parameter Description Value
/unreserved Deletes a specified file. -
The deleted file cannot
be restored.

/force Deletes a file directly -


without any
confirmation.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 260


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Parameter Description Value


filename Specifies the name of a The value is a string of 1 to 64 case-
file to be deleted. insensitive characters without spaces in
the [ drive ] [ path ] file name format.
When quotation marks are used around
the string, spaces are allowed in the
string.
In the preceding parameter, drive
specifies the storage device name, and
path specifies the directory and
subdirectory.
You are advised to add : and / between
the storage device name and directory.
Characters ~, *, /, \, :, ', " cannot be used
in the directory name.

devicename Deletes all the files in the -


storage device.

Views
User view

Default Level
3: Management level

Usage Guidelines
Usage Scenario
The following describes the drive name.
● drive is the storage device and is named as follows:
– sd1: root directory of the Micro SD card on the master SRU.
– flash: root directory of the flash memory on the master SRU.
– slave#sd1: root directory of the Micro SD card on the slave SRU. If the
device has no slave SRU, this drive is unavailable.
– slave#flash: root directory of the flash memory on the slave SRU. If the
device has no slave SRU, this drive is unavailable.

Only the AR3200 series supports dual SRUs.


drive is the storage device of the router. It is named flash: on the
AR100&AR120&AR150&AR160&AR200&AR1200 series, AR2201-48FE,
AR2202-48FE, AR2204-27GE, AR2204-24GE, AR2204-27GE-P, AR2204-51GE-P,
AR2204-48GE-P, AR2204EAR2204, AR2220L-DC, AR3670 and AR2220L-AC, is
named flash: or sd1: on the AR2220E, AR2240C, is named flash: or sd1: on

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 261


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

the AR2240 and AR3260 using SRU40, SRU60, SRU80, and is named sd1: on
the AR2240 and AR3260 using SRU200, SRU400, SRU100E, and SRU200E.

The path can be an absolute path or relative path.


● flash:/my/test/ is an absolute path.
● selftest/ is a path relative to the current working directory and indicates the
selftest directory in the current working directory.

Like devicename, drive specifies the storage device name.

Precautions

● The wildcard (*) character can be used in the delete command.


● If the parameter /unreserved is not included, the file is stored in the recycle
bin. To display all files including deleted files that are displayed in square
brackets ([ ]), run the dir /all command. To restore these files that are
displayed in square brackets ([ ]), run the undelete command. To clear these
files from the recycle bin, run the reset recycle-bin command.

NOTICE

If you delete a file using the /unreserved parameter, the file cannot be
restored.

● If you delete a specified storage device, all files are deleted from the root
directory of the storage device.
● If you delete two files with the same name from different directories, the last
file deleted is kept in the recycle bin.
● If you attempt to delete a protected file, such as a configuration file, or patch
filer, a system prompt is displayed.
● You cannot delete a directory by running the delete command. To delete a
directory, run the rmdir (user view) command.

Example
# Delete the file test.txt from the flash:/test/ directory.
<Huawei> delete flash:/test/test.txt
Info: Delete flash:/test/test.txt?(y/n)[n]:y

# Delete the file test.txt from the current working directory flash:/selftest.
<Huawei> delete test.txt
Info: Delete flash:/selftest/test.txt?(y/n)[n]::y

Related Topics
3.11.55 reset recycle-bin
3.11.71 undelete

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 262


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

3.11.13 dir (user view)


Function
The dir command displays information about files and directories in the storage
medium.

Format
dir [ /all ] [ filename | directory ]

Parameters
Parameter Description Value

/all Displays information -


about all files and
directories in the current
directory, including files
and directories moved to
the recycle bin from the
current directory.

filename Specifies the file name. The value is a string of 1


to 64 case-insensitive
characters without
spaces in the [ drive ]
[ path ] file name
format. When quotation
marks are used around
the string, spaces are
allowed in the string.
In the preceding
parameter, drive
specifies the storage
device name, and path
specifies the directory
and subdirectory.
You are advised to add :
and / between the
storage device name and
directory. Characters ~,
*, /, \, :, ', " cannot be
used in the directory
name.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 263


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Parameter Description Value

directory Specifies the file The value is a string of 1


directory. to 64 case-insensitive
characters without
spaces in the [ drive ]
path format.
In the preceding
parameter, drive
specifies the storage
device name, and path
specifies the directory
and subdirectory.
You are advised to add :
and / between the
storage device name and
directory. Characters ~,
*, /, \, :, ', " cannot be
used in the directory
name.

Views
User view

Default Level
3: Management level

Usage Guidelines
Usage Scenario
The wildcard character (*) can be used in this command. If no parameter is
specified, this command displays information about files and directories in the
current directory.
The following describes the drive name:
● drive is the storage device and is named as follows:
– sd1: root directory of the Micro SD card on the master SRU.
– flash: root directory of the flash memory on the master SRU.
– slave#sd1: root directory of the Micro SD card on the slave SRU. If the
device has no slave SRU, this drive is unavailable.
– slave#flash: root directory of the flash memory on the slave SRU. If the
device has no slave SRU, this drive is unavailable.

Only the AR3200 series supports dual SRUs.


drive is the storage device of the router. It is named flash: on the
AR100&AR120&AR150&AR160&AR200&AR1200 series, AR2201-48FE,

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 264


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

AR2202-48FE, AR2204-27GE, AR2204-24GE, AR2204-27GE-P, AR2204-51GE-P,


AR2204-48GE-P, AR2204EAR2204, AR2220L-DC, AR3670 and AR2220L-AC, is
named flash: or sd1: on the AR2220E, AR2240C, is named flash: or sd1: on
the AR2240 and AR3260 using SRU40, SRU60, SRU80, and is named sd1: on
the AR2240 and AR3260 using SRU200, SRU400, SRU100E, and SRU200E.
The path can be an absolute path or relative path.
● flash:/my/test/ is an absolute path.
● selftest/ is a path relative to the current working directory and indicates the
selftest directory in the current working directory.
You can run the dir /all command to view information about all files and
directories of the storage medium, including those moved to the recycle bin. The
name of a file in the recycle bin is placed in square brackets ([]), for example,
[test.txt].
Precautions
The device can display information about a maximum of 2,000 files and
directories.

Example
# Display information about all files and directories in the current directory.
<Huawei> dir /all
Directory of flash:/

Idx Attr Size(Byte) Date Time(LMT) FileName


0 -rw- 889 Feb 25 2012 10:00:58 private-data.txt
1 -rw- 6,311 Feb 17 2012 14:05:04 backup.cfg
2 -rw- 836 Jan 01 2012 18:06:20 rr.dat
3 drw- - Jan 01 2012 18:08:20 syslogfile
4 -rw- 836 Jan 01 2012 18:06:20 rr.bak
5 drw- - Feb 27 2012 00:00:54 security
6 -rw- 523,240 Mar 16 2011 11:21:36 bootrom_53hib66.bin
7 -rw- 2,290 Feb 25 2012 16:46:06 vrpcfg.cfg
8 -rw- 812 Dec 12 2011 15:43:10 hostkey
9 drw- - Jan 01 2012 18:05:48 compatible
10 -rw- 25,841,428 Nov 17 2011 09:48:10 basicsoft.cc
11 -rw- 540 Dec 12 2011 15:43:12 serverkey
12 -rw- 26,101,692 Dec 21 2011 11:44:52 devicesoft.cc
13 -rw- 6,292 Feb 14 2012 11:14:32 1.cfg
14 -rw- 6,311 Feb 17 2012 10:22:56 1234.cfg
15 -rw- 6,311 Feb 25 2012 17:22:30 [11.cfg]

1,927,220 KB total (1,130,464 KB free)

# Display information about the file vrpcfg.cfg in the current directory.


<Huawei> dir vrpcfg.cfg
Directory of flash:/

Idx Attr Size(Byte) Date Time(LMT) FileName


0 -rw- 2,290 Feb 25 2012 16:46:06 vrpcfg.cfg

1,927,220 KB total (1,130,464 KB free)

# Display information about all .txt files in the current directory.


<Huawei> dir *.txt
Directory of flash:/

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 265


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Idx Attr Size(Byte) Date Time(LMT) FileName


0 -rw- 889 Feb 25 2012 10:00:58 private-data.txt

1,927,220 KB total (1,130,464 KB free)

Table 3-37 Description of the dir command output

Item Description

d Directory. If this item is not displayed, the corresponding


FileName field displays a file. For example, devicesoft.cc is a file
and security is a directory.

r The file or directory is readable.

w The file or directory is writable.

[] A file moved to the recycle bin.

FileName ● private-data.txt: The file saves service initialization data.


Initialization data of some tasks is irrelevant to the
configuration and is not recorded in the configuration file. The
private-data.txt file records initialization data of these tasks,
for example, the number of times the device restarts.
● vrpcfg.cfg: configuration file. The file name extension of the
configuration file must be .cfg or .zip.
● basicsoft.cc: system software. The file name extension of the
system software must be .cc.
Some software sub-systems store necessary data in other files in
the file system when the device is running properly.

3.11.14 dir/ls (FTP client view)

Function
The dir and ls commands display all files or specified files that are stored on the
FTP server, and save them to a local disk.

Format
dir [ remote-filename [ local-filename ] ]

ls [ remote-filename [ local-filename ] ]

Parameters
Parameter Description Value
remote- Specifies the name and The value is a string of 1 to 64
filename directory of a file stored on the case-insensitive characters
FTP server. without spaces.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 266


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Parameter Description Value


local-filename Specifies the name of the local The value is a string of 1 to 64
file that saves the FTP server case-insensitive characters
file information. without spaces.

Views
FTP client view

Default Level
3: Management level

Usage Guidelines
Usage Scenario
The following describes differences between the dir and ls commands.
● When you run the dir command, detailed file information is displayed,
including the file size, date when the file was created, whether the file is a
directory, and whether the file can be modified. When you run the ls
command, only the file name is displayed.
● The dir command is used to save detailed file information, while the ls
command is used to save only the file name even if the file is specified and
saved in a local directory.
Precautions
The wildcard (*) character can be used in commands dir and ls.

Example
# Display the name or detailed information about a file that is saved in the test
directory.
<Huawei> ftp 10.137.217.201
Trying 10.137.217.201 ...
Press CTRL+K to abort
Connected to 10.137.217.201.
220 FTP service ready.
User(10.137.217.201:(none)):huawei
331 Password required for huawei.
Enter password:
230 User logged in.
[Huawei-ftp] cd test
250 CWD command successfully.

[Huawei-ftp] dir
200 Port command okay.
150 Opening ASCII mode data connection for *.
drwxrwxrwx 1 noone nogroup 0 Mar 24 10:48 .
drwxrwxrwx 1 noone nogroup 0 Mar 26 15:52 ..
drwxrwxrwx 1 noone nogroup 0 Mar 23 16:04 yourtest
-rwxrwxrwx 1 noone nogroup 5736 Mar 24 10:38 backup.txt
-rwxrwxrwx 1 noone nogroup 5736 Mar 24 10:38 backup1.txt
226 Transfer complete.
[Huawei-ftp] ls

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 267


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

200 Port command okay.


150 Opening ASCII mode data connection for *.
.
..
yourtest
backup.txt
backup1.txt
226 Transfer complete.

# Display the detailed information for the file temp.c, and save the displayed
information in file temp1.
[Huawei-ftp] dir temp.c temp1
200 Port command okay.
150 Opening ASCII mode data connection for temp.c.

226 Transfer complete.

[Huawei-ftp] quit

221 Server closing.


<Huawei> more temp1
-rwxrwxrwx 1 noone nogroup 3929 Apr 27 18:13 temp.c

# Display the name of file test.bat, and save the displayed information in file test.
<Huawei> ftp 10.137.217.201
Trying 10.137.217.201 ...
Press CTRL+K to abort
Connected to 10.137.217.201.
220 FTP service ready.
User(10.137.217.201:(none)):huawei
331 Password required for huawei.
Enter password:
230 User logged in.
[Huawei-ftp] ls test.bat test
200 Port command okay.
150 Opening ASCII mode data connection for test.bat.

226 Transfer complete.

[Huawei-ftp] quit

221 Server closing.


<Huawei> more test
test.bat

Table 3-38 Description of the dir/Is command output


Item Description

d Indicates a directory. If this parameter is not present, the


command output indicates a file.

r Indicates that the file or directory can be read.

w Indicates that the file or directory can be modified.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 268


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

3.11.15 dir/ls (SFTP client view)


Function
The dir and ls commands display a list of specified files that are stored on the
SFTP server.

Format
dir [ -l | -a ] [ remote-directory ]
ls [ -l | -a ] [ remote-directory ]

Parameters
Parameter Description Value
-l Displays detailed information about -
all files and directories in a specified
directory.
-a Displays names of all files and -
directories in a specified directory.
remote-directory Specifies the name of a directory on The value is a string of
the SFTP server. 1 to 64 case-insensitive
characters without
spaces.

Views
SFTP client view

Default Level
3: Management level

Usage Guidelines
The dir and ls commands are equivalent.
● If -l and -a parameters are not specified, detailed information about all files
and directories in a specified directory is displayed when you run the dir or ls
command. The effect is the same as the dir -l command output.
● By default, if the remote-directory parameter is not specified, the list of
current directory files is displayed when you run the dir or ls command.

Example
# Display a list of files in the test directory of the SFTP server.
<Huawei> system-view
[Huawei] sftp 10.137.217.201
Please input the username:admin
Trying 10.137.217.201 ...

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 269


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Press CTRL+K to abort


Connected to 10.137.217.201 ...
Enter password:
sftp-client> dir test
drwxrwxrwx 1 noone nogroup 0 Mar 24 18:48 .
drwxrwxrwx 1 noone nogroup 0 Mar 29 14:52 ..
-rwxrwxrwx 1 noone nogroup 0 Mar 24 00:04 yourtest
-rwxrwxrwx 1 noone nogroup 5736 Mar 24 18:38 backup.txt
-rwxrwxrwx 1 noone nogroup 5736 Mar 24 18:38 backup1.txt
sftp-client> dir -a test
.
..
yourtest
backup.txt
backup1.txt
sftp-client> ls test
drwxrwxrwx 1 noone nogroup 0 Mar 24 18:48 .
drwxrwxrwx 1 noone nogroup 0 Mar 29 14:52 ..
-rwxrwxrwx 1 noone nogroup 0 Mar 24 00:04 yourtest
-rwxrwxrwx 1 noone nogroup 5736 Mar 24 18:38 backup.txt
-rwxrwxrwx 1 noone nogroup 5736 Mar 24 18:38 backup1.txt
sftp-client> ls -a test
.
..
yourtest
backup.txt
backup1.txt

3.11.16 disconnect
Function
The disconnect command terminates the connection with the remote FTP server
and displays the FTP client view.

Format
disconnect

Parameters
None

Views
FTP client view

Default Level
3: Management level

Usage Guidelines
This command is equivalent to the close command.
You can run the bye and quit commands to terminate the connection with the
remote FTP server and enter the user view.
To enter the user view from the FTP client view, you can run the bye or quit
command.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 270


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Example
# Terminate the connection with the remote FTP server and enter the FTP client
view.
<Huawei> ftp 10.137.217.201
Trying 10.137.217.201 ...
Press CTRL+K to abort
Connected to 10.137.217.201.
220 FTP service ready.
User(10.137.217.201:(none)):huawei
331 Password required for huawei.
Enter password:
230 User logged in.
[Huawei-ftp] disconnect

221 Windows FTP Server (WFTPD, by Texas Imperial Software) says goodbye.

[Huawei-ftp]

Related Topics
3.11.3 bye
3.11.9 close
3.11.43 open

3.11.17 display ftp-client


Function
The display ftp-client command displays the source IP address configured for the
FTP client.

Format
display ftp-client

Parameters
None

Views
All views

Default Level
3: Management level

Usage Guidelines
The default source IP address 0.0.0.0 is used if ftp client-source is not configured.

Example
# Display the source IP address of the FTP client.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 271


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

<Huawei> display ftp-client


Info: The source IP address of FTP client is 10.1.1.1.

Table 3-39 Description of the display ftp-client command output

Item Description

Info: The source IP address of FTP client 10.1.1.1 is the source IP address of the
is 10.1.1.1. FTP client.
You can run the ftp client-source
command to configure the source IP
address.
If a source IP address has been
configured by using the ftp client-
source command, the message "The
source interface of the FTP client is
LoopBack0" is displayed.

Related Topics
3.11.26 ftp
3.11.28 ftp client-source

3.11.18 display ftp-server


Function
The display ftp-server command displays FTP server parameter settings.

Format
display [ ipv6 ] ftp-server

Parameters
Parameter Description Value
ipv6 Specifies the IPv6 FTP server. -

Views
All views

Default Level
3: Management level

Usage Guidelines
You can run this command to display FTP server parameter settings.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 272


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Example
# Display FTP server parameter settings.
<Huawei> display ftp-server
FTP server is running
Max user number 5
User count 1
Timeout value(in minute) 30
Listening port 21
Acl number 2010
FTP server's source address 10.1.1.1

Table 3-40 Description of the display ftp-server command output


Item Description

FTP server is running The FTP server starts.


You can run the ftp [ ipv6 ] server
enable command to start the FTP
server.

Max user number Maximum number of users who can


access the FTP server.

User count Number of users who are accessing


the FTP server.

Timeout value(in minute) Idle timeout duration of FTP users.


You can run the ftp [ ipv6 ] timeout
command to set the idle timeout
duration of FTP users.

Listening port Number of the listening port on the


FTP server. The default value is 21.
If the value is not 21, you can run the
ftp [ ipv6 ] server port command to
configure the listening port number.

Acl number Number of the ACL of the FTP server.


The default value is 0. You can run the
ftp [ ipv6 ] acl command to change
the ACL number.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 273


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Item Description

FTP server's source address Source IP address for the FTP server to
send packets. The default value is
0.0.0.0.
You can run the ftp server-source
command to configure the source IP
address for the FTP server. Here, the
source IP address 10.1.1.1 is displayed.
If a source interface is configured, this
field displays "FTP server's source
interface LoopBack0."
NOTE
If you run the display ipv6 ftp-server
command, the FTP server's source
interface LoopBack0 is not displayed.

Related Topics
3.11.27 ftp acl
3.11.29 ftp server enable
3.11.31 ftp server port
3.11.32 ftp server-source
3.11.33 ftp timeout

3.11.19 display ftp-users

Function
The display ftp-users command displays FTP user parameters on the FTP server.

Format
display ftp-users

Parameters
None

Views
All views

Default Level
3: Management level

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 274


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Usage Guidelines
You can check FTP user parameters on the FTP server, such as the FTP user name,
IP address of the client host, port number, idle duration, and the authorized
directories.

Example
# Display FTP user parameters.
<Huawei> display ftp-users
username host port idle topdir
user 10.138.77.41 4028 0 flash:/test
huawei 10.137.217.159 51156 0 flash:

The preceding information indicates that two users are connected to the FTP
server.

Table 3-41 Description of the display ftp-users command output

Item Description

username FTP user name.

host IP address of the client host.

port Port number of the client host.

idle Idle duration.

topdir Authorized directory of a user.


You can run the local-user ftp-directory command to
configure the authorized directory.

Related Topics
3.11.33 ftp timeout
19.1.57 local-user

3.11.20 display sftp-client

Function
The display sftp-client command displays the source IP address configured for
the SFTP client.

Format
display sftp-client

Parameters
None

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 275


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Views
All views

Default Level
3: Management level

Usage Guidelines
You can run the display sftp client command to display the source IP address of
the SFTP client. The default source IP address 0.0.0.0 is used if sftp client-source
is not configured.

Example
# Display the source IP address configured for the SFTP client.
<Huawei> display sftp-client
Info: The source address of SFTP client is 10.1.1.1

Table 3-42 Description of the display sftp-client command output

Item Description

Info: The source address of SFTP client 10.1.1.1 is the source IP address of the
is 10.1.1.1 SFTP client.
You can run the sftp client-source
command to configure the source IP
address for the SFTP client.
If an IP address has been configured
for the source port, the message "The
source interface of the SFTP client is
LoopBack0" is displayed.

Related Topics
3.11.62 sftp
3.11.63 sftp client-source

3.11.21 display tftp-client

Function
The display tftp-client command displays the source IP address configured for
the TFTP client.

Format
display tftp-client

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 276


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Parameters
None

Views
All views

Default Level
3: Management level

Usage Guidelines
You can run the display tftp client command to query source IP address of the
TFTP client. The default source IP address is 0.0.0.0 if tftp client-source is not
configured.

Example
# Display the source IP address configured for the TFTP client.
<Huawei> display tftp-client
Info: The source address of TFTP client is 10.1.1.1.

Table 3-43 Description of the display tftp-client command output

Parameter Description

Info: The source address of TFTP client 10.1.1.1 is the source IP address of the
is 10.1.1.1. TFTP client.
You can run the tftp client-source
command to configure the source IP
address for the TFTP client.
If the IP address is configured for the
source port, the message "The source
interface of TFTP client is LoopBack0"
is displayed.

Related Topics
3.11.65 tftp
3.11.66 tftp client-source

3.11.22 display tftp-server status

Function
The display tftp-server status command displays the TFTP server information.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 277


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Format
display tftp-server status

Parameters
None

Views
All views

Default Level
3: Management level

Usage Guidelines
You can run this command to check the TFTP server configuration and
connections with the current TFTP clients.

Example
# Display the TFTP server information.
<Huawei> display tftp-server status
TFTP Server is enabled
Listening port 69
Timeout value(in second) 10
TFTP server's root path flash:
There are 1 clients connected
[1]: ip 10.137.217.163, port 23, op READ

Table 3-44 Description of the display tftp-server status command output

Item Description

TFTP Server is Status of the TFTP server.


● disabled
● enabled
To enable or disable the TFTP server
function, run the tftp server enable
command.

Listening port Port number of the TFTP server.


To configure a port number for the
TFTP server, run the tftp server port
command.

Timeout value(in second) Packet timeout period of the TFTP


server, in seconds.
To configure a packet timeout period
for the TFTP server, run the tftp server
timeout command.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 278


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Item Description

TFTP server's root path Working directory of the TFTP server.


To configure a working directory for
the TFTP server, run the set default
tftp-directory command.

There are 1 clients connected One client has connected to the TFTP
server.

[1]: ip 10.137.217.163, port 23, op Client information. The client sequence


READ number is 1; IP address is
10.137.217.163; port number is 23; and
operation type is Read.

3.11.23 execute

Function
The execute command executes a specified batch file.

Format
execute batch-filename

Parameters
Parameter Description Value
batch-filename The value is a string of 5 to 64 case-
Specifies the name of a
insensitive characters without spaces.
batch file.
The file name extension is .bat.

Views
System view

Default Level
2: Configuration level

Usage Guidelines
Usage Scenario

If a series of commands are frequently executed, write these commands in a batch


file, and store this file in system. In this way, you can only execute this command
to run multiple commands which were manually entered before. This command
improves maintenance and management efficiency.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 279


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

● The batch file is edited in .txt format. When editing the file, ensure that one command
occupies one line. After editing the file, save the file and change the file name extension
to .bat.
● Transfer the batch file in file transmission mode to the device.

Prerequisites

Before running the execute command, ensure that the batch file to be processed
is in the current directory; otherwise, the system cannot find the batch file.

Precautions

● The commands in a batch file are run one by one. A batch file cannot contain
invisible characters (control characters or escape characters, such as \r, \n, and
\b). If any invisible character is detected, the execute command exits from the
current process and no rollback is performed.
● The execute command does not ensure that all commands can be run. If the
system runs a wrong or immature command, it displays the error and goes to
next command. The execute command does not perform the hot backup
operation, and the command format or content is not restricted.
● In case of interactive commands, batch file execution waits the device to
interact with users before continuing.

Example
# Execute the test.bat file in the directory flash:/. The test.bat file contains three
commands: system-view, aaa, and local-user huawei password irreversible-
cipher Helloworld@6789.
<Huawei> system-view
[Huawei] execute test.bat
[Huawei] system-view
^
Error: Unrecognized command found at '^' position.
[Huawei] aaa
[Huawei-aaa] local-user huawei password irreversible-cipher Helloworld@6789
[Huawei-aaa]

When the system runs the first command system-view in current system view, it
displays an error and continues to run the following commands.

The system displays the execution of a batch file in AAA view.


[Huawei-aaa] display this
local-user huawei password irreversible-cipher %@%@HW=5%Mr;:2)/RX$FnU1HLO%-TBMp4wn%;~\#
%iAut}_~O%0L%@%@

3.11.24 file prompt

Function
The file prompt command changes the prompt mode when you perform
operations on files.

The default prompt mode is alert.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 280


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Format
file prompt { alert | quiet }

Parameters

Parameter Description Value


alert Display a prompt message before users perform an -
operation.
quiet Do not display a prompt message before users perform an -
operation.

Views
System view

Default Level
3: Management level

Usage Guidelines

NOTICE

If the prompt mode is set to quiet, the system does not provide prompt messages
when operations leading to data loss are executed, such as deleting or overwriting
files. Therefore, this prompt mode should be used with caution.

Example
# Set the prompt mode to quiet. When you rename a copied file test.txt using an
existing file name test1.txt, no prompt message is displayed.
<Huawei> system-view
[Huawei] file prompt quiet
[Huawei] quit
<Huawei> copy test.txt test1.txt
100% complete
Info: Copied file flash:/test.txt to flash:/test1.txt...Done.

# Set the prompt mode to alert.


<Huawei> system-view
[Huawei] file prompt alert
[Huawei] quit
<Huawei> copy test.txt test1.txt
Copy flash:/test.txt to flash:/test1.txt?[Y/N]:y
The file flash:/test1.txt exists. Overwrite it?[Y/N]:y
100% complete
Info: Copied file flash:/test.txt to flash:/test1.txt...Done.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 281


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

3.11.25 format

Function
The format command formats a storage device.

Format
format drive

Parameters
Parameter Description Value
drive Specifies the name of the storage device to format. -
If a storage device contains the system software package, the
storage device cannot be formatted using the format
command. To format the storage device, perform the
operation in the BootROM menu.

Views
User view

Default Level
3: Management level

Usage Guidelines
Usage Scenario

The following describes the storage device name.


● drive is the storage device and is named as follows:
– sd1: root directory of the Micro SD card on the master SRU.
– flash: root directory of the flash memory on the master SRU.
– slave#sd1: root directory of the Micro SD card on the slave SRU. If the
device has no slave SRU, this drive is unavailable.
– slave#flash: root directory of the flash memory on the slave SRU. If the
device has no slave SRU, this drive is unavailable.

Only the AR3200 series supports dual SRUs.

When the file system fault cannot be rectified or the data on the storage device is
unnecessary, the storage device can be formatted. When you run the format
command, all files and directories are cleared from the storage device.

Configuration Impact

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 282


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

NOTICE
After a storage device is formatted, the data it saves is deleted. If the
configuration file for the next startup is saved on the storage device,
configurations are lost after the device is restarted. If the software package for the
next startup is saved on the storage device, device restart is affected.

Precautions

NOTICE

After the format command is run, files and directories are cleared from the
specified storage device and cannot be restored. Therefore, this command should
be used with caution.

If the storage device is still unavailable after the format command is run, a
physical exception may have occurred.

Example
# Format the storage device.
<Huawei> format flash:
All data(include configuration and system startup file) on flash: will be lost , proceed with format? (y/n)
[n]:y
Info: Format flash: completed.

3.11.26 ftp
Function
The ftp command connects the FTP client to the FTP server and enters the FTP
client view.

Format
# Connect the FTP client to the FTP server based on the IPv4 address.
ftp [ [ -a source-ip-address | -i interface-type interface-number ] host-ip [ port-
number ] [ public-net | vpn-instance vpn-instance-name ] ]
# Connect the FTP client to the FTP server based on the IPv6 address.
ftp ipv6 host-ipv6 [ vpn6-instance vpn6-instance-name ] [ port-number ]

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 283


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Parameters
Parameter Description Value
-a source-ip- Specifies the source IP address The value is in dotted
address for connecting to the FTP client. decimal notation.
You are advised to use the
loopback interface IP address.

-i interface- Specifies the source interface -


type interface- type and ID. You are advised to
number use the loopback interface.
The IP address configured for
this interface is the source IP
address for sending packets. If
no IP address is configured for
the source interface, the FTP
connection cannot be set up.

host-ip Specifies the IP address or host The value is a string of 1 to


name of the remote IPv4 FTP 255 case-insensitive
server. characters without spaces.
When quotation marks are
used around the string,
spaces are allowed in the
string.

port-number Specifies the port number of the The value is an integer that
FTP server. ranges from 1 to 65535. The
default value is the standard
port number 21.
public-net Specifies the FTP server on the -
public network.
You must set the public-net
parameter when the FTP server
IP address is a public network IP
address.

vpn-instance Specifies the name of the VPN The value is a string of 1 to


vpn-instance- instance where the IPv4 FTP 31 case-sensitive characters,
name server is located. spaces not supported. When
double quotation marks are
used around the string,
spaces are allowed in the
string.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 284


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Parameter Description Value


vpn6-instance Specifies the name of the VPN The value is a string of 1 to
vpn6-instance- instance where the IPv6 FTP 31 case-sensitive characters,
name server is located. spaces not supported. When
double quotation marks are
used around the string,
spaces are allowed in the
string.
host-ipv6 Specifies the IP address or host The value is a string of 1 to
name of the remote IPv6 FTP 255 case-insensitive
server. characters without spaces.
When quotation marks are
used around the string,
spaces are allowed in the
string.

Views
User view

Default Level
3: Management level

Usage Guidelines
Usage Scenario

Before accessing the FTP server on the FTP client, you must first run the ftp
command to connect the FTP client to the FTP server.

Precautions

● You can set the source IP address to the source or destination IP address in
the ACL rule when the -a or -i parameter is specified on the IPv4 network.
This shields the IP address differences and interface status impact, filters
incoming and outgoing packets, and implements security authentication.
● You can run the set net-manager vpn-instance command to configure the
NMS management VPN instance before running the open command to
connect the FTP client and server.
– If public-net or vpn-instance is not specified, the FTP client accesses the
FTP server in the VPN instance managed by the NMS.
– If public-net is specified, the FTP client accesses the FTP server on the
public network.
– If vpn-instance vpn-instance-name is specified, the FTP client accesses
the FTP server in a specified VPN instance.
● If no parameter is set in the ftp command, only the FTP view is displayed, and
no connection is set up between the FTP server and client.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 285


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

● If the port number that the FTP server uses is non-standard, you must specify
a standard port number; otherwise, the FTP server and client cannot be
connected.
● When you run the ftp command, the system prompts you to enter the user
name and password for logging in to the FTP server. You can log in to the FTP
server if the user name and password are correct.
● If the number of login users exceeds the maximum value that the FTP server
allows, other authorized users cannot log in to the FTP server. To allow news
authorized users to log in to the FTP server, users who have performed FTP
services must disconnect their clients from the FTP server. You can run the bye
or quit command to disconnect the FTP client from the FTP server and return
to the user view, or run the close or disconnect command to disconnect the
FTP client from the FTP server and retain in the FTP client view.

Example
# Connect to the FTP server whose IP address is 10.137.217.201.
<Huawei> ftp 10.137.217.201
Trying 10.137.217.201 ...
Press CTRL+K to abort
Connected to 10.137.217.201.
220 FTP service ready.
User(10.137.217.201:(none)):huawei
331 Password required for huawei.
Enter password:
230 User logged in.
[Huawei-ftp]

# Connect to the remote IPv6 FTP server whose address is fc00:2001:db8::1.


<Huawei> ftp ipv6 fc00:2001:db8::1
Trying fc00:2001:db8::1
Press CTRL+K to abort
Connected to ftp fc00:2001:db8::1.
220 FTP service ready.
User(fc00:2001:db8::1:(none)):huawei
331 Password required for huawei
Enter Password:
230 User logged in.

[Huawei-ftp]

Related Topics
3.11.3 bye
3.11.16 disconnect

3.11.27 ftp acl

Function
The ftp acl command specifies an ACL number for the current FTP server so that
the FTP client with the same ACL number can access the FTP server.

The undo ftp acl command deletes an ACL number of the current FTP server.

By default, no ACL is configured for FTP server.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 286


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Format
ftp [ ipv6 ] acl acl-number

undo ftp [ ipv6 ] acl

Parameters

Parameter Description Value


ipv6 Specifies the IPv6 FTP server. -
acl-number Specifies the number of the The value is an integer that
ACL. ranges from 2000 to 2999.

Views
System view

Default Level
3: Management level

Usage Guidelines
Usage Scenario

To ensure the security of an FTP server, you need to configure an ACL for it to
specify FTP clients that can access the current FTP server.

Precautions

● The ftp acl command takes effect only after you run the rule command to
configure the ACL rule.
● The FTP only supports the basic ACL whose number ranges from 2000 to
2999.

Example
# Allow the client whose ACL number is 2000 to log in to the FTP server.
<Huawei> system-view
[Huawei] acl 2000
[Huawei-acl-basic-2000] rule permit source 10.10.10.1 0
[Huawei-acl-basic-2000] quit
[Huawei] ftp acl 2000

Related Topics
3.11.18 display ftp-server

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 287


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

3.11.28 ftp client-source


Function
The ftp client-source command specifies the source IP address for the FTP client
to send packets.
The undo ftp client-source command restores the default source IP address for
the FTP client to send packets.
The default source IP address for the FTP client to send packets is 0.0.0.0.

Format
ftp client-source { -a source-ip-address | -i interface-type interface-number }
undo ftp client-source

Parameters
Parameter Description Value
-a source-ip- The value is
Specifies the source IP address. You are
address in dotted
advised to use the loopback interface IP
decimal
address.
notation.
-i interface-type Specifies the source interface. You are -
interface-number advised to use the loopback interface.
The IP address configured for the source
interface is the source IP address for sending
packets. If no IP address is configured for
the source interface, the FTP connection
cannot be set up.

Views
System view

Default Level
3: Management level

Usage Guidelines
Usage Scenario
If no source IP address is specified, the client uses the source IP address that the
router specifies to send packets. The source IP address must be configured for an
interface with stable performance. The loopback interface is recommended. Using
the loopback interface as the source interface simplifies the ACL rule and security
policy configuration. This shields the IP address differences and interface status

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 288


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

impact, filters incoming and outgoing packets, and implements security


authentication.
Precautions
● You can also run the ftp command to configure the source IP address whose
priority is higher than that of the source IP address specified by the ftp client-
source command. If you specify the source IP addresses by running the ftp
client-source and ftp commands, the source IP address specified by the ftp
command is used for data communication and is available only for the
current FTP connection, while the source IP address specified by the ftp
client-source command is available for all FTP connections.
● The IP address that a user displays on the FTP server is the specified source IP
address or source interface IP address.
● If the specified source interface has been bound to a VPN instance, the client
is automatically bound to the same VPN instance.

Example
# Set the source IP address of the FTP client to 10.1.1.1.
<Huawei> system-view
[Huawei] ftp client-source -a 10.1.1.1
Info: Succeeded in setting the source address of the FTP client to 10.1.1.1.

Related Topics
3.11.26 ftp
3.11.32 ftp server-source
3.11.17 display ftp-client

3.11.29 ftp server enable


Function
The ftp server enable command enables the FTP server function to allow FTP
users to log in to the FTP server.
The undo ftp server command disables the FTP server function so that FTP users
cannot log in to the FTP server.
By default, the FTP function is disabled.

Format
ftp [ ipv6 ] server enable
undo ftp [ ipv6 ] server

Parameters
Parameter Description Value
ipv6 Specifies the IPv6 FTP server. -

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 289


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Views
System view

Default Level
3: Management level

Usage Guidelines
Usage Scenario
To manage FTP server files on a client, you must run the ftp server enable
command to enable the FTP server function to allow FTP users to log in to the
FTP server.
Precautions
If the FTP server function is disabled, no user can log in to the FTP server, and
users who have logged in to the FTP server cannot perform any operation except
logout.

NOTICE

The FTP protocol compromises device security. SFTP V2 mode is recommended.

Example
# Enable the FTP server function.
<Huawei> system-view
[Huawei] ftp server enable
Info: Succeeded in starting the FTP server.
Info: FTP is insecure, recommended to use SFTP with encryption features.

Related Topics
3.11.18 display ftp-server

3.11.30 ftp server permit interface


Function
The ftp server permit interface command specifies physical interfaces on the FTP
server to which clients can connect.
The undo ftp permit interface command restores the default physical interfaces
on the FTP server to which clients can connect.
By default, clients can connect to all the physical interfaces on the FTP server.

Format
ftp server permit interface { interface-type interface-number } &<1-5>

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 290


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

undo ftp server permit interface

Parameters
Parameter Description Value
interface-type interface-type: specifies the interface type. -
interface-number
interface-number: specifies the interface number.
interface-number and interface-type specify an
interface.

Views
System view

Default Level
3: Management level

Usage Guidelines
Usage Scenario
To prevent a client from connecting to the FTP server through an unauthorized
physical interface, you can run the ftp server permit interface command to
specify physical interfaces on the FTP server to which the client can connect.
Precautions
● By default, the client can connect to all the physical interfaces on the FTP
server. When you run this command to specify one physical interface on the
FTP server, the client cannot connect to the other physical interfaces on the
FTP server.
● You can specify a maximum of five interfaces each time you run the ftp
server permit interface command. The latest configuration overrides the
previous one. For example, before you run the command, clients can connect
to three physical interfaces GigabitEthernet 1/0/0, GigabitEthernet 2/0/0, and
GigabitEthernet 3/0/0 on the FTP server. After you run the command to
specify the interface GigabitEthernet 1/0/0, clients can only connect to the
interface GigabitEthernet 1/0/0.

Example
# Specify physical interfaces on the FTP server to which clients can connect.
<Huawei> system-view
[Huawei] ftp server permit interface gigabitethernet 1/0/0 gigabitethernet 2/0/0
Info: Succeeded in setting ftp permit interface.

# Restore the default physical interfaces on the FTP server to which clients can
connect.
<Huawei> system-view
[Huawei] undo ftp server permit interface

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 291


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

3.11.31 ftp server port


Function
The ftp server port command specifies the listening port number of the FTP
server.
The default value is 21.

Format
ftp [ ipv6 ] server port port-number

Parameters
Parameter Description Value
ipv6 Specifies the IPv6 FTP server. -
port port-number Specifies the listening port The value is 21 or an
number of the FTP server. integer that ranges from
1025 to 55535.

Views
System view

Default Level
3: Management level

Usage Guidelines
Usage Scenario
By default, the listening port number of the FTP server is 21. Attackers may
frequently access the default listening port, which wastes bandwidth, deteriorates
server performance, and prevents authorized users from accessing the FTP server
through the listening port. You can run the ftp server port command to specify
another listening port number to prevent attackers from accessing the listening
port.
Prerequisites
Before running the ftp server port command to specify the listening port number,
you must first run the undo ftp server command to disable FTP services.
Precautions
● After the ftp server port command is executed, the FTP server disconnects all
FTP connections and uses the new listening port.
● If the current listening port number is 21, FTP client users do not need to
specify the port number for logging in to the FTP server. If the current
listening port number is not 21, FTP client users must use the FTP server's
listening port number to log in to the FTP server.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 292


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

● After the listening port number is changed, you must run the ftp server
enable command to enable FTP services to make the configuration take
effect.

Example
# Change the port number of the FTP server to 1028.
<Huawei> system-view
[Huawei] undo ftp server
[Huawei] ftp server port 1028

Related Topics
3.11.29 ftp server enable

3.11.32 ftp server-source

Function
The ftp server-source command specifies the source IP address for an FTP server
to send packets.

The undo ftp server-source command restores the default source IP address for
an FTP server to send packets.

The default source IP address for the FTP server to send packets is 0.0.0.0.

Format
ftp server-source { -a [ ipv6 ] source-ip-address | -i [ ipv6 ] interface-type
interface-number }

undo ftp [ ipv6 ] server-source

Parameters

Parameter Description Value


ipv6 Configures the FTP server to support an IPv6 source -
address.

-a source-ip-address Specifies the source IP address for the FTP server to -


send packets. The loopback IP address is
recommended.

-i interface-type Specifies the loopback interface of the FTP server -


interface-number as the source interface.
If no loopback interface is configured or no IP
address is configured for the source interface, the
command fails to be executed.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 293


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Views
System view

Default Level
3: Management level

Usage Guidelines
Usage Scenario
If no source IP address is specified, the FTP server uses the source IP address
specified by routes to send packets. The source IP address must be configured for
an interface with stable performance, such as the loopback interface. Using the
loopback interface as the source IP address simplifies the ACL rule and security
policy configuration. This shields the IP address differences and interface status
impact, filters incoming and outgoing packets, and implements security
authentication.
Precautions
● After the source IP address is specified for the FTP server, you must use the
specified IP address to log in to the FTP server.
● If the FTP service has been enabled, the FTP service restarts after the ftp
server-source command is executed.
● If the specified source interface has been bound to a VPN instance, the server
is automatically bound to the same VPN instance.

Example
# Set the source IP address of the FTP server to LoopBack0.
<Huawei> system-view
[Huawei] ftp server-source -i loopback 0
Warning: To make the server source configuration take effect, the FTP server will be restarted. Continue? [Y/
N]: y
Info: Succeeded in setting the source interface of the FTP server to LoopBack0.
Info: Succeeded in starting the FTP server.
Info: FTP is insecure, recommended to use SFTP with encryption features.

Related Topics
3.11.26 ftp
3.11.29 ftp server enable
3.11.28 ftp client-source

3.11.33 ftp timeout


Function
The ftp timeout command configures the idle timeout duration of the FTP server.
The undo ftp timeout command restores the default idle timeout duration.
By default, the idle timeout duration of the FTP server is 30 minutes.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 294


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Format
ftp [ ipv6 ] timeout minutes

undo ftp [ ipv6 ] timeout

Parameters
Parameter Description Value
ipv6 Specifies the IPv6 FTP -
server.
minutes Specifies idle timeout The value is an integer that ranges from
duration. 1 to 35791, in minutes. By default, the
idle timeout duration is 30 minutes.

Views
System view

Default Level
3: Management level

Usage Guidelines
After a user logs in to the FTP server, a connection is set up between the FTP
server and the user's client. The idle timeout duration is configured to release the
connection when the connection is interrupted or when the user performs no
operation for a specified time.

Example
# Set the idle timeout duration to 36 minutes.
<Huawei> system-view
[Huawei] ftp timeout 36

Related Topics
3.11.18 display ftp-server

3.11.34 get (SFTP client view)

Function
The get command downloads a file from the SFTP server and saves the file to the
local device.

Format
get remote-filename [ local-filename ]

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 295


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Parameters

Parameter Description Value


remote- Specifies the name of the file The value is a string of 1 to 64
filename to be downloaded from the case-insensitive characters
SFTP server. without spaces.
local-filename Specifies the name of a The value is a string of 1 to 64
downloaded file to be saved to case-insensitive characters
the local device. without spaces.

Views
SFTP client view

Default Level
3: Management level

Usage Guidelines
Usage Scenario

You can run the get command to download files from the FTP server to upgrade
devices.

Precautions

● If local-filename is not specified on the local device, the original file name is
used.
● If the name of the downloaded file is the same as that of an existing local
file, the system prompts you whether to overwrite the existing file.

Example
# Download a file from the SFTP server.
<Huawei> system-view
[Huawei] sftp 10.137.217.201
Please input the username:admin
Trying 10.137.217.201 ...
Press CTRL+K to abort
Connected to 10.137.217.201 ...
Enter password:
sftp-client> get test.txt
Remote file: / test.txt ---> Local file: test.txt
Info: Downloading file successfully ended.

Related Topics
3.11.46 put (SFTP client view)

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 296


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

3.11.35 get (FTP client view)


Function
The get command downloads a file from the FTP server and saves the file to the
local device.

Format
get remote-filename [ local-filename ]

Parameters
Parameter Description Value
remote- Specifies the name of the file The value is a string of 1 to 64
filename to be downloaded from the case-insensitive characters
FTP server. without spaces.
local-filename Specifies the name of a The value is a string of 1 to 64
downloaded file to be saved to case-insensitive characters
the local device. without spaces.

Views
FTP client view

Default Level
3: Management level

Usage Guidelines
Usage Scenario
You can run the get command to download system software, backup
configuration files, and patch files from the FTP server to upgrade devices.
Precautions
● If the downloaded file name is not specified on the local device, the original
file name is used.
● If the name of the downloaded file is the same as that of an existing local
file, the system prompts you whether to overwrite the existing file.

Example
# Download the system software devicesoft.cc from the FTP server.
<Huawei> ftp 10.137.217.201
Trying 10.137.217.201 ...
Press CTRL+K to abort
Connected to 10.137.217.201.
220 FTP service ready.
User(10.137.217.201:(none)):huawei

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 297


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

331 Password required for huawei.


Enter password:
230 User logged in.
[Huawei-ftp] get devicesoft.cc
200 Port command successful.
150 Opening data connection for devicesoft.cc.
226 File sent ok
FTP: 6482944 byte(s) received in 54.500 second(s) 1117.40byte(s)/sec.

Related Topics
3.11.45 put (FTP client view)

3.11.36 help (SFTP client view)


Function
The help command displays the help information in the SFTP client view.

Format
help [ all | command-name ]

Parameters
Parameter Description Value
all Displays all commands in the SFTP client view. -
command-name Displays the format and parameters of a specified -
command in the SFTP client view.

Views
SFTP client view

Default Level
3: Management level

Usage Guidelines
Usage Scenario

In the SFTP view, you can only enter the question mark (?) to obtain all
commands in the SFTP client view. If you enter a command keyword and the
question mark (?) to query command parameters, an error message is displayed,
as shown in the following:
sftp-client> dir ?
Error: Failed to list files.

You can run the help command to obtain the help information and display all
commands or a command format in the SFTP client view.

Precautions

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 298


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

If you specify no parameter when running the help command, all commands in
the SFTP client view are displayed. This has the same effect as the help all
command or directly entering the question mark (?) in the SFTP client view.

Example
# Display the format of the command get.
<Huawei> system-view
[Huawei] sftp 10.137.217.201
Please input the username:admin
Trying 10.137.217.201 ...
Press CTRL+K to abort
Connected to 10.137.217.201 ...
Enter password:
sftp-client> help get
get Remote file name STRING<1-64> [Local file name STRING<1-64>] Download file
Default local file name is the same with remote file.

# Display all commands in the SFTP client view.


sftp-client> help all
cd
cdup
dir
get
help
ls
mkdir
put
pwd
quit
rename
remove
rmdir

Related Topics
3.11.62 sftp

3.11.37 lcd

Function
The lcd command displays and changes the local working directory of the FTP
client in the FTP client view.

Format
lcd [ local-directory ]

Parameters
Parameter Description Value
local-directory Specifies the local working The value is a string of 1 to 64
directory of the FTP client. case-insensitive characters without
spaces.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 299


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Views
FTP client view

Default Level
3: Management level

Usage Guidelines
Usage Scenario

You can run the lcd command to display the local working directory of the FTP
client when uploading or downloading files, and set the upload or download path
to the path of the local working directory.

Precautions

The lcd command displays the local working directory of the FTP client, while the
pwd command displays the working directory of the FTP server. If you specify the
parameter local-directory in the lcd command, you can directly change the local
working directory in the FTP client view.

Example
# Change the local working directory to flash:/test.
<Huawei> ftp 10.137.217.201
Trying 10.137.217.201 ...
Press CTRL+K to abort
Connected to 10.137.217.201.
220 FTP service ready.
User(10.137.217.201:(none)):huawei
331 Password required for huawei.
Enter password:
230 User logged in.
[Huawei-ftp] lcd
The current local directory is flash:.
[Huawei-ftp] lcd flash:/test
The current local directory is flash:/test.

Related Topics
3.11.47 pwd (FTP client view)

3.11.38 mkdir (FTP client view)

Function
The mkdir command creates a directory on the remote FTP server.

Format
mkdir remote-directory

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 300


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Parameters
Parameter Description Value
remote- Specifies the The value is a string of case-insensitive
directory directory to be characters without spaces. The absolute
created. path length ranges from 1 to 64, while the
directory name length ranges from 1 to 15.

Views
FTP client view

Default Level
3: Management level

Usage Guidelines
● You can run the mkdir command to create a subdirectory in a specified
directory, and the subdirectory name must be unique.
● If no path is specified when you create a subdirectory, the subdirectory is
created in the current directory.
● The created directory is stored on the FTP server.

Example
# Create a directory test on the remote FTP server.
<Huawei> ftp 172.16.104.110
Trying 172.16.104.110 ...
Press CTRL+K to abort
Connected to 172.16.104.110.
220 FTP service ready.
User(172.16.104.110:(none)):huawei
331 Password required for huawei
Enter password:
230 User logged in.
[Huawei-ftp] mkdir test
257 "test" new directory created.

Related Topics
3.11.14 dir/ls (FTP client view)
3.11.56 rmdir (FTP client view)

3.11.39 mkdir (SFTP client view)


Function
The mkdir command creates a directory on the remote SFTP server.

Format
mkdir remote-directory

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 301


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Parameters
Parameter Description Value
remote- Specifies the The value is a string of case-insensitive
directory directory to be characters without spaces. The absolute
created. path length ranges from 1 to 64, while the
directory name length ranges from 1 to 15.

Views
SFTP client view

Default Level
3: Management level

Usage Guidelines
● You can run the mkdir command to create a subdirectory in a specified
directory, and the subdirectory name must be unique.
● If no path is specified when you create a subdirectory, the subdirectory is
created in the current directory.
● The created directory is stored on the SFTP server.
● After a directory is created, you can run the dir/ls (SFTP client view)
command to view the directory.

Example
# Create a directory on the SFTP server.
<Huawei> system-view
[Huawei] sftp 10.137.217.201
Please input the username:admin
Trying 10.137.217.201 ...
Press CTRL+K to abort
Connected to 10.137.217.201 ...
Enter password:
sftp-client> mkdir ssh
Info: Succeeded in creating a directory.

Related Topics
3.11.15 dir/ls (SFTP client view)
3.11.58 rmdir (SFTP client view)

3.11.40 mkdir (User view)


Function
The mkdir command creates a directory in the current storage device.

Format
mkdir directory

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 302


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Parameters
Parameter Description Settings

directory Specifies a directory or The value is a string of


directory and its path. case-insensitive
characters in the
[ drive ] [ path ]
directory format. The
absolute path length
ranges from 1 to 64,
while the directory name
length ranges from 1 to
15.
In the preceding
parameter, drive
specifies the storage
device name, and path
specifies the directory
and subdirectory.
Characters such as ~, *, /,
\, :, ', " cannot be used in
the directory name.

Views
User view

Default Level
3: Management level

Usage Guidelines
Usage Scenario
The following describes the drive name.
● drive is the storage device and is named as follows:
– sd1: root directory of the Micro SD card on the master SRU.
– flash: root directory of the flash memory on the master SRU.
– slave#sd1: root directory of the Micro SD card on the slave SRU. If the
device has no slave SRU, this drive is unavailable.
– slave#flash: root directory of the flash memory on the slave SRU. If the
device has no slave SRU, this drive is unavailable.

Only the AR3200 series supports dual SRUs.


drive is the storage device of the router. It is named flash: on the
AR100&AR120&AR150&AR160&AR200&AR1200 series, AR2201-48FE,

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 303


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

AR2202-48FE, AR2204-27GE, AR2204-24GE, AR2204-27GE-P, AR2204-51GE-P,


AR2204-48GE-P, AR2204EAR2204, AR2220L-DC, AR3670 and AR2220L-AC, is
named flash: or sd1: on the AR2220E, AR2240C, is named flash: or sd1: on
the AR2240 and AR3260 using SRU40, SRU60, SRU80, and is named sd1: on
the AR2240 and AR3260 using SRU200, SRU400, SRU100E, and SRU200E.

The path can be an absolute path or relative path.


● flash:/my/test/ is an absolute path.
● selftest/ is a path relative to the current working directory and indicates the
selftest directory in the current working directory.

If you only the subdirectory name is specified, a subdirectory is created in the


current working directory. You can run the 3.11.49 pwd (user view) command to
query the current working directory. If the subdirectory name and directory path
are specified, the subdirectory is created in the specified directory.

Precautions

● The subdirectory name must be unique in a directory; otherwise, the message


"Error: Directory already exists" is displayed.

Example
# Create the subdirectory new in the flash card.
<Huawei> mkdir flash:/new
Info: Create directory flash:/new......Done

Related Topics
3.11.13 dir (user view)

3.11.41 more

Function
The more command displays the content of a specified file.

Format
more [ /binary ] filename [ offset ] [ all ]

Parameters

Parameter Description Value


/binary Displays the file -
content in binary
mode.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 304


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Parameter Description Value


filename Specifies the file The value is a string of 1 to 64 case-insensitive
name. characters without spaces in the [ drive ]
[ path ] file name format. When quotation
marks are used around the string, spaces are
allowed in the string.
In the preceding parameter, drive specifies the
storage device name, and path specifies the
directory and subdirectory.
You are advised to add : and / between the
storage device name and directory. Characters
~, *, /, \, :, ', " cannot be used in the directory
name.

offset Specifies the file The value is an integer that ranges from 0 to
offset. 2147483647, in bytes.
all Displays all the file -
content on one
screen.

Views
User view

Default Level
3: Management level

Usage Guidelines
Usage Scenario
You can run the more command to display the file content directly on a device.
● The following describes the drive name.
– drive is the storage device and is named as follows:

▪ sd1: root directory of the Micro SD card on the master SRU.

▪ flash: root directory of the flash memory on the master SRU.

▪ slave#sd1: root directory of the Micro SD card on the slave SRU. If


the device has no slave SRU, this drive is unavailable.

▪ slave#flash: root directory of the flash memory on the slave SRU. If


the device has no slave SRU, this drive is unavailable.

Only the AR3200 series supports dual SRUs.


drive is the storage device of the router. It is named flash: on the
AR100&AR120&AR150&AR160&AR200&AR1200 series, AR2201-48FE,

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 305


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

AR2202-48FE, AR2204-27GE, AR2204-24GE, AR2204-27GE-P,


AR2204-51GE-P, AR2204-48GE-P, AR2204EAR2204, AR2220L-DC, AR3670
and AR2220L-AC, is named flash: or sd1: on the AR2220E, AR2240C, is
named flash: or sd1: on the AR2240 and AR3260 using SRU40, SRU60,
SRU80, and is named sd1: on the AR2240 and AR3260 using SRU200,
SRU400, SRU100E, and SRU200E.
● The path can be an absolute path or relative path.
– flash:/my/test/ is an absolute path.
– selftest/ is a path relative to the current working directory and indicates
the selftest directory in the current working directory.
Precautions
● You are not advised to use this command to display non-text files; otherwise,
the terminal is shut down or displays garbled characters, which is harmless to
the system.
● Files are displayed in text format.
● You can display the file content flexibly by specifying parameters before
running the more command:
– You can run the more filename command to view a specified text file.
The content of the specified text file is displayed on multiple screens. You
can press the spacebar consecutively on the current session GUI to
display all content of the file.
To display the file content on multiple screens, you must ensure that:

▪ The number of lines that can be displayed on a terminal screen is


greater than 0. (The number of lines that can be displayed on a
terminal screen is set by running the screen-length command.)

▪ The total number of file lines is greater than the number of lines
that can be displayed on a terminal screen. (The number of lines that
can be displayed on a terminal screen is set by running the screen-
length command.)
– You can run the more filename offset command to view a specified file.
The content of the specified text file starting from offset is displayed on
multiple screens. You can press the spacebar consecutively on the current
session GUI to display all content of the file.
To display the file content on multiple screens, you must ensure that:

▪ The number of lines that can be displayed on a terminal screen is


greater than 0. (The number of lines that can be displayed on a
terminal screen is set by running the screen-length command.)

▪ The number of lines starting from offset in the file is greater than
the number of lines that can be displayed on a terminal screen. (The
number of lines that can be displayed on a terminal screen is set by
running the screen-length command.)
– You can run the more file-name all command to view a specified file.
The file content is displayed on one screen.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 306


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Example
# Display the content of the file test.bat.
<Huawei> more test.bat
rsa local-key-pair create
user-interface vty 12 14
authentication-mode aaa
protocol inbound ssh
user privilege level 5
quit
ssh user sftpuser authentication-type password
sftp server enable

# Display the content of the file log.txt and set the offset to 100.
<Huawei> more log.txt 100
: CHINA HUAWEI TECHNOLOGY LIMITTED CO.,LTD
# FILE NAME: Product Adapter File(PAF)
# PURPOSE: MAKE VRPV5 SUITABLE FOR DIFFERENT PRODUCT IN LIB
# SOFTWARE PLATFORM: V6R2C00
# DETAIL VERSION: B283
# DEVELOPING GROUP: 8090 SYSTEM MAINTAIN GROUP
# HARDWARE PLATFORM: 8090 (512M Memory)
# CREATED DATE: 2003/05/10
# AUTH: RAINBOW
# Updation History: Kelvin dengqiulin update for 8090(2004.08.18)
# lmg update for R3(2006.11.7)
# fsr update for R5 (2008.1.18)
# qj update for R6 (2008.08.08)
# COPYRIGHT: 2003---2008
#----------------------------------------------------------------------------------

#BEGIN FOR RESOURCE DEFINATION


[RESOURCE]
FORMAT: SPECS RESOURCE NAME STRING = CONTROLLABLE(1 : ABLE , 0: NOT ABLE),DEFAUL
T VALUE , MAX VALUE , MIN VALUE
#BEGIN SPECS RESOURCE FOR TE tunnel Nto1 PS MODULE
PAF_LCS_TUNNEL_SPECS_TE_PS_MAX_PROTECT_NUM = 1, 8, 16, 1
PAF_LCS_TUNNEL_SPECS_TE_PS_REBOOT_TIME = 1, 180000, 3600000, 60000
---- More ----

# Display the content of the file paf.txt.


<Huawei> more paf.txt all
PAF_LCS_588_IFC_FIFO_DEPTH_ASE = 222
#IFC_FIFO_DEPTH_ASE EXPLAIN (222: NORMAL, 102: DEEP)
PAF_LCS_588_IPE_FIFO_DEPTH_TCM = 659206
#IPE_FIFO_DEPTH_TCM EXPLAIN (659206: NORMAL, 655360: DEEP)
PAF_LCS_588_IFC_FIFO_DEPTH_TCM = 222
#IFC_FIFO_DEPTH_TCM EXPLAIN (222: NORMAL, 102: DEEP)
#END OF SPECS RESOURCE FOR 588 MODULE
#BEGIN 8090 MEM GATE AND ISSU MEM GATE
PAF_LCS_8090_BOARD_RESET_MEMORY_GATE = 90
PAF_LCS_8090_512BOARD_RESET_MEMORY_GATE = 85
PAF_LCS_8090_BOARD_RESET_MEMORY_GATE_ISSU = 95
PAF_LCS_ISSU_CHECK_MEMORY_GATE = 40
#END 8090 MEM GATE AND ISSU MEM GATE
[END CONFIGURE]

3.11.42 move

Function
The move command moves the source file from a specified directory to a
destination directory.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 307


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Format
move source-filename destination-filename

Parameters
Parameter Description Settings

source-filename Specifies the directory The value is a string of 1


and name of a source to 64 case-insensitive
file. characters without
spaces in the [ drive ]
[ path ] file name
format. When quotation
marks are used around
the string, spaces are
allowed in the string.
In the preceding
parameter, drive
specifies the storage
device name, and path
specifies the directory
and subdirectory.
You are advised to add :
and / between the
storage device name and
directory. Characters ~,
*, /, \, :, ', " cannot be
used in the directory
name.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 308


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Parameter Description Settings

destination-filename Specifies the directory The value is a string of 1


and name of a to 64 case-insensitive
destination file. characters without
spaces in the [ drive ]
[ path ] file name
format. When quotation
marks are used around
the string, spaces are
allowed in the string.
In the preceding
parameter, drive
specifies the storage
device name, and path
specifies the directory
and subdirectory.
You are advised to add :
and / between the
storage device name and
directory. Characters ~,
*, /, \, :, ', " cannot be
used in the directory
name.

Views
User view

Default Level
3: Management level

Usage Guidelines
Usage Scenario

The following describes the drive name.

● drive is the storage device and is named as follows:


– sd1: root directory of the Micro SD card on the master SRU.
– flash: root directory of the flash memory on the master SRU.
– slave#sd1: root directory of the Micro SD card on the slave SRU. If the
device has no slave SRU, this drive is unavailable.
– slave#flash: root directory of the flash memory on the slave SRU. If the
device has no slave SRU, this drive is unavailable.

Only the AR3200 series supports dual SRUs.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 309


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

drive is the storage device of the router. It is named flash: on the


AR100&AR120&AR150&AR160&AR200&AR1200 series, AR2201-48FE,
AR2202-48FE, AR2204-27GE, AR2204-24GE, AR2204-27GE-P, AR2204-51GE-P,
AR2204-48GE-P, AR2204EAR2204, AR2220L-DC, AR3670 and AR2220L-AC, is
named flash: or sd1: on the AR2220E, AR2240C, is named flash: or sd1: on
the AR2240 and AR3260 using SRU40, SRU60, SRU80, and is named sd1: on
the AR2240 and AR3260 using SRU200, SRU400, SRU100E, and SRU200E.

The path can be an absolute path or relative path.


● flash:/my/test/ is an absolute path.
● selftest/ is a path relative to the current working directory and indicates the
selftest directory in the current working directory.

Precautions

● If the destination file has the same name as an existing file, the system
prompts you whether to overwrite the existing file. The system prompt is
displayed only when file prompt is set to alert.
● This command cannot be used to move files between storage devices.
● The move and copy commands have different effects:
– The move command moves the source file to the destination directory.
– The copy command copies the source file to the destination directory.

Example
# Move a file from flash:/test/sample.txt to flash:/sample.txt.
<Huawei> move flash:/test/sample.txt flash:/sample.txt
Info: Move flash:/test/sample.txt to flash:/sample.txt ?(y/n)[n]: y
Info: Moved file flash:/test/sample.txt to flash:/sample.txt.

Related Topics
3.11.10 copy

3.11.43 open

Function
The open command connects the FTP client and server.

Format
# Connect the FTP client to the FTP server based on the IPv4 address.

open [ -a source-ip-address | -i interface-type interface-number ] host-ip [ port-


number ] [ public-net | vpn-instance vpn-instance-name ]

# Connect the FTP client to the FTP server based on the IPv6 address.

open ipv6 host-ipv6 [ port-number ]

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 310


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Parameters
Parameter Description Value
-a source-ip- Specifies the source IP address for -
address connecting to the FTP client. You
are advised to use the loopback
interface IP address.

-i interface- Specifies the source interface type -


type interface- and ID. You are advised to use the
number loopback interface.
The IP address configured for this
interface is the source IP address
for sending packets. If no IP
address is configured for the
source interface, the FTP
connection cannot be set up.

host-ip Specifies the IP address or host The value is a string of 1 to


name of the remote IPv4 FTP 255 case-insensitive
server. characters without spaces.
When quotation marks are
used around the string,
spaces are allowed in the
string.

port-number Specifies the port number of the The value is an integer that
FTP server. ranges from 1 to 65535, or
21. The default value is the
standard port number 21.
public-net Specifies the FTP server on the -
public network.
You must set the public-net
parameter when the FTP server IP
address is a public network IP
address.

vpn-instance Specifies the name of the VPN The value is a string of 1 to


vpn-instance- instance where the FTP server is 31 case-sensitive characters,
name located. spaces not supported.
When double quotation
marks are used around the
string, spaces are allowed in
the string.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 311


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Parameter Description Value


host-ipv6 Specifies the IP address or host The value is a string of 1 to
name of the remote IPv6 FTP 255 case-insensitive
server. characters without spaces.
When quotation marks are
used around the string,
spaces are allowed in the
string.

Views
FTP client view

Default Level
3: Management level

Usage Guidelines
Usage Scenario

You can run the open command in the FTP client view to connect the FTP client to
the server to transmit files and manage files and directories of the FTP server.

Precautions

● You can run the ftp command in the user view to connect the FTP client and
server and enter the FTP client view.
● You can set the source IP address to the source or destination IP address in
the ACL rule when the -a or -i parameter is specified on the IPv4 network.
This shields the IP address differences and interface status impact, filters
incoming and outgoing packets, and implements security authentication.
● You can run the set net-manager vpn-instance command to configure the
NMS management VPN instance before running the open command to
connect the FTP client and server.
– If public-net or vpn-instance is not specified, the FTP client accesses the
FTP server in the VPN instance managed by the NMS.
– If public-net is specified, the FTP client accesses the FTP server on the
public network.
– If vpn-instance vpn-instance-name is specified, the FTP client accesses
the FTP server in a specified VPN instance.
● If the port number that the FTP server uses is non-standard, you must specify
a standard port number; otherwise, the FTP server and client cannot be
connected.
● When you run the open command, the system prompts you to enter the user
name and password for logging in to the FTP server. You can log in to the FTP
client and enter the FTP client view if the user name and password are
correct.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 312


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Example
# Connect the FTP client with the FTP server whose IP address is 10.137.217.204.
<Huawei> ftp
[Huawei-ftp] open 10.137.217.204
Trying 10.137.217.204 ...
Press CTRL+K to abort
Connected to 10.137.217.204.
220 FTP service ready.
User(10.137.217.204:(none)):huawei
331 Password required for huawei.
Enter password:
230 User logged in.

[Huawei-ftp]

# Connect the FTP client with the FTP server whose IP address is fc00:2001:db8::1.
<Huawei> ftp
[Huawei-ftp] open ipv6 fc00:2001:db8::1
Trying fc00:2001:db8::1 ...
Press CTRL+K to abort
Connected to fc00:2001:db8::1
220 FTP service ready.
User(fc00:2001:db8::1:(none)):huawei
331 Password required for huawei
Enter Password:
230 User logged in.

[Huawei-ftp]

Related Topics
3.11.26 ftp
3.11.16 disconnect

3.11.44 passive

Function
The passive command sets the data transmission mode to passive.

The undo passive command sets the data transmission mode to active.

By default, the data transmission mode is active.

Format
passive

undo passive

Parameters
None

Views
FTP client view

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 313


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Default Level
3: Management level

Usage Guidelines
The device supports the active and passive data transmission modes. In active
mode, the server initiates a connection request, and the client and server need to
enable and monitor a port to establish a connection. In passive mode, the client
initiates a connection request, and only the server needs to monitor the
corresponding port. This command is used together with the firewall function.
When the client is configured with the firewall function, FTP connections are
restricted between internal clients and external FTP servers if the FTP transmission
mode is active. If the FTP transmission mode is passive, FTP connections between
internal clients and external FTP servers are not restricted.

Example
# Set the data transmission mode to passive.
<Huawei> ftp 10.137.217.201
Trying 10.137.217.201 ...
Press CTRL+K to abort
Connected to 10.137.217.201.
220 FTP service ready.
User(10.137.217.201:(none)):huawei
331 Password required for huawei.
Enter password:
230 User logged in.
[Huawei-ftp] passive
Info: Succeeded in switching passive on.

3.11.45 put (FTP client view)

Function
The put command uploads a local file to the remote FTP server.

Format
put local-filename [ remote-filename ]

Parameters

Parameter Description Value


local-filename Specifies the local file name The value is a string of 1 to 64
of the FTP client. case-insensitive characters
without spaces.
remote- Specifies the name of the file The value is a string of 1 to 64
filename to be uploaded to the remote case-insensitive characters
FTP server. without spaces.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 314


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Views
FTP client view

Default Level
3: Management level

Usage Guidelines
Usage Scenario
You can run the put command to upload a local file to the remote FTP server for
further check and backup. For example, you can upload the local log file to the
FTP server for other users to check, and upload the configuration file to the FTP
server as a backup before upgrading the device.
Precautions
● If the file name is not specified on the remote FTP server, the local file name
is used.
● If the name of the uploaded file is the same as that of an existing file on the
FTP server, the system overwrites the existing file.

Example
# Upload the configuration file vrpcfg.zip to the remote FTP server as a backup,
and save it as backup.zip.
<Huawei> ftp 10.137.217.201
Trying 10.137.217.201 ...
Press CTRL+K to abort
Connected to 10.137.217.201.
220 FTP service ready.
User(10.137.217.201:(none)):huawei
331 Password required for huawei.
Enter password:
230 User logged in.
[Huawei-ftp] put vrpcfg.zip backup.zip
200 Port command successful.
150 Opening BINARY mode data connection for file transfer.
226 Transfer complete
FTP: 1098 byte(s) sent in 0.131 second(s) 8.38Kbyte(s)/sec.

Related Topics
3.11.35 get (FTP client view)

3.11.46 put (SFTP client view)


Function
The put command uploads a local file to a remote SFTP server.

Format
put local-filename [ remote-filename ]

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 315


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Parameters
Parameter Description Value
local-filename Specifies a local file The value is a case-insensitive
name on the SFTP client. character string without spaces. The
file name (including the absolute
path) contains 1 to 64 characters.
remote- Specifies the name of the The value is a case-insensitive
filename file uploaded to the character string without spaces. The
remote SFTP server. file name (including the absolute
path) contains 1 to 64 characters.

Views
SFTP client view

Default Level
3: Management level

Usage Guidelines
Usage Scenario
This command enables you to upload files from the local device to a remote SFTP
server to view the file contents or back up the files. For example, you can upload
log files of a device to an SFTP server and view the logs in the server. During an
upgrade, you can upload the configuration file of the device to the SFTP server for
backup.
Precautions
● If remote-filename is not specified, the uploaded file is saved on the remote
SFTP server with the original file name.
● If the specified remote-filename is the same as an existing file name on the
SFTP server, the uploaded file overwrites the existing file on the server.

Example
# Upload a file to the SFTP server.
<Huawei> system-view
[Huawei] sftp 10.137.217.201
Please input the username:admin
Trying 10.137.217.201 ...
Press CTRL+K to abort
Connected to 10.137.217.201 ...
Enter password:
sftp-client> put wm.cfg
local file: wm.cfg ---> Remote file: /wm.cfg
Info: Uploading file successfully ended.

Related Topics
3.11.34 get (SFTP client view)

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 316


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

3.11.47 pwd (FTP client view)

Function
The pwd command displays the FTP client's working directory on the remote FTP
server.

Format
pwd

Parameters
None

Views
FTP client view

Default Level
3: Management level

Usage Guidelines
After logging in to the FTP server, you can run the pwd command to display the
FTP client's working directory on the remote FTP server.

If the displayed working directory is incorrect, you can run the cd command to
change the FTP client's working directory on the remote FTP server.

Example
# Display the FTP client's working directory on the remote FTP server.
<Huawei> ftp 10.137.217.201
Trying 10.137.217.201 ...
Press CTRL+K to abort
Connected to 10.137.217.201.
220 FTP service ready.
User(10.137.217.201:(none)):huawei
331 Password required for huawei.
Enter password:
230 User logged in.
[Huawei-ftp] pwd
257 "/" is current directory.

Related Topics
3.11.26 ftp

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 317


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

3.11.48 pwd (SFTP client view)

Function
The pwd command displays the SFTP client's working directory on the remote FTP
server.

Format
pwd

Parameters
None

Views
SFTP client view

Default Level
3: Management level

Usage Guidelines
After logging in to the SFTP server, you can run the pwd command to display the
SFTP client's working directory on the remote SFTP server.

If the displayed working directory is incorrect, you can run the cd command to
change the SFTP client's working directory on the remote SFTP server.

Example
# Display the SFTP client's working directory on the remote SFTP server.
<Huawei> system-view
[Huawei] sftp 10.137.217.201
Please input the username:admin
Trying 10.137.217.201 ...
Press CTRL+K to abort
Connected to 10.137.217.201 ...
Enter password:
sftp-client> pwd
/
sftp-client> cd test
Current directory is:
/test
sftp-client> pwd
/test

Related Topics
3.11.5 cd (SFTP client view)

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 318


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

3.11.49 pwd (user view)

Function
The pwd command displays the current working directory.

Format
pwd

Parameters
None

Views
User view

Default Level
3: Management level

Usage Guidelines
You can run the pwd command in any directory to display the current working
directory. To change the current working directory, you can run the cd command.

Example
# Display the current working directory.
<Huawei> pwd
flash:/test

Related Topics
3.11.13 dir (user view)
3.11.6 cd (user view)

3.11.50 remotehelp

Function
The remotehelp command displays the help information about an FTP command
when the FTP client and server are connected.

Format
remotehelp [ command ]

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 319


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Parameters
Parameter Description Value
command Specifies the FTP The value is a string of 1 to 16
command. characters.

Views
FTP client view

Default Level
3: Management level

Usage Guidelines
You can run the remotehelp command to display the help information about an
FTP command.

● The help information is provided by the remote server. Different remote


servers may provide different help information for an FTP command.
● The help information can be displayed for FTP commands user, pass, cwd,
cdup, quit, port, pasv, type, retr, stor, dele, rmd, mkd, pwd, list, nlst, syst,
help, xcup, xcwd, xmkd, xpwd, and xrmd.

Example
# Display the syntax of the command cdup.
<Huawei> ftp 10.137.217.201
Trying 10.137.217.201 ...
Press CTRL+K to abort
Connected to 10.137.217.201.
220 FTP service ready.
User(10.137.217.201:(none)):huawei
331 Password required for huawei.
Enter password:
230 User logged in.
[Huawei-ftp] remotehelp
214-The following commands are recognized (* =>'s unimplemented).
USER PORT STOR MSAM* RNTO NLST MKD CDUP
PASS PASV APPE MRSQ* ABOR SITE* XMKD XCUP
ACCT TYPE MLFL* MRCP* DELE SYST RMD STOU
SMNT* STRU MAIL* ALLO* CWD STAT XRMD SIZE*
REIN MODE MSND* REST* XCWD HELP PWD MDTM*
QUIT RETR MSOM* RNFR LIST NOOP XPWD
214 Direct comments about WFTPD to [email protected].

[Huawei-ftp] remotehelp cdup


214 Syntax: CDUP <change to parent directory>.

3.11.51 remove (SFTP client view)

Function
The remove command deletes specified files from the remote SFTP server.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 320


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Format
remove remote-filename &<1-10>

Parameters
Parameter Description Value
remote- Specifies the name of the file The value is a string of 1 to 64
filename to be deleted from the remote case-insensitive characters
SFTP server. without spaces.

Views
SFTP client view

Default Level
3: Management level

Usage Guidelines
● You can configure a maximum of 10 file names in the command and separate
them using spaces and delete them at one time.
● If the file to be deleted is not in the current directory, you must specify the file
path.

Example
# Delete the file 3.txt from the server and backup1.txt from the test directory.
<Huawei> system-view
[Huawei] sftp 10.137.217.201
Please input the username:admin
Trying 10.137.217.201 ...
Press CTRL+K to abort
Connected to 10.137.217.201 ...
Enter password:
sftp-client> remove 3.txt test/backup1.txt
Warning: Make sure to remove these files? [y/n][n]:y
Info: Succeeded in removing the file /3.txt.
Info: Succeeded in removing the file /test/backup1.txt.

Related Topics
3.11.15 dir/ls (SFTP client view)

3.11.52 remove (user view)


Function
The remove command removes a storage device safely.

Format
remove drive

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 321


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Parameters
Parameter Description Value
drive Specifies the name of the storage The value can be usb0:, usb1:,
device to be removed. sd0:, or usbotg:.

Views
User view

Default Level
3: Management level

Usage Guidelines
You can run the remove command to safely remove a USB disk or an SD card
from the device to prevent files in the device from being damaged.

Example
# Remove the storage device USB0.
<Huawei> remove usb0:

Info: remove device usb0: successfully

3.11.53 rename (SFTP client view)


Function
The rename command renames a file or directory stored on the SFTP server.

Format
rename old-name new-name

Parameters
Parameter Description Value
old-name Specifies the name of a file The value is a string of 1 to 64 case-
or directory. insensitive characters without spaces.

new-name Specifies the new name of The value is a string of 1 to 64 case-


the file or directory. insensitive characters without spaces.

Views
SFTP client view

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 322


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Default Level
3: Management level

Usage Guidelines
You can run the rename command to rename a file or directory.

Example
# Rename the directory yourtest on the SFTP server.
<Huawei> system-view
[Huawei] sftp 10.137.217.201
Please input the username:admin
Trying 10.137.217.201 ...
Press CTRL+K to abort
Connected to 10.137.217.201 ...
Enter password:
sftp-client> rename test/yourtest test/test
Warning: Rename /test/yourtest to /test/test? [y/n][n]:y
Info: Succeeded in renaming file.
sftp-client> cd test
Current directory is:
/test
sftp-client> dir
drwxrwxrwx 1 noone nogroup 0 Mar 29 22:44 .
drwxrwxrwx 1 noone nogroup 0 Mar 29 22:39 ..
drwxrwxrwx 1 noone nogroup 0 Mar 24 00:04 test
-rwxrwxrwx 1 noone nogroup 5736 Mar 24 18:38 backup.txt

Related Topics
3.11.51 remove (SFTP client view)

3.11.54 rename (user view)


Function
The rename command renames a file or folder.

Format
rename old-name new-name

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 323


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Parameters
Parameter Description Settings

old-name Specifies the name of a The value is a string of 1


file or folder. to 64 case-insensitive
characters without
spaces in the [ drive ]
[ path ] filename
format.
In the preceding
parameter, drive
specifies the storage
device name, and path
specifies the directory
and subdirectory.
You are advised to add :
and / between the
storage device name and
directory. Characters ~,
*, /, \, :, ', " cannot be
used in the directory
name.

new-name Specifies the new name The value is a string of 1


of the file or directory. to 64 case-insensitive
characters without
spaces in the [ drive ]
[ path ] filename
format.
In the preceding
parameter, drive
specifies the storage
device name, and path
specifies the directory
and subdirectory.
You are advised to add :
and / between the
storage device name and
directory. Characters ~,
*, /, \, :, ', " cannot be
used in the directory
name.

Views
User view

Default Level
3: Management level

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 324


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Usage Guidelines
Usage Scenario
The following describes the drive name:
● drive is the storage device and is named as follows:
– sd1: root directory of the Micro SD card on the master SRU.
– flash: root directory of the flash memory on the master SRU.
– slave#sd1: root directory of the Micro SD card on the slave SRU. If the
device has no slave SRU, this drive is unavailable.
– slave#flash: root directory of the flash memory on the slave SRU. If the
device has no slave SRU, this drive is unavailable.

Only the AR3200 series supports dual SRUs.


drive is the storage device of the router. It is named flash: on the
AR100&AR120&AR150&AR160&AR200&AR1200 series, AR2201-48FE,
AR2202-48FE, AR2204-27GE, AR2204-24GE, AR2204-27GE-P, AR2204-51GE-P,
AR2204-48GE-P, AR2204EAR2204, AR2220L-DC, AR3670 and AR2220L-AC, is
named flash: or sd1: on the AR2220E, AR2240C, is named flash: or sd1: on
the AR2240 and AR3260 using SRU40, SRU60, SRU80, and is named sd1: on
the AR2240 and AR3260 using SRU200, SRU400, SRU100E, and SRU200E.
The path can be an absolute path or relative path.
● flash:/my/test/ is an absolute path.
● selftest/ is a path relative to the current working directory and indicates the
selftest directory in the current working directory.
Precautions
● You must rename a file or directory in its source directory.
● If the renamed file or directory has the same name as an existing file or
directory, an error message is displayed.
● If you specify old-name or new-name without specifying the file path, the file
must be saved in your current working directory.

Example
# Rename the directory mytest to yourtest in the directory flash:/test/.
<Huawei> pwd
flash:/test
<Huawei> rename mytest yourtest
Info: Rename flash:/test/mytest to flash:/test/yourtest ?(y/n)[n]:y
Info: Rename file flash:/test/mytest to flash:/test/yourtest ......Done

# Rename the file sample.txt to sample.bak.


<Huawei> rename sample.txt sample.bak
Info: Rename flash:/sample.txt to flash:/sample.bak ?(y/n)[n] :y
Info: Rename file flash:/sample.txt to flash:/sample.bak .......Done

Related Topics
3.11.49 pwd (user view)

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 325


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

3.11.55 reset recycle-bin


Function
The reset recycle-bin command permanently deletes files from the recycle bin.

Format
reset recycle-bin [ filename | devicename ]

Parameters
Parameter Description Value
filename Specifies the The value is a string of 1 to 64 case-insensitive
name of a file to characters without spaces in the [ drive ]
be deleted. [ path ] file name format. When quotation
marks are used around the string, spaces are
allowed in the string.
In the preceding parameter, drive specifies the
storage device name, and path specifies the
directory and subdirectory.
You are advised to add : and / between the
storage device name and directory. Characters ~,
*, /, \, :, ', " cannot be used in the directory
name.
The wildcard (*) character is supported.

devicename Specifies the -


storage device
name.

Views
User view

Default Level
3: Management level

Usage Guidelines
Usage Scenario
If you run the delete command without specifying the /unreserved parameter,
the file is moved to the recycle bin and still occupies the memory. To free up the
space, you can run the reset recycle-bin command to permanently delete the file
from the recycle bin.
The following describes the drive name.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 326


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

● drive is the storage device and is named as follows:


– sd1: root directory of the Micro SD card on the master SRU.
– flash: root directory of the flash memory on the master SRU.
– slave#sd1: root directory of the Micro SD card on the slave SRU. If the
device has no slave SRU, this drive is unavailable.
– slave#flash: root directory of the flash memory on the slave SRU. If the
device has no slave SRU, this drive is unavailable.

Only the AR3200 series supports dual SRUs.


drive is the storage device of the router. It is named flash: on the
AR100&AR120&AR150&AR160&AR200&AR1200 series, AR2201-48FE,
AR2202-48FE, AR2204-27GE, AR2204-24GE, AR2204-27GE-P, AR2204-51GE-P,
AR2204-48GE-P, AR2204EAR2204, AR2220L-DC, AR3670 and AR2220L-AC, is
named flash: or sd1: on the AR2220E, AR2240C, is named flash: or sd1: on
the AR2240 and AR3260 using SRU40, SRU60, SRU80, and is named sd1: on
the AR2240 and AR3260 using SRU200, SRU400, SRU100E, and SRU200E.
The path can be an absolute path or relative path.
● flash:/my/test/ is an absolute path.
● selftest/ is a path relative to the current working directory and indicates the
selftest directory in the current working directory.
Like devicename, drive specifies the storage device name.
Precautions
● You can run the dir /all command to display all files that are moved to the
recycle bin from the current directory, and file names are displayed in square
brackets ([ ]).
● If you delete a specified storage device, all files in the root directory of the
storage device are deleted.
● If you run the reset recycle-bin command directly, all files that are moved to
the recycle bin from the current directory are permanently deleted.

Example
# Delete the file test.txt that is moved to the recycle bin from the directory test.
<Huawei> reset recycle-bin flash:/test/test.txt
Info: Squeeze flash:/test/test.txt?(y/n)[n]:y
Info: Cleared file flash:/test/test.txt.

# Delete files that are moved to the recycle bin from the current directory.
<Huawei> pwd
flash:/test
<Huawei> reset recycle-bin
Info: Squeeze flash:/test/backup.zip?(y/n)[n]:y
Info: Cleared file flash:/test/backup.zip.
Info: Squeeze flash:/test/backup1.zip?(y/n)[n]:y
Info: Cleared file flash:/test/backup1.zip.

Related Topics
3.11.12 delete (user view)

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 327


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

3.11.13 dir (user view)

3.11.56 rmdir (FTP client view)


Function
The rmdir command deletes a specified directory from the remote FTP server.

Format
rmdir remote-directory

Parameters
Parameter Description Value
remote- Specifies a directory or The value is a string of 1 to 64
directory path on the FTP server. case-insensitive characters
without spaces.

Views
FTP client view

Default Level
3: Management level

Usage Guidelines
Usage Scenario
You can run the rmdir command to delete a specified directory from the remote
FTP server.
Precautions
● Before running the rmdir command to delete a directory, you must delete all
files and subdirectories from the directory.
● If no path is specified when you delete a subdirectory, the subdirectory is
deleted from the current directory.
● The directory is deleted from the FTP server rather than the FTP client.

Example
# Delete the directory d:/temp1 from the remote FTP server.
<Huawei> ftp 10.137.217.201
Trying 10.137.217.201 ...
Press CTRL+K to abort
Connected to 10.137.217.201.
220 FTP service ready.
User(10.137.217.201:(none)):huawei
331 Password required for huawei.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 328


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Enter password:
230 User logged in.
[Huawei-ftp] rmdir d:/temp1
250 'D:\temp1': directory removed.

Related Topics
3.11.14 dir/ls (FTP client view)
3.11.38 mkdir (FTP client view)

3.11.57 rmdir (user view)


Function
The rmdir command deletes a specified directory from the storage device.

Format
rmdir directory

Parameters
Parameter Description Value
directory Specifies a The value is a string of case-insensitive characters
directory or in the [ drive ] [ path ] directory format. The
directory and its absolute path length ranges from 1 to 64, while
path. the directory name length ranges from 1 to 15.
In the preceding parameter, drive specifies the
storage device name, and path specifies the
directory and subdirectory.
Characters such as ~, *, /, \, :, ', " cannot be used
in the directory name.

Views
User view

Default Level
3: Management level

Usage Guidelines
Usage Scenario
The following describes the drive name.
● drive is the storage device and is named as follows:
– sd1: root directory of the Micro SD card on the master SRU.
– flash: root directory of the flash memory on the master SRU.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 329


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

– slave#sd1: root directory of the Micro SD card on the slave SRU. If the
device has no slave SRU, this drive is unavailable.
– slave#flash: root directory of the flash memory on the slave SRU. If the
device has no slave SRU, this drive is unavailable.

Only the AR3200 series supports dual SRUs.


drive is the storage device of the router. It is named flash: on the
AR100&AR120&AR150&AR160&AR200&AR1200 series, AR2201-48FE,
AR2202-48FE, AR2204-27GE, AR2204-24GE, AR2204-27GE-P, AR2204-51GE-P,
AR2204-48GE-P, AR2204EAR2204, AR2220L-DC, AR3670 and AR2220L-AC, is
named flash: or sd1: on the AR2220E, AR2240C, is named flash: or sd1: on
the AR2240 and AR3260 using SRU40, SRU60, SRU80, and is named sd1: on
the AR2240 and AR3260 using SRU200, SRU400, SRU100E, and SRU200E.
The path can be an absolute path or relative path.
● flash:/my/test/ is an absolute path.
● selftest/ is a path relative to the current working directory and indicates the
selftest directory in the current working directory.
Precautions
● Before running the rmdir command to delete a directory, you must delete all
files and subdirectories from the directory.
● A deleted directory and its files cannot be restored from the recycle bin.

Example
# Delete the directory test from the current directory.
<Huawei> rmdir test
Remove directory flash:/test?(y/n)[n]:y
Info: Removing directory flash:/test....Done!

Related Topics
3.11.40 mkdir (User view)

3.11.58 rmdir (SFTP client view)


Function
The rmdir command deletes a specified directory from the remote SFTP server.

Format
rmdir remote-directory &<1-10>

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 330


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Parameters
Parameter Description Value
remote- Specifies the name of a file The value is a string of 1 to 64
directory on the SFTP server. case-insensitive characters
without spaces.

Views
SFTP client view

Default Level
3: Management level

Usage Guidelines
● You can configure a maximum of 10 file names in the command and separate
them using spaces and delete them at one time.
● Before running the rmdir command to delete a directory, you must delete all
files and subdirectories from the directory.
● If the directory to be deleted is not in the current directory, you must specify
the file path.

Example
# Delete the directory 1 from the current directory, and the directory 2 from the
test directory.
<Huawei> system-view
[Huawei] sftp 10.137.217.201
Please input the username:admin
Trying 10.137.217.201 ...
Press CTRL+K to abort
Connected to 10.137.217.201 ...
Enter password:
sftp-client> rmdir 1 test/2
Warning: Make sure to remove these directories? [Y/N]:y
Info: Succeeded in removing the directory /test/1.
Info: Succeeded in removing the directory /test/test/2.

Related Topics
3.11.51 remove (SFTP client view)

3.11.59 set default ftp-directory


Function
The set default ftp-directory command configures the default FTP working
directory.

The undo set default ftp-directory command disables the default FTP working
directory.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 331


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

By default, no default FTP working directory is configured.

Format
set default ftp-directory directory

undo set default ftp-directory

Parameters

Parameter Description Value


directory Specify the default FTP The value is a string of 1 to 64 case-
working directory. insensitive characters without spaces.

Views
System view

Default Level
3: Management level

Usage Guidelines
Usage Scenario

You can run the set default ftp-directory command to configure a default FTP
working directory for all FTP users at one time.

Precautions

● The set default ftp-directory command takes effect only when the device
functions as an FTP server and the user function as an FTP client.
● You can run the local-user ftp-directory command to configure an
authorized working directory for a local user.
● If you have configured the FTP working directory by running the local-user
ftp-directory command, you must use this FTP working directory.
● You can run the lcd command to view the working directory of FTP users.
● If no FTP working directory is specified on the device, FTP users cannot log in
to the device.

Example
# Set the default FTP working directory to flash:/.
<Huawei> system-view
[Huawei] set default ftp-directory flash:/

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 332


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

3.11.60 set default tftp-directory

Function
The set default tftp-directory command configures a working directory for the
TFTP server.

The undo set default tftp-directory command deletes the working directory of
the TFTP server.

By default, no working directory is configured for the TFTP server.

Format
set default tftp-directory directory

undo set default tftp-directory

Parameters

Parameter Description Value


directory Specifies the working The value is a string of 1 to 64 case-
directory for the TFTP server. insensitive characters without spaces.

Views
System view

Default Level
3: Management level

Usage Guidelines
You need to configure a working directory for the TFTP server on the device. After
that, TFTP clients can obtain files from the specified working directory.

Example
# Set the working directory of the TFTP server to flash:.
<Huawei> system-view
[Huawei] set default tftp-directory flash:

Related Topics
3.11.68 tftp server enable

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 333


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

3.11.61 set net-manager vpn-instance


Function
The set net-manager vpn-instance command configures the default VPN
instance that the NMS uses on the device.
The undo set net-manager vpn-instance command deletes the default VPN
instance from the device.
By default, no VPN instance is configured on the device.

Format
set net-manager vpn-instance vpn-instance-name
undo set net-manager vpn-instance

Parameters
Parameter Description Value
vpn-instance- Specifies the name of The value is a string of 1 to 31 case-
name the default VPN sensitive characters, spaces not
instance. supported. When double quotation
marks are used around the string, spaces
are allowed in the string.

Views
System view

Default Level
3: Management level

Usage Guidelines
Usage Scenario
If the NMS manages devices on the VPN network, you need to send the device
information to the NMS using the VPN instance.
You can run the set net-manager vpn-instance command to configure the
default VPN instance for the NMS to manage the device so that the device can
use this VPN instance to communicate with the NMS.
Precautions
● Before running the set net-manager vpn-instance command, you must
create VPN instances.
● After running this command, you can successfully run file transfer commands
that you have configured based on the FTP, SFTP commands only in the
default VPN instance.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 334


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

● If the host has been configured as a log host, the NMS can receive device logs
from the default VPN instance.

Example
# Set the default VPN instance to v1.
<Huawei> system-view
[Huawei] set net-manager vpn-instance v1

Related Topics
3.11.26 ftp

3.11.62 sftp

Function
The sftp command connects the device to the SSH server so that you can manage
files that are stored on the SFTP server.

Format
# Connect the SFTP client to the SFTP server based on IPv4.

sftp [ -a source-address | -i interface-type interface-number ] host-ip [ port ]


[ [ public-net | -vpn-instance vpn-instance-name ] | [ identity-key { rsa | ecc } ] |
[ user-identity-key { rsa | ecc } ] | [ prefer_kex { dh_group1 |
dh_exchange_group } ] | [ prefer_ctos_cipher { 3des | aes128 | aes128-ctr |
aes192-ctr | aes256-ctr } ] | [ prefer_stoc_cipher { 3des | aes128 | aes128-ctr |
aes192-ctr | aes256-ctr } ] | [ prefer_ctos_hmac { sha1 | sha1_96 | md5 |
md5_96 | sha2_256 | sha2_256_96 } ] | [ prefer_stoc_hmac { sha1 | sha1_96 |
md5 | md5_96 | sha2_256 | sha2_256_96 } ] ] * [ -ki aliveinterval [ -kc
alivecountmax ] ]
# Connect the SFTP client to the SFTP server based on IPv6.

sftp ipv6 [ -a source-address ] host-ipv6 [ -oi interface-type interface-number ]


[ port ] [ [ -vpn6-instance vpn-instance-name ] | [ identity-key { rsa | ecc } ] |
[ user-identity-key { rsa | ecc } ] | [ prefer_kex { dh_group1 |
dh_exchange_group } ] | [ prefer_ctos_cipher { 3des | aes128 | aes128-ctr |
aes192-ctr | aes256-ctr } ] | [ prefer_stoc_cipher { 3des | aes128 | aes128-ctr |
aes192-ctr | aes256-ctr } ] | [ prefer_ctos_hmac { sha1 | sha1_96 | md5 |
md5_96 | sha2_256 | sha2_256_96 } ] | [ prefer_stoc_hmac { sha1 | sha1_96 |
md5 | md5_96 | sha2_256 | sha2_256_96 } ] ] * [ -ki aliveinterval [ -kc
alivecountmax ] ]

Parameters
Parameter Description Value
ipv6 Specifies an IPv6 address. -

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 335


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Parameter Description Value


-a source-address Specifies the source IP address -
for connecting to the SFTP
client. You are advised to use
the loopback interface IP
address.
-i interface-type Specifies the source interface -
interface-number type and ID. You are advised to
use the loopback interface.
The IP address configured for
this interface is the source IP
address for sending packets. If
no IP address is configured for
the source interface, the SFTP
connection cannot be set up.

host-ip Specifies the IP address or host The value is a string of 1


name of the remote IPv4 SFTP to 255 case-insensitive
server. characters without
spaces. When quotation
marks are used around
the string, spaces are
allowed in the string.

host-ipv6 Specifies the IPv6 address or The value is a string of 1


host name of the remote IPv6 to 255 case-insensitive
SFTP server. characters without
spaces. When quotation
marks are used around
the string, spaces are
allowed in the string.
-oi interface-type Specifies an outbound -
interface-number interface on the local device.
If the remote host uses an IPv6
address, you must specify the
outbound interface on the
local device.

port Specifies the port number of The value is an integer


the SSH server. that ranges from ranges
from 1 to 65535. The
default port number is
22.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 336


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Parameter Description Value


public-net Specifies the SFTP server on -
the public network.
You must set the public-net
parameter when the SFTP
server IP address is a public
network IP address.

-vpn-instance vpn- Name of the VPN instance The value is a string of 1


instance-name where the IPv4 SFTP server is to 31 case-sensitive
located. characters, spaces not
supported. When double
quotation marks are used
around the string, spaces
are allowed in the string.
-vpn6-instance vpn- Name of the VPN instance The value is a string of 1
instance-name where the IPv6 SFTP server is to 31 case-sensitive
located. characters, spaces not
supported. When double
quotation marks are used
around the string, spaces
are allowed in the string.
identity-key Specifies the public key for The public key algorithm
server authentication. include RSA and ECC.
user-identity-key Specifies the public key The public key algorithm
algorithm for the client include RSA and ECC.
authentication. NOTE
If the user-identity-key
parameter is not used, RSA
authentication is used by
default. You can specify
ECC authentication using
the user-identity-key
parameter.

prefer_kex Specifies the preferred key The default key exchange


exchange algorithm. The algorithm is dh_group1.
dh_group1 and
dh_exchange_group algorithms
are supported currently.

prefer_ctos_cipher Specify an encryption Encryption algorithms


algorithm for transmitting 3des, aes128, aes128-
data from the client to the ctr, aes192-ctr, and
server. aes256-ctr are supported
currently.
The default encryption
algorithm is aes128.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 337


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Parameter Description Value


prefer_stoc_cipher Specify an encryption Encryption algorithms
algorithm for transmitting 3des, aes128, aes128-
data from the server to the ctr, aes192-ctr, and
client. aes256-ctr are supported
currently.
The default encryption
algorithm is aes128.

prefer_ctos_hmac Specify an HMAC algorithm HMAC algorithms sha1,


for transmitting data from the sha1_96, md5, sha2_256,
client to the server. sha2_256_96, and
md5_96 are supported.
The default HMAC
algorithm is sha1_96.

prefer_stoc_hmac Specify an HMAC algorithm HMAC algorithms sha1,


for transmitting data from the sha1_96, md5, sha2_256,
server to the client. sha2_256_96, and
md5_96 are supported.
The default HMAC
algorithm is sha1_96.

-ki aliveinterval Specifies the interval for The value is an integer


sending keepalive packets that ranges from 1 to
when no packet is received in 3600, in seconds.
reply.
-kc alivecountmax Specifies the times for sending The value is an integer
keepalive packets when no that ranges from 3 to 10.
packet is received in reply. The default value is 5.

Views
System view

Default Level
3: Management level

Usage Guidelines
Usage Scenario
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 device that functions as
an SFTP client.
When the connection between the SFTP server and client fails, the SFTP client
must detect the fault in time and disconnect from the SFTP server. To ensure this,

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 338


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

before being connected to the server in SFTP mode, the client must be configured
with the interval and times for sending the keepalive packet when no packet is
received in reply. If the client receives no packet in reply within the specified
interval, the client sends the keepalive packet to the server again. If the maximum
number of times that the client sends keepalive packets exceeds the specified
value, the client releases the connection. By default, when no packet is received,
the function for sending keepalive packets is not enabled.

Precautions

● You can set the source IP address to the source or destination IP address in
the ACL rule when the -a or -i parameter is specified. This shields the IP
address differences and interface status impact, filters incoming and outgoing
packets, and implements security authentication.
● The SSH client can log in to the SSH server with no port number specified
only when the port number of the SSH server is 22. If the SSH server uses
another port, the port number must be specified when SSH clients log in to
the SSH server.
● You can run the set net-manager vpn-instance command to configure the
NMS management VPN instance before running the open command to
connect the FTP client and server.
– If public-net or vpn-instance is not specified, the FTP client accesses the
FTP server in the VPN instance managed by the NMS.
– If public-net is specified, the FTP client accesses the FTP server on the
public network.
– If vpn-instance vpn-instance-name is specified, the FTP client accesses
the FTP server in a specified VPN instance.
● If you cannot run the sftp command successfully when you configured the
ACL on the SFTP client, or when the TCP connection fails, an error message is
displayed indicating that the SFTP client cannot be connected to the server.
● 3DES, MD5, MD5_96, SHA1, and SHA1_96 encryption algorithm cannot
ensure security. AES128, AES128-CTR, AES192-CTR sha2_256, sha2_256_96 or
AES256-CTR encryption algorithm is recommended.

Example
# Set the current listening port number of the SSH server to 1025, and specify the
SFTP client on the public network and the SSH server on the private network.
<Huawei> system-view
[Huawei] sftp 10.164.39.223 1025 -vpn-instance ssh
Please input the username: client001
Trying 10.164.39.223 ...
Press CTRL+K to abort
Enter password:
sftp-client>

# Set keepalive parameters when the client is connected to the server in SFTP
mode.
<Huawei> system-view
[Huawei] sftp 10.164.39.223 -ki 10 -kc 4
Please input the username: client001
Trying 10.164.39.223 ...
Press CTRL+K to abort

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 339


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Enter password:
sftp-client>

Related Topics
3.11.64 sftp server enable
3.9.37 ssh server port

3.11.63 sftp client-source

Function
The sftp client-source command specifies the source IP address for the SFTP
client to send packets.

The undo sftp client-source command restores the default source IP address for
the SFTP client to send packets.

The default source IP address for the SFTP client to send packets is 0.0.0.0.

Format
sftp client-source { -a source-ip-address | -i interface-type interface-number }

undo sftp client-source

Parameters

Parameter Description Value


-a source-ip- The value is
Specifies the source IP address. You are
address in dotted
advised to use the loopback interface IP
decimal
address.
notation.
-i interface-type Specifies the source interface. You are -
interface-number advised to use the loopback interface.
The IP address configured for the source
interface is the source IP address for sending
packets. If no IP address is configured for the
source interface, the FTP connection cannot
be set up.

Views
System view

Default Level
3: Management level

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 340


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Usage Guidelines
Usage Scenario
If no source IP address is specified, the client uses the source IP address that the
router specifies to send packets. The source IP address must be configured for an
interface with stable performance. The loopback interface is recommended. Using
the loopback interface as the source interface simplifies the ACL rule and security
policy configuration. This shields the IP address differences and interface status
impact, filters incoming and outgoing packets, and implements security
authentication.
Precautions
● You can query the source IP address or primary IP address of the source
interface for the SFTP connection on the SFTP server.
● The sftp command also configures the source IP address whose priority is
higher than that of the source IP address specified in the sftp client-source
command. If you specify source addresses in the sftp client-source and sftp
commands, the source IP address specified in the sftp command is used for
data communication. The source address specified in the sftp client-source
command applies to all SFTP connections. The source address specified in the
sftp command applies only to the current SFTP connection.
● If the specified source interface has been bound to a VPN instance, the client
is automatically bound to the same VPN instance.

Example
# Set the source IP address of the SFTP client to 10.1.1.1.
<Huawei> system-view
[Huawei] sftp client-source -a 10.1.1.1
Info: Succeeded in setting the source address of the SFTP client to 10.1.1.1.

Related Topics
3.11.62 sftp
3.11.20 display sftp-client

3.11.64 sftp server enable


Function
The sftp server enable command enables the SFTP service on the SSH server.
The undo sftp server enable command disables the SFTP service on the SSH
server.
By default, the SFTP service is disabled.

Format
sftp server enable
undo sftp server enable

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 341


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Parameters
None

Views
System view

Default Level
3: Management level

Usage Guidelines
To connect the client to the SSH server to transfer files in SFTP mode, you must
first enable the SFTP server on the SSH server.

Example
# Enable the SFTP service.
<Huawei> system-view
[Huawei] sftp server enable
Info: Succeeded in starting the SFTP server.

# Disable the SFTP service.


<Huawei> system-view
[Huawei] undo sftp server enable
Info: Succeeded in closing the SFTP server.

Related Topics
3.11.62 sftp

3.11.65 tftp
Function
The tftp command uploads a file to the TFTP server or downloads a file to the
local device.

Format
# Upload a file to the TFTP server or download a file to the local device based on
the IPv4 address
tftp [ -a source-ip-address | -i interface-type interface-number ] tftp-server
[ public-net | vpn-instance vpn-instance-name ] { get | put } source-filename
[ destination-filename ]
# Upload a file to the TFTP server or download a file to the local device based on
the IPv6 address
tftp ipv6 [ -a source-ip-address ] tftp-server-ipv6 [ -oi interface-type interface-
number ] [ vpn6-instance vpn6-instance-name ] { get | put } source-filename
[ destination-filename ]

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 342


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Parameters
Parameter Description Value
-a source-ip- Specifies the source IP -
address address for connecting to the
TFTP client. You are advised
to use the loopback interface
IP address.
-i interface-type Specifies the source interface -
interface- used by the TFTP client to set
number up connections. It consists of
the interface type and
number. It is recommended
that you specify a loopback
interface.
The IP address configured for
this interface is the source IP
address for sending packets.
If no IP address is configured
for the source interface, the
TFTP connection cannot be
set up.

-oi interface- Specifies an outbound If the remote host uses an IPv6


type interface- interface on the local device. address, you must specify the
number outbound interface on the local
device.
tftp-server Specifies the IPv4 address or The value is a string of 1 to 255
host name for the TFTP case-insensitive characters
server. without spaces.

tftp-server-ipv6 Specifies the IPv6 address of The value is a string of 1 to 255


the IPv6 TFTP server. case-insensitive characters
without spaces.

public-net Specifies the TFTP server on -


the public network.
vpn-instance Name of the VPN instance The value is a string of 1 to 31
vpn-instance- where the IPv4 TFTP server is case-sensitive characters, spaces
name located. not supported. When double
quotation marks are used
around the string, spaces are
allowed in the string.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 343


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Parameter Description Value


vpn6-instance Name of the VPN instance The value is a string of 1 to 31
vpn6-instance- where the IPv6 TFTP server is case-sensitive characters, spaces
name located. not supported. When double
quotation marks are used
around the string, spaces are
allowed in the string.
get Download a file. -
put Upload a file. -
source-filename Specifies the source file The value is a string of 1 to 64
name. case-insensitive characters
without spaces.
destination- Specifies the directory and The value is a string of 1 to 64
filename name of a destination file. case-insensitive characters
without spaces in the [ drive ]
[ path ] file name format.
When quotation marks are used
around the string, spaces are
allowed in the string.
In the preceding parameter,
drive specifies the storage
device name, and path specifies
the directory and subdirectory.
You are advised to add : and /
between the storage device
name and directory. Characters
~, *, /, \, :, ', " cannot be used in
the directory name.

Views
User view

Default Level
3: Management level

Usage Guidelines
Usage Scenario

When upgrading the system, you can run the tftp command to upload an
important file to the TFTP server or download a system software to the local
device.

Precautions

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 344


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

● When you run the tftp command to upload a file to the TFTP server in TFTP
mode, files are transferred in binary mode by default. The tftp does not
support the ASCII mode for file transfer.
● After specifying a source IP address, you can use this IP address to
communicate with the server and implement packet filtering to ensure data
security.
● You can run the set net-manager vpn-instance command to configure the
NMS management VPN instance before running the open command to
connect the FTP client and server.
– If public-net or vpn-instance is not specified, the FTP client accesses the
FTP server in the VPN instance managed by the NMS.
– If public-net is specified, the FTP client accesses the FTP server on the
public network.
– If vpn-instance vpn-instance-name is specified, the FTP client accesses
the FTP server in a specified VPN instance.

Example
# Download file vrpcfg.txt from the root directory of the TFTP server to the local
device. The IP address of the TFTP server is 10.1.1.1. Save the downloaded file to
the local device as file vrpcfg.bak.
<Huawei> tftp 10.1.1.1 get vrpcfg.txt flash:/vrpcfg.bak

# Upload file vrpcfg.txt from the root directory of the storage device to the
default directory of the TFTP server. The IP address of the TFTP server is 10.1.1.1.
Save file vrpcfg.txt on the TFTP server as file vrpcfg.bak.
<Huawei> tftp 10.1.1.1 put flash:/vrpcfg.txt vrpcfg.bak

# Obtain the link local IP address and interface name from the TFTP server.
<Huawei> tftp ipv6 fc00::1 -oi gigabitethernet 1/0/0 get file1 file2

Related Topics
3.11.67 tftp-server acl

3.11.66 tftp client-source


Function
The tftp client-source command specifies the source IP address for the TFTP
client to send packets.
The undo tftp client-source command restores the default source IP address for
the TFTP client to send packets.
The default source IP address for the TFTP client to send packets is 0.0.0.0.

Format
tftp client-source { -a source-ip-address | -i interface-type interface-number }
undo tftp client-source

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 345


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Parameters

Parameter Description Value


-a source-ip- The value is
Specifies the source IP address of the TFTP
address in dotted
client. You are advised to use the loopback
decimal
interface IP address.
notation.
-i interface-type Source interface type and ID. You are advised -
interface-number to use the loopback interface.
The IP address configured for this interface is
the source IP address for sending packets. If
no IP address is configured for the source
interface, the TFTP connection cannot be set
up.

Views
System view

Default Level
3: Management level

Usage Guidelines
Usage Scenario

If no source IP address is specified, the client uses the source IP address that the
router specifies to send packets. The source IP address must be configured for an
interface with stable performance. The loopback interface is recommended. Using
the loopback interface as the source interface simplifies the ACL rule and security
policy configuration. This shields the IP address differences and interface status
impact, filters incoming and outgoing packets, and implements security
authentication.

Precautions

● The tftp command also configures the source IP address whose priority is
higher than that of the source IP address specified in the tftp client-source
command. If you specify source addresses in the tftp client-source and tftp
commands, the source IP address specified in the tftp command is used for
data communication. The source address specified in the tftp client-source
command applies to all TFTP connections. The source address specified in the
tftp command applies only to the current TFTP connection.
● You can query the source IP address or source interface IP address specified in
the TFTP connection on the TFTP server.
● If the specified source interface has been bound to a VPN instance, the client
is automatically bound to the same VPN instance.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 346


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Example
# Set the source IP address of the TFTP client to 10.1.1.1.
<Huawei> system-view
[Huawei] tftp client-source -a 10.1.1.1
Info: Succeeded in setting the source address of the TFTP client to 10.1.1.1.

Related Topics
3.11.65 tftp
3.11.21 display tftp-client

3.11.67 tftp-server acl

Function
The tftp-server acl command specifies the ACL number for the local device so
that the device can access TFTP servers with the same ACL number.

The undo tftp-server acl command deletes the ACL number from the local device.

By default, no ACL number is specified on the local client.

Format
tftp-server acl acl-number

undo tftp-server acl

Parameters
Parameter Description Value
acl-number Specifies the number of the The value is an integer that ranges
basic ACL. from 2000 to 2999.

Views
System view

Default Level
3: Management level

Usage Guidelines
Usage Scenario

To ensure the security of the local device, you need to run the tftp-server acl
command to specify an ACL to specify TFTP servers that the local device can
access.

Precautions

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 347


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

● The tftp-server acl command takes effect only after you run the rule
command to configure the ACL rule. If no ACL rule is configured, the local
device can access a specified TFTP server in TFTP mode.
● The TFTP supports only the basic ACL whose number ranges from 2000 to
2999.

Example
# Allow the local device to the access the TFTP server whose ACL number is 2000.
<Huawei> system-view
[Huawei] acl 2000
[Huawei-acl-basic-2000] rule permit source 10.10.10.1 0
[Huawei-acl-basic-2000] quit
[Huawei] tftp-server acl 2000

Related Topics
3.11.65 tftp

3.11.68 tftp server enable


Function
The tftp server enable command enables the TFTP server function on the device.
The undo tftp server enable command disables the TFTP server function on the
device.
By default, the TFTP server function is disabled.

Format
tftp server enable
undo tftp server enable

Parameters
None

Views
System view

Default Level
3: Management level

Usage Guidelines
Usage Scenario
To allow a local client to remotely manage files on the device using TFTP, you
must run this command to enable the TFTP server function on the device.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 348


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

The TFTP protocol has security risks; therefore, SFTPv2 is recommended for file
management.

Prerequisite

The TFTP working directory has been configured by running the set default tftp-
directory directory command.

Example
# Enable the TFTP server function.
<Huawei> system-view
[Huawei] set default tftp-directory flash:
[Huawei] tftp server enable

Related Topics
3.11.60 set default tftp-directory

3.11.69 tftp server port

Function
The tftp server port command configures the port number of the TFTP server.

The undo tftp server port command restores the default port number of the TFTP
server.

By default, the port number of the TFTP server is 69.

Format
tftp server port port-number

undo tftp server port

Parameters
Parameter Description Value
port-number Specifies the port number The value is an integer that ranges
of the TFTP server. from 69 or 1025 to 55535. The
default value is 69.

Views
System view

Default Level
3: Management level

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 349


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Usage Guidelines
Usage Scenario

By default, the port number of the TFTP server is 69. Users can directly log in to
the device using the default port number. Attackers may access the default port,
consuming bandwidth, deteriorating server performance, and causing authorized
users unable to access the server. You can run this command to configure another
port number for the TFTP server. This can prevent attacks to the TFTP server
because attackers cannot obtain the newly configured port number.

Prerequisite

The TFTP service has been disabled by running the undo tftp server enable
command.

Precautions

● When the port number of the TFTP server is 69, a TFTP client can connect to
the TFTP server without the need to specify a port number. When the port
number of the TFTP server is not 69, you need to specify a port number for
the TFTP client before it can connect to the TFTP server, and the specified
client port number must be the same as the server port number.
● After running this command to configure a new port number, you must run
the tftp server enable command to enable the TFTP server before the
modified port number takes effect.

Example
# Set the port number of the TFTP server to 1028.
<Huawei> system-view
[Huawei] tftp server port 1028

Related Topics
3.11.68 tftp server enable

3.11.70 tftp server timeout

Function
The tftp server timeout command configures a packet timeout period for a TFTP
server.

The undo tftp server timeout command restores the default packet timeout
period for a TFTP server.

By default, the packet timeout period of a TFTP server is 5 seconds.

Format
tftp server timeout timeout-second

undo tftp server timeout

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 350


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Parameters
Parameter Description Value
timeout-second Specifies the packet The value an integer that ranges
timeout period of a TFTP from 1 to 300, in seconds. The
server. default value is 5s.

Views
System view

Default Level
3: Management level

Usage Guidelines
If the server does not receive any response within 5 seconds after sending a packet
to a client, it considers that the packet times out. The TFTP server will resend a
packet twice. If the packet times out three times, the TFTP server disconnects the
TFTP connection.

Example
# Set the packet timeout period of a TFTP server to 10s.
<Huawei> system-view
[Huawei] tftp server timeout 10

Related Topics
3.11.68 tftp server enable

3.11.71 undelete
Function
The undelete command restores a file that has been has been temporally deleted
and moved to the recycle bin.

Format
undelete { filename | devicename }

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 351


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Parameters
Parameter Description Value
filename Specifies the The value is a string of 1 to 64 case-insensitive
name of a file to characters without spaces in the [ drive ]
be restored. [ path ] file name format. When quotation
marks are used around the string, spaces are
allowed in the string.
In the preceding parameter, drive specifies the
storage device name, and path specifies the
directory and subdirectory.
You are advised to add : and / between the
storage device name and directory. Characters
~, *, /, \, :, ', " cannot be used in the directory
name.

devicename Specifies the -


storage device
name.

Views
User view

Default Level
3: Management level

Usage Guidelines
Usage Scenario

You can run the undelete command to restore a file that has been temporally
deleted and moved to the recycle bin. However, files that are permanently deleted
by running the delete or reset recycle-bin command with the /unreserved
parameter cannot be restored.

The following describes the drive name.

● drive is the storage device and is named as follows:


– sd1: root directory of the Micro SD card on the master SRU.
– flash: root directory of the flash memory on the master SRU.
– slave#sd1: root directory of the Micro SD card on the slave SRU. If the
device has no slave SRU, this drive is unavailable.
– slave#flash: root directory of the flash memory on the slave SRU. If the
device has no slave SRU, this drive is unavailable.

Only the AR3200 series supports dual SRUs.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 352


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

drive is the storage device of the router. It is named flash: on the


AR100&AR120&AR150&AR160&AR200&AR1200 series, AR2201-48FE,
AR2202-48FE, AR2204-27GE, AR2204-24GE, AR2204-27GE-P, AR2204-51GE-P,
AR2204-48GE-P, AR2204EAR2204, AR2220L-DC, AR3670 and AR2220L-AC, is
named flash: or sd1: on the AR2220E, AR2240C, is named flash: or sd1: on
the AR2240 and AR3260 using SRU40, SRU60, SRU80, and is named sd1: on
the AR2240 and AR3260 using SRU200, SRU400, SRU100E, and SRU200E.
The path can be an absolute path or relative path.
● flash:/my/test/ is an absolute path.
● selftest/ is a path relative to the current working directory and indicates the
selftest directory in the current working directory.
Like devicename, drive specifies the storage device name.
Precautions
● To display information about a temporally deleted file, run the dir /all
command. The file name is displayed in square brackets ([ ]).
● If the name of a file is the same as an existing directory, the file cannot be
restored. If the destination file has the same name as an existing file, the
system prompts you whether to overwrite the existing file. The system prompt
is displayed only when file prompt is set to alert.

Example
# Restore file sample.bak from the recycle bin.
<Huawei> undelete sample.bak
Info: Undelete flash:/sample.bak ?(y/n)[n]:y
Info: Undeleted file flash:/sample.bak.

# Restore a file that has been moved from the root directory to the recycle bin.
<Huawei> undelete flash:
Info: Undelete flash:/test.txt?(y/n)[n]:y
Info: Undeleted file flash:/test.txt.
Info: Undelete flash:/rr.bak?(y/n)[n]:y
Info: Undeleted file flash:/rr.bak.

Related Topics
3.11.12 delete (user view)
3.11.13 dir (user view)
3.11.24 file prompt
3.11.55 reset recycle-bin

3.11.72 unzip
Function
The unzip command decompresses a file.

Format
unzip source-filename destination-filename

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 353


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Parameters
Parameter Description Value
source- Specifies the name The value is a string of 1 to 64 case-
filename of a source file to insensitive characters without spaces in the
be decompressed. [ drive ] [ path ] file name format. When
quotation marks are used around the string,
spaces are allowed in the string.
In the preceding parameter, drive specifies
the storage device name, and path specifies
the directory and subdirectory.
You are advised to add : and / between the
storage device name and directory. Characters
~, *, /, \, :, ', " cannot be used in the directory
name.

destination- Specifies the name The value is a string of 1 to 64 case-


filename of a destination insensitive characters without spaces in the
file that is [ drive ] [ path ] file name format. When
decompressed. quotation marks are used around the string,
spaces are allowed in the string.
In the preceding parameter, drive specifies
the storage device name, and path specifies
the directory and subdirectory.
You are advised to add : and / between the
storage device name and directory. Characters
~, *, /, \, :, ', " cannot be used in the directory
name.

Views
User view

Default Level
3: Management level

Usage Guidelines
Usage Scenario

You can decompress files, especially log files that are stored on the storage device
and run the more command to query the file.

The following describes the drive name.

● drive is the storage device and is named as follows:


– sd1: root directory of the Micro SD card on the master SRU.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 354


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

– flash: root directory of the flash memory on the master SRU.


– slave#sd1: root directory of the Micro SD card on the slave SRU. If the
device has no slave SRU, this drive is unavailable.
– slave#flash: root directory of the flash memory on the slave SRU. If the
device has no slave SRU, this drive is unavailable.

Only the AR3200 series supports dual SRUs.


drive is the storage device of the router. It is named flash: on the
AR100&AR120&AR150&AR160&AR200&AR1200 series, AR2201-48FE,
AR2202-48FE, AR2204-27GE, AR2204-24GE, AR2204-27GE-P, AR2204-51GE-P,
AR2204-48GE-P, AR2204EAR2204, AR2220L-DC, AR3670 and AR2220L-AC, is
named flash: or sd1: on the AR2220E, AR2240C, is named flash: or sd1: on
the AR2240 and AR3260 using SRU40, SRU60, SRU80, and is named sd1: on
the AR2240 and AR3260 using SRU200, SRU400, SRU100E, and SRU200E.
The path can be an absolute path or relative path.
● flash:/my/test/ is an absolute path.
● selftest/ is a path relative to the current working directory and indicates the
selftest directory in the current working directory.
Precautions
● If the destination file path is specified while the file name is not specified, the
designation file name is the same as the source file name.
● The source file persists after being decompressed.
● The compressed file must be a .zip file. If a file to be decompressed is not a
zip file, the system displays an error message during decompression.
● The source file must be a single file. If you attempt to decompress a directory
or multiple files, the decompression cannot succeed.

Example
# Decompress log file syslogfile-2012-02-27-17-47-50.zip that are stored in the
syslogfile directory and save it to the root directory as file log.txt.
<Huawei> pwd
flash:/syslogfile
<Huawei> unzip syslogfile-2012-02-27-17-47-50.zip flash:/log.txt
Info: Extract flash:/syslogfile/syslogfile-2012-02-27-17-47-50.zip to flash:/log.txt?(y/n)[n]:y
100% complete
Info: Decompressed file flash:/syslogfile/syslogfile-2012-02-27-17-47-50.zip flash:/log.txt.

Related Topics
3.11.13 dir (user view)
3.11.49 pwd (user view)

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 355


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

3.11.73 user
Function
The user command changes the current FTP user when the local device is
connected to the FTP server.

Format
user user-name [ password ]

Parameters
Parameter Description Value
user-name Specifies the name of a The value is a string of 1 to 64 case-
login user. insensitive characters without space.
password Specifies the login The value is a string of 1 to 16 case-
password. sensitive characters without space, single
quotation mark, or question mark.

Views
FTP client view

Default Level
3: Management level

Usage Guidelines
Usage Scenario
You can run the user command to change the current user on the FTP server.
Precautions
After you run the user command to change the current user, a new FTP
connection is set up, which is the same as that you specify in the ftp command.

Example
# Log in to the FTP server using the user name tom.
<Huawei> ftp 10.137.217.201
Trying 10.137.217.201 ...
Press CTRL+K to abort
Connected to 10.137.217.201.
220 FTP service ready.
User(10.137.217.201:(none)):huawei
331 Password required for huawei.
Enter password:
230 User logged in.
[Huawei-ftp] user tom
331 Password required for tom.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 356


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Enter password:
230 User logged in.

Related Topics
3.11.26 ftp

3.11.74 verbose
Function
The verbose command enables the verbose function on the FTP client.
The undo verbose command disables the verbose function.
By default, the verbose function is enabled.

Format
verbose
undo verbose

Parameters
None

Views
FTP client view

Default Level
3: Management level

Usage Guidelines
After the verbose function is enabled, all FTP response messages are displayed on
the FTP client.

Example
# Enable the verbose function.
<Huawei> ftp 10.137.217.201
Trying 10.137.217.201 ...
Press CTRL+K to abort
Connected to 10.137.217.201.
220 FTP service ready.
User(10.137.217.201:(none)):huawei
331 Password required for huawei.
Enter password:
230 User logged in.
[Huawei-ftp] verbose
Info: Succeeded in switching verbose on.
[Huawei-ftp] get h1.txt
200 Port command okay.
150 Opening ASCII mode data connection for h1.txt.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 357


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

226 Transfer complete.


FTP: 69 byte(s) received in 0.160 second(s) 431.25byte(s)/sec.

# Disable the verbose function.


[Huawei-ftp] undo verbose
Info: Succeeded in switching verbose off.
[Huawei-ftp] get h1.txt

FTP: 69 byte(s) received in 0.150 second(s) 460.00byte(s)/sec.

Related Topics
3.11.35 get (FTP client view)
3.11.45 put (FTP client view)

3.11.75 zip
Function
The zip command compresses a file.

Format
zip source-filename destination-filename

Parameters
Parameter Description Value
source- Specifies the The value is a string of 1 to 64 case-insensitive
filename name of a characters without spaces in the [ drive ]
source file to be [ path ] file name format. When quotation
compressed. marks are used around the string, spaces are
allowed in the string.
In the preceding parameter, drive specifies the
storage device name, and path specifies the
directory and subdirectory.
You are advised to add : and / between the
storage device name and directory. Characters
~, *, /, \, :, ', " cannot be used in the directory
name.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 358


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Parameter Description Value


destination- Specifies the The value is a string of 1 to 64 case-insensitive
filename name of a characters without spaces in the [ drive ]
destination file [ path ] file name format. When quotation
that is marks are used around the string, spaces are
compressed. allowed in the string.
In the preceding parameter, drive specifies the
storage device name, and path specifies the
directory and subdirectory.
You are advised to add : and / between the
storage device name and directory. Characters
~, *, /, \, :, ', " cannot be used in the directory
name.

Views
User view

Default Level
3: Management level

Usage Guidelines
Usage Scenario

The following describes the drive name.

● drive is the storage device and is named as follows:


– sd1: root directory of the Micro SD card on the master SRU.
– flash: root directory of the flash memory on the master SRU.
– slave#sd1: root directory of the Micro SD card on the slave SRU. If the
device has no slave SRU, this drive is unavailable.
– slave#flash: root directory of the flash memory on the slave SRU. If the
device has no slave SRU, this drive is unavailable.

Only the AR3200 series supports dual SRUs.


drive is the storage device of the router. It is named flash: on the
AR100&AR120&AR150&AR160&AR200&AR1200 series, AR2201-48FE,
AR2202-48FE, AR2204-27GE, AR2204-24GE, AR2204-27GE-P, AR2204-51GE-P,
AR2204-48GE-P, AR2204EAR2204, AR2220L-DC, AR3670 and AR2220L-AC, is
named flash: or sd1: on the AR2220E, AR2240C, is named flash: or sd1: on
the AR2240 and AR3260 using SRU40, SRU60, SRU80, and is named sd1: on
the AR2240 and AR3260 using SRU200, SRU400, SRU100E, and SRU200E.

The path can be an absolute path or relative path.


● flash:/my/test/ is an absolute path.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 359


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

● selftest/ is a path relative to the current working directory and indicates the
selftest directory in the current working directory.
Precautions
● If the destination file path is specified while the file name is not specified, the
designation file name is the same as the source file name.
● The source file persists after being compressed.
● Directories cannot be compressed.

Example
# Compress file log.txt that is stored in the root directory and save it to the test
directory as file log.zip.
<Huawei> dir
Directory of flash:/

Idx Attr Size(Byte) Date Time(LMT) FileName


0 -rw- 155 Dec 02 2011 01:28:48 log.txt
1 -rw- 9,870 Oct 01 2011 00:22:46 patch.pat
2 drw- - Mar 22 2012 00:00:48 test
3 -rw- 836 Dec 22 2011 16:55:46 rr.dat
...

1,927,220 KB total (1,130,464 KB free)


<Huawei> zip log.txt flash:/test/log.zip
Info: Zip flash:/log.txt flash:/test/log.zip? (y/n)[n]:y
100% complete
Info: Compressed file flash:/log.txt flash:/test/log.zip.
<Huawei> cd test
<Huawei> dir
Directory of flash:/test/

Idx Attr Size(Byte) Date Time(LMT) FileName


0 -rw- 836 Mar 20 2012 19:49:14 test
1 -rw- 239 Mar 22 2012 20:57:38 test.txt
2 -rw- 1,056 Dec 02 2011 01:28:48 log.txt
3 -rw- 240 Mar 22 2012 21:23:46 log.zip

1,927,220 KB total (1,130,463 KB free)

Related Topics
3.11.13 dir (user view)

3.12 Configuring System Startup Commands

3.12.1 autosave interval


Function
The autosave interval command sets the interval for automatically saving system
configuration data.

Format
autosave interval { value | time | configuration time }

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 360


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Parameters
Parameter Description Value

value Configures the automatic save The value is an


function. The automatic save function enumerated value
is classified into two types: saving that can be on or off.
configuration data automatically and The default value is
saving modified data automatically. off.
When the value is on, the two save
functions are enabled. When the value
is off, the two save functions are
disabled and the data needs to be
saved manually.

time Indicates the interval for automatically The value is an integer


saving the configuration data. If an that ranges from 10 to
interval is configured, the 10080.
configuration data is saved regardless The unit is minute.
of whether it is modified.
The default value is
1440 minutes.

configuration Indicates the interval for automatically The value is an integer


time saving the modified data. When the that ranges from 2 to
configuration data is modified, it is 1440.
saved at the preset interval. The unit is minute.
The default value is 30
minutes.

Views
User view

Default Level
3: Management level

Usage Guidelines
Usage Scenario

Run this command to set configuration data at preset intervals. When the interval
is set, the system automatically saves the configuration data without requiring the
command delivered by the network management system. The modified data can
be saved in the storage device in real time and cannot be lost after system restart.

Precautions

● When the automatic save function is enabled, you can also run the save
command to save the system configuration data manually. When the
automatic save function is disabled, the system does not save data

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 361


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

automatically and you need to run the save command to save the configured
data.
● The automatic save function is disabled by default.
● After you run the autosave interval command, the frequent data save
operation affects system performance. Do not set the automatic save interval
to less than 1 hour. The automatic save interval of 24 hours or greater is
recommended.
● The automatic save function specified by the autosave interval command
cannot be enabled together with that specified by the autosave time
command.

Example
# Enable the automatic save function.
<Huawei> autosave interval on
System autosave interval switch: on
Autosave interval: 1440 minutes
Autosave type: configuration file

System autosave modified configuration switch: on


Autosave interval: 30 minutes
Autosave type: configuration file

# Set the automatic save interval to 120 minutes.


<Huawei> autosave interval 120
System autosave interval switch: on
Autosave interval: 120 minutes
Autosave type: configuration file

Table 3-45 Description of the autosave interval command output

Item Description

System autosave interval switch Whether the device is enabled to


automatically save system
configuration data at the specified
interval:
● on: The device is enabled to
automatically save system
configuration data at the specified
interval.
● off: The device is disabled from
automatically saving system
configuration data at the specified
interval.

Autosave interval Specifies the interval for automatically


saving configuration data. If an
interval is configured, the
configuration data is saved at intervals
regardless of whether the data is
changed.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 362


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Item Description

Autosave type Indicates that the type of file saved


automatically is configuration file.

System autosave modified Indicates that the change to the


configuration switch configuration data is automatically
saved. When the value is on, the
function is enabled. When the value is
off, the function is disabled.

Related Topics
3.12.2 autosave time
3.12.4 display autosave configuration

3.12.2 autosave time


Function
The autosave time command sets the automatic save time.

Format
autosave time { value | time-value }

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 363


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Parameters
Parameter Description Value

value Configures the device to save configuration Enumerated


data at a preset time. value. The
options are as
follows:
● on: The
device is
enabled to
automatica
lly save
system
configurati
on data at
a preset
time.
● off: The
device is
disabled
from
automatica
lly saving
system
configurati
on data at
a preset
time.
The default
value is off.

time-value Indicates the automatic save time after the The value
device is enabled to automatically save system ranges from
configuration data. After this parameter is 00:00:00 to
configured, the system automatically saves the 23:59:59.
configuration data at intervals of the The default
automatic save time. value is
00:00:00.

Views
User view

Default Level
3: Management level

Usage Guidelines
Usage Scenario

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 364


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

The system can save configuration data at preset intervals or at the preset time.
Run this command to set the automatic save time. When the time is set, the
system automatically saves the configuration data without requiring the
command delivered by the network management system. The modified data can
be saved in the storage device in real time and cannot be lost after system restart.
Precautions
● When the device is enabled to automatically save system configuration data,
the modified configuration is saved at the preset time. When the device is
disabled from automatically saving system configuration data, the system
does not save data automatically and you need to run the save command to
save the configured data.
● The automatic save function specified by the autosave time command
cannot be used with that specified by the autosave interval command.
● If data is frequently read from or written into the storage device, the lifespan
of the storage medium is reduced. You are advised to disable the automatic
save function immediately after the modified data is saved.

Example
# Enable the device to automatically save system configuration data at intervals
of the automatic save time.
<Huawei> autosave time on
System autosave time switch: on
Autosave time: 00:00:00
Autosave type: configuration file

# Set the automatic save time to 12:20:30.


<Huawei> autosave time 12:20:30
System autosave time switch: on
Autosave time: 12:20:30
Autosave type: configuration file

Table 3-46 Description of the autosave time command output


Item Description

System autosave time switch Whether the device is enabled to


automatically save system
configuration data at the specified
time:
● on: The device is enabled to
automatically save system
configuration data at the specified
time.
● off: The device is disabled from
automatically saving system
configuration data at the specified
time.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 365


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Item Description

Autosave time Automatic save time. The device saves


system configuration data at intervals
of the automatic save time no matter
whether the configuration data
changes.

Autosave type Type of the file saved automatically.

Related Topics
3.12.1 autosave interval
3.12.4 display autosave configuration

3.12.3 compare configuration


Function
The compare configuration compares whether the current configurations are
identical with the next startup configuration file.

Format
compare configuration [ configuration-file [ current-line-number save-line-
number ] ]

Parameters
Parameter Description Value
configuration-file Specifies the name of the The value is a string of 5 to
configuration file to be 64 case-insensitive
compared with the current characters without spaces.
configurations.
current-line- Specifies the line number for The value is an integer that
number comparison in the current ranges from 0 to 65535.
configuration.
save-line-number Specifies the line number for The value is an integer that
comparison in the saved ranges from 0 to 65535.
configuration.

Views
User view

Default Level
3: Management level

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 366


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Usage Guidelines
Usage Scenario

If current-line-number and save-line-number are not specified, the configuration


files are compared from the first lines. The two parameters can be specified to skip
the differences that are found and continue the comparison.

When the difference is found using the compare configuration command, the
different content in the current and saved configuration files is displayed. By
default, 120 characters are displayed. If the different content from the start line to
the end line contains less than 120 characters, only these characters are displayed.

Precautions

● The configuration file name extension must be .cfg or .zip.


● If configuration-file is not specified, the system compares whether the current
configurations are identical with the next startup configuration file.
● If configuration-file is specified, the system compares whether the current
configurations are identical with the specified startup configuration file.

Example
# Compare whether the current configurations are identical with the next startup
configuration file.
<Huawei> compare configuration
The current configuration is not the same as the next startup configuration file.
====== configuration line 14 ======
ftp server enable
#
drop illegal-mac alarm
#
vlan batch 10 to 11
#
dot1x enable
#
set transceiver-monitoring disable
====== Configuration file line 14 ======
drop illegal-mac alarm
#
vlan batch 10 to 11
#
dot1x enable
#
set transceiver-monitoring disable

Related Topics
3.12.16 save

3.12.4 display autosave configuration

Function
The display autosave configuration command displays the automatic save
parameters of the configuration data.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 367


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Format
display autosave configuration

Parameters
None

Views
All views

Default Level
3: Management level

Usage Guidelines
Usage Scenario

Run this command when you want to check whether the function for
automatically saving configuration data is enabled, enable or disable the
automatic save function, and modify the automatic save interval or time.

Precautions

● Run the autosave time command to set the time for automatically saving
system configuration data.
● Run the autosave interval command to set the interval for automatically
saving system configuration data.
● The frequent data save operation affects the lifespan of the system storage
device. Do not set the automatic save interval to less than 1 hour. The
automatic save interval of 24 hours or greater is recommended.

Example
# Display the automatic save parameters configured in the system.
<Huawei> display autosave configuration
System autosave interval switch: on
Autosave interval: 120 minutes
Autosave type: configuration file

System autosave modified configuration switch: on


Autosave interval: 30 minutes
Autosave type: configuration file

System autosave time switch: off


Autosave time: 12:20:30
Autosave type: configuration file

Table 3-47 Description of the display autosave configuration command output

Item Description

System autosave interval switch State of the automatic save function.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 368


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Item Description

Autosave interval Automatic save interval.

Autosave type Type of the file that is automatically


saved.

System autosave modified State of the function for automatically


configuration switch saving modified data.

System autosave time switch State of the function for saving


configuration data at the preset time.

Autosave time Automatic save time.

Related Topics
3.12.16 save
3.12.2 autosave time
3.12.1 autosave interval

3.12.5 display current-configuration


Function
The display current-configuration command displays the currently running
configuration.
This command does not display parameters that use default settings.

Format
display current-configuration [ configuration [ configuration-type
[ configuration-instance ] related ] | controller [ interface-type [ interface-
number ] ] | interface [ interface-type [ interface-number ] ] ] [ feature feature-
name [ filter filter-expression ] | filter filter-expression ]
display current-configuration [ all | inactive | [ simple ] [ section section ] ]

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 369


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Parameters
Parameter Description Value
configuration Specifies the The value is determined by
configuration-type configuration type. the current system
configurations. For example:
● system: system
configuration
● user-interface: user
interface configuration
● aaa: AAA configuration
● vpn-instance: VPN instance
configuration
● ...
configuration- Specifies a configuration The value is a string of 1 to
instance instance. 80 case-insensitive characters
without spaces.
controller Specifies a controller -
[ interface-type interface, for example, E1
[ interface- control interface.
number ] ]
interface [ interface- -
Specifies an interface
type [ interface-
type.
number ] ]
feature feature- Specifies the -
name configuration information
about the specified
feature.

filter filter- Displays the configuration The value is a string of 1 to


expression information that matches 255 case-insensitive
a regular expression. characters.

all Displays all the -


configuration information.

inactive Displays the offline -


configuration information.

simple Displays the current -


simple configuration.
section section Specifies the The value is a string of 1 to
configurations to be 79 case-insensitive characters
obtained based on types. without spaces.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 370


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Views
All views

Default Level
3: Management level

Usage Guidelines
To check whether the configured parameters take effect, run the display current-
configuration command. The parameters that do not take effect are not
displayed.

The command output is relevant to user configuration. The command does not
display the default configuration.

You can use a regular expression to filter the command output. For the regular
expression rules, see "Filtering Command Outputs" in the Huawei AR Series Access
Routers Configuration Guide - Basic Configuration.
If the configuration is in the offline state, the offline configuration is marked with
* in the display current-configuration all and display current-configuration
inactive command output.

Example
# Display all configurations that include vlan.
<Huawei> display current-configuration | include vlan
vlan batch 10 77 88
port trunk allow-pass vlan 10

Related Topics
3.12.16 save
3.12.15 reset saved-configuration
3.12.8 display saved-configuration

3.12.6 display factory-configuration

Function
The display factory-configuration command displays the factory configuration of
the device.

Format
display factory-configuration

Parameters
None

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 371


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Views
All views

Default Level
3: Management level

Usage Guidelines
You can run this command to view the factory configuration of the device,
including the HTTP and HTTPS server status, PKI domain name, SSL policy name
and type, authorization scheme, accounting scheme, authentication mode, user
priority, and allowed access type.
You can configure required basic information as the factory configuration and do
not need to configure the basic information after restoring the factory
configuration.
Factory settings of different devices may be different.

Example
# Display the factory configuration of the Router.
<Huawei> display factory-configuration
#
vlan 1
#
http server enable
http secure-server ssl-policy default_policy
http secure-server enable
#
ssl policy default_policy type server
pki-realm default
#
aaa
authentication-scheme default
authorization-scheme default
accounting-scheme default
domain default
domain default_admin
local-user admin password cipher %^%#5d~9:M^ipCfL\iB)EQd>3Uwe%^%#
local-user admin privilege level 15
local-user admin service-type http telnet
#
interface Vlanif1
ip address 192.168.1.1 255.255.255.0

#
user-interface con 0
user-interface vty 0
authentication-mode aaa
user privilege level 15
#
return

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 372


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Table 3-48 Description of the display factory-configuration command output


Item Description

vlan 1 The VLAN ID is 1.

http server enable The HTTP server is enabled on the device.

http secure-server ssl-policy The name of the server SSL policy applied to the
default_policy HTTPS server is default_policy.

http secure-server enable The HTTPS server is enabled on the device.

ssl policy default_policy The name of the SSL policy is default_policy and
type server the type is server.

pki-realm default The name of the PKI domain on the device is


default. The domain can be modified but cannot
be deleted.

aaa AAA view.

authentication-scheme The name of the system authentication scheme is


default default. The default authentication scheme can
be modified but cannot be deleted.
The default authentication scheme has the
following policies:
● The authentication mode is local
authentication.
● Users who fail to pass the authentication are
forced to go offline.

authorization-scheme The name of the authorization scheme is default.


default

accounting-scheme default The name of the accounting scheme is default.

domain default The domain name is default. The device has two
default domains named default and
default_admin. The two domains can be
modified but cannot be deleted.

domain default_admin The domain name is default_admin. The device


has two default domains named default and
default_admin. The two domains can be
modified but cannot be deleted.

local-user admin password By default, the system has a local user whose
cipher %@ user name is admin and the user password is in
%@5d~9:M^ipCfL ciphertext.
\iB)EQd>3Uwe%@%@

local-user admin privilege The priority of the local user admin is 15.
level 15

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 373


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Item Description

local-user admin service- The access types of the local user admin are
type http telnet HTTP and Telnet.

interface Vlanif1 ip address The interface type is VLANIF and interface


192.168.1.1 255.255.255.0 number is 1. The IP address and subnet mask of
the interface are 192.168.1.1 and 255.255.255.0,
respectively.

user-interface con 0 The user interface type is console and the relative
number is 0.

user-interface vty 0 The user interface type is VTY and the relative
number is 0.

authentication-mode aaa The default authentication scheme use AAA


authentication mode.

user privilege level 15 The user level is 15.

Related Topics
3.12.7 display factory-configuration operate-mode
3.12.18 set factory-configuration

3.12.7 display factory-configuration operate-mode


Function
The display factory-configuration operate-mode command displays the
operation performed when the factory configuration is restored.

Format
display factory-configuration operate-mode

Parameters
None

Views
All views

Default Level
3: Management level

Usage Guidelines
None

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 374


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Example
# Display the operation performed when the factory configuration is restored.
<Huawei> display factory-configuration operate-mode
OperaMode Reserved.

Table 3-49 Description of the display factory-configuration operate-mode


command output

Item Description

OperaMode Operation performed on the original


factory configuration when the new factory
configuration is restored.
● Delete: deletes the original factory
configuration.
● Reserved: reserves the original factory
configuration.

Related Topics
3.12.6 display factory-configuration

3.12.8 display saved-configuration


Function
The display saved-configuration command displays the configuration file to be
used for the next startup.

Format
display saved-configuration [ last | time ]

Parameters
Parameter Description Value
last Displays the system configurations saved last time. -
time Displays the recent time when the configurations are saved -
manually or automatically.

Views
All views

Default Level
3: Management level

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 375


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Usage Guidelines
If the device has been started and is not working properly, run the display saved-
configuration command to check the device startup configuration in the file
specified by running the startup saved-configuration command.
Run the display saved-configuration last command to check the system
configurations saved last time in the configuration file loaded during the current
startup.
Run the display saved-configuration time command to check the last time when
the system configurations are saved.
The command output is relevant to user configuration. The command does not
display the default configuration.

Example
# Display the configuration file for the next startup.
<Huawei> display saved-configuration
[V200R009]
#
sysname Router
...
#
interface GigabitEthernet0/0/0
ip address 192.168.200.182 255.255.255.0
...
#
user-interface maximum-vty 15
user-interface con 0
user-interface vty 0 14
idle-timeout 0 0
#
return

Related Topics
3.12.20 startup saved-configuration
3.12.15 reset saved-configuration
3.12.5 display current-configuration
3.12.10 display startup

3.12.9 display schedule reboot


Function
The display schedule reboot command displays the configuration of the
scheduled restart of the device.

Format
display schedule reboot

Parameters
None

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 376


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Views
All views

Default Level
3: Management level

Usage Guidelines
After using the schedule reboot command to configure a scheduled restart, you
can use this command to view the configuration of the scheduled restart.

Example
# Display the configuration of the scheduled restart of the device.
<Huawei> display schedule reboot
Info:System will reboot at 22:00:00 2013/09/17 (in 1 hours and 43 minutes).

Table 3-50 Description of the display schedule reboot command output

Item Description

System will reboot at Specific restart time.

in hours and minutes Time span between the restart time and the current
time.

Related Topics
3.12.17 schedule reboot

3.12.10 display startup


Function
The display startup command displays the system software for the current and
next startup, backup system software, configuration file, license file, and patch file,
as well as voice file.

Format
display startup

Parameters
None

Views
All views

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 377


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Default Level
1: Monitoring level

Usage Guidelines
Usage Scenario

Before upgrading or degrading a device, run this command to check whether the
files for next startup have been loaded. If the files have been loaded, the device
can be upgraded or degraded successfully after it is restarted. You can also run the
command to view the system software and files for current startup.

Precautions

Run this command to check whether the backup system software exists. If the
backup system software and current startup system software are in the same
storage device, save backup system software in another storage device to ensure
that the system can still restart when the storage device is damaged.

Example
# Display the names of system software for current and next startup.
<Huawei> display startup
MainBoard:
Startup system software: sd1:/basicsoftware.cc
Next startup system software: sd1:/basicsoftware.cc
Backup system software for next startup: null
Startup saved-configuration file: sd1:/vrpcfg.zip
Next startup saved-configuration file: sd1:/vrpcfg.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
SlaveBoard:
Startup system software: sd1:/basicsoftware.cc
Next startup system software: sd1:/basicsoftware.cc
Backup system software for next startup: null
Startup saved-configuration file: sd1:/vrpcfg.zip
Next startup saved-configuration file: sd1:/vrpcfg.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

Table 3-51 Description of the display startup command output

Item Description

MainBoard Master main control board.

SlaveBoard Slave main control board.


NOTE
Only the AR3200 series supports dual SRUs.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 378


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Item Description

Startup system software System software that is used in the


current startup.

Next startup system software System software that is configured for


the next startup by running the startup
system-software command.
If no system software for the next
startup is configured, the system
software used in the current startup is
displayed.

Backup system software for next Backup system software that is


startup configured for the next startup by
running the startup system-software
backup command.
null indicates that no backup system
software exists on the device.

Startup saved-configuration file Configuration file that is used in the


current startup.

Next startup saved-configuration file Configuration file that is configured for


the next startup by running the startup
saved-configuration command.
If no configuration file for the next
startup is configured, the configuration
file used in the current startup is
displayed.

Startup license file License file that is used in the current


startup.
default indicates that no license file is
specified or the license file does not take
effect.

Next startup license file License file that is configured for the
next startup.
If no license file is configured, default is
displayed.

Startup patch package Patch package file that is used in the


current startup.
null indicates that no patch package file
is specified or the patch package file
does not take effect.

Next startup patch package Patch package file that is configured for
the next startup by running the startup
patch command.
If no patch package file is configured,
NULL is displayed.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 379


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Item Description

Startup voice-files Voice file used in current startup.


null indicates no voice file is specified.

Next startup voice-files Voice file used in next startup.


null indicates no voice file is specified.

Related Topics
3.12.20 startup saved-configuration
3.12.21 startup system-software
3.12.23 startup patch

3.12.11 display system


Function
The display system command displays the MD5 or SHA256 value of a file.

Format
display system { file-md5 | file-sha256 } filename

Parameters
Parameter Description Value
file-md5 Specifies the MD5 encryption mode. -
file-sha256 Specifies the SHA256 encryption -
mode.
filename Specifies the name of the file whose The value is a string of 1 to
MD5 or SHA256 value needs to be 64 case-sensitive characters
calculated. without spaces.

Views
All views

Default Level
3: Management level

Usage Guidelines
Usage Scenario
After downloading a file from the server to the device, you can check whether the
file is damaged during the download process, for example, whether the file is

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 380


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

completely downloaded. You can use a piece of third-party software (for example,
HashMyFiles) on the server to calculate the MD5 or SHA256 value of the file, run
the display system command on the device to calculate the MD5 or SHA256
value of the downloaded file, and compare the two values calculated on the
server and device. If the two values are the same, the file is not damaged. If the
two values are different, the file is damaged, and you need to download the file
again.
Precautions
If the size of a file exceeds 200 MB, the device displays the output of the display
system command after a period of time. Wait until the command output is
displayed.

Example
# Display the MD5 value of the file ar3600.cc
<Huawei> system-view
[Huawei] display system file-md5 ar3600.cc
File Name:
ar3600.cc
MD5:
06d12eb350e428605e062a4392455dec

# Display the SHA256 value of the file ar3600.cc.


<Huawei> system-view
[Huawei] display system file-sha256 ar3600.cc
File Name:
ar3600.cc
SHA256:
f6910519ab03ef1ecddd7db42784a28c8f32325f98866689df5431f94519165e

Table 3-52 Description of the display system command output


Item Description

File Name Name of the file whose MD5 or


SHA256 value needs to be calculated.

MD5 MD5 value of the file.

SHA256 SHA256 value of the file.

Related Topics
3.12.21 startup system-software

3.12.12 factory-configuration prohibit


Function
The factory-configuration prohibit command disables the function of restoring
the factory settings of a device by holding down reset.
The undo factory-configuration prohibit command enables the function of
restoring the factory settings of a device by holding down reset.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 381


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

By default, you can hold down reset to restore the factory configuration.

Only the AR100&AR120&AR150&AR160&AR200 series supports this command.

Format
factory-configuration prohibit

undo factory-configuration prohibit

Parameters
None

Views
System view

Default Level
3: Management level

Usage Guidelines
If you hold down reset on a device for more than 5 seconds, the device restarts
with the factory settings and all user-defined configurations are lost after the
restart. To retain user-defined configurations after you hold down reset, run the
factory-configuration prohibit command to disable this function.

If you want to restore the factory settings of a device by holding down reset, run
the undo factory-configuration prohibit command to enable this function.

Example
# Disable the function of restoring the factory configuration of a device by
holding down reset.
<Huawei> system-view
[Huawei] factory-configuration prohibit

Related Topics
3.12.18 set factory-configuration
3.12.19 set factory-configuration operate-mode

3.12.13 factory-configuration reset

Function
The factory-configuration reset command configures the device to restore
factory settings after restart.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 382


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Format
factory-configuration reset

Parameters
None

Views
User view

Default Level
3: Management level

Usage Guidelines
Usage Scenario

If incorrect configurations cause exceptions of functions, run the factory-


configuration reset command to configure the device to restore factory settings
after restart.

Precautions

If the configuration file is not specified for factory settings, the device uses default
configuration parameters for initialization after the factory-configuration reset
command is executed.

Example
# Configure the device to restore factory settings after restart.
<Huawei> factory-configuration reset
Info: Successfully set factory config reset flag!

3.12.14 reboot

Function
The reboot command restarts the device.

Format
reboot [ fast ]

Parameters
Parameter Description Value
fast Fast restarts the device. In fast restart mode, the -
configuration file is not saved.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 383


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Views
User view

Default Level
3: Management level

Usage Guidelines
Usage Scenario

This command functions in the same way as a power recycle operation (power off
and then restart the device). The command enables you to restart the device
remotely.

● After the reboot command is run, the system displays a message asking you
whether to save the configuration before restarting
● When the reboot fast command is run, the system restart quickly without
displaying any message and the configuration is lost.

Precautions

● If you do not respond to the displayed message within the timeout period
after running this command, the system will return to the user view and the
device will not be restarted.
● This command interrupts services on the entire device. Therefore, do not use
this command when the device is running properly.
● Before restarting the device, ensure that the configuration file has been saved.
● After this command is executed, the OSP daughter card on the AR161FW-P-
M5, AR169-P-M9, AR169RW-P-M9, or AR169W-P-M9 is not affected.

Example
# Restart the device.
<Huawei> reboot

# Restart the device quickly.


<Huawei> reboot fast

3.12.15 reset saved-configuration

Function
The reset saved-configuration command clears the next startup configuration
file and cancels the configuration file used for next startup.

Format
reset saved-configuration

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 384


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Parameters
None

Views
User view

Default Level
3: Management level

Usage Guidelines
Usage Scenario
● If the configuration file on the device is incompatible with the upgraded
software, run the reset saved-configuration command to clear the
configuration file and run the startup saved-configuration command to
specify a new configuration file.
● If the device in use is applied to another scenario and the original
configuration file of the device does not meet requirements in the scenario,
run the reset saved-configuration command to clear the existing
configuration file and restart the device to restore its factory configurations.
Precautions
● After you run the reset saved-configuration command, the next startup
configuration file is cleared and the file is not used for next startup. If the
current startup configuration file is the same as the next startup configuration
file, the current startup configuration file is also cleared.
● If you do not use the startup saved-configuration command to specify a
new configuration file containing correct configurations or do not save the
configuration file after running the reset saved-configuration command, the
device uses factory configurations for startup. If the device does not have
factory configurations, it uses default configurations for startup.
● If the next startup configuration file is empty, the device displays a message
indicating that the file does not exist.
● Exercise caution when you run the reset saved-configuration command.

Example
# Clear the next startup configuration file in the storage device and cancel the
configuration file used for next startup.
<Huawei> reset saved-configuration
This will delete the configuration in the flash memory.
The device configurations will be erased to reconfigure.
Are you sure? (y/n)[n]:y
Clear the configuration in the device successfully.

Related Topics
3.12.16 save
3.12.5 display current-configuration

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 385


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

3.12.8 display saved-configuration

3.12.16 save
Function
The save command saves the configurations to the default directory.

Format
save [ all ] [ configuration-file ]

Parameters
Parameter Description Value
all Indicates that all configurations are -
saved, including the configurations
of the boards that are not running.
configuration-file Specifies the name of a The value is a string of 5
configuration file. to 64 case-insensitive
characters without
spaces.

Views
All views

Default Level
3: Management level

Usage Guidelines
Usage Scenario
You can run commands to modify the current configuration of the device, but the
modified configuration will be lost after the device restarts. To enable the new
configuration to take effect after a restart, save the current configuration in the
configuration file before restarting the device.
When a series of configurations are complete and take effect, you must save the
current configuration file to the storage device.
The save configuration-file command saves the current configuration to a specific
file on the storage device. Generally, running the save configuration-file command
does not affect the current startup configuration file. If the configuration file
specified by configuration-file has the same name with the current configuration
file and the default directory is used, running the save configuration-file
command is equivalent to running the save command.
Run the save all command to save all the current configurations, including the
configurations of the boards that are not running, to the default directory.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 386


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

The save all configuration-file command saves the current configuration to a


specific file on the storage device. Generally, running the save all configuration-
file command does not affect the current startup configuration file. If the
configuration file specified by configuration-file has the same name with the
current configuration file and the default directory is used, running the save all
configuration-file command is equivalent to running the save all command.

If you do not specify configuration-file when saving the configuration file for the
first time, the system asks you whether to save the configuration file as
vrpcfg.zip.

Precautions

● If the configuration file to be saved using this command has the same name
with the existing configuration file, the existing configuration file is rewritten.
● The configuration file name extension must be .zip or .cfg.
– .cfg: The file is saved in plain text mode. After the file is specified as the
configuration file, all commands in the file are recovered one by one
during startup.
– .zip: The .cfg file is compressed to a .zip file that occupies less space. After
being specified as the configuration file, the .zip file is decompressed to
the .cfg file and all commands in the .cfg file are recovered one by one
during startup.

Example
# Save the current configuration file to the default directory.
<Huawei> save
Warning: The current configuration will be written to the device.
Are you sure to continue? (y/n):y
It will take several minutes to save configuration file, please wait........
Configuration file had been saved successfully
Note: The configuration file will take effect after being activated

Related Topics
3.12.15 reset saved-configuration
3.12.5 display current-configuration
3.12.8 display saved-configuration
3.12.20 startup saved-configuration

3.12.17 schedule reboot

Function
The schedule reboot command configures the scheduled restart of a device and
set the specific time when the device restarts or the delay time before the device
restarts.

The undo schedule reboot command disables the scheduled restart function.

By default, the scheduled restart is disabled.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 387


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Format
schedule reboot { at time | delay interval }
undo schedule reboot

Parameters
Parameter Description Value
at time Specifies the The format of time is hh:mm YYYY-MM-DD. The
device restart restart time must be later than the current device
time. time by less than 720 hours. YYYY-MM-DD
indicates year, month, and date and is optional.
● hh indicates hour and the value ranges from 0
to 23.
● mm indicates minute and the value ranges
from 0 to 59.
● YYYY indicates year and the value ranges from
2000 to 2099.
● MM indicates month and the value ranges
from 1 to 12.
● DD indicates date and the value ranges from 1
to 31.
delay Specifies the The format of interval is hh:mm or mm. The
interval delay time delay time must be no more than 720 hours.
before the ● In hh:mm, hh indicates hour and the value
device restarts. ranges from 0 to 720 and mm indicates
minute and the value ranges from 0 to 59.
● mm indicates minute and the value ranges
from 0 to 43200.

Views
User view

Default Level
3: Management level

Usage Guidelines
Usage Scenario
When upgrading or restarting the device, you can configure the device to restart
at time when few services are running to minimize the impact on services.
Precautions
● If a specific date is set in the schedule reboot command and the date is a
future date, the device will be restarted at the specified time and there may

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 388


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

be a time difference within 1 minute. If no date is set, two situations may


occur: If the specified time is later than the current time, the device is
restarted at the specified time of the day. If the specified time is earlier than
the current time, the device is restarted at the specified time of the next day.
● When at time or delay interval is used, the time difference between the
specified date and the current date cannot be greater than 720 hours. If the
scheduled restart has been configured, the latest configuration overrides the
previous one.
● The scheduled restart function becomes invalid when you use the clock
datetime command to set the system time to over 10 minutes later than the
restart time set by the schedule reboot command. If the time difference is
equal to or less than ten minutes, the device immediately restarts and does
not save the configuration.
● This command restarts the device at the specified time, interrupting all
services on the device. Therefore, do not use this command when the device is
running properly.
● Before restarting the device, ensure that the configuration file has been saved.

Example
# Configure the device to restart at 22:00.
<Huawei> schedule reboot at 22:00
Info:Reboot system at 22:00:00 2012/07/25(in 10 hours and 10 minutes) confirm?[Y
/N]:y

Related Topics
3.12.9 display schedule reboot

3.12.18 set factory-configuration


Function
The set factory-configuration command configures the current configuration,
existing configuration file, or default factory settings as the factory configuration.

Format
set factory-configuration from { current-configuration | filename | default }

Parameters
Parameter Description Value

current- Specifies the current -


configuration configuration.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 389


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Parameter Description Value

filename Specifies a configuration file The value is a string


name. of 5 to 64 case-
NOTE insensitive characters
Local configuration files with file without spaces, in the
name extension .cfg and .zip are format of [ drive-
supported. name ] [ file-name ].
If drive-name is not
specified, the value is
the default storage
medium name. The
maximum length of
the entered file-name
is 64 minus the
default storage
medium name.
NOTE
If the length of the
entered configuration-
file is greater than 64,
the system displays the
following information:
Error: The file name
length is too long!

default Specifies default factory settings. -

Views
User view

Default Level
3: Management level

Usage Guidelines
Usage Scenario

If you need to change the factory configuration based on requirements, an


unknown problem occurs on the device, or the device operations are slow or
unstable after the device has been running for a long time, you can run the set
factory-configuration command to specify a new factory configuration.

Follow-up Procedure

After running the set factory-configuration command to specify a new factory


configuration, you can use different methods on different device models to restore
this factory configuration. On the AR100&AR120&AR150&AR160&AR200 series,
hold down the RESET button at least 5s to restore the factory configuration. On
the AR1200&AR2200&AR3200&AR3600 series, run the factory-configuration
reset command to restore the factory configuration.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 390


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Precautions

The new configuration file is not greater than 100 KB. If the file is over 100 KB,
the system fails to specify new factory configuration and displays the following
information:
Error: Local file is too large!

After the set factory-configuration command is used, new factory configuration


overrides the previous one.

Use the function that restores the factory configuration with caution. The user-
defined configuration will be lost when you restore factory configuration.

NOTICE

Hold down the RESET button for more than 5s to restart the device. The device
will use the new factory configuration after it restarts.
Press the RESET button to restart the device. The configuration is the latest one.

Example
# Override the factory configuration with the current configuration.
<Huawei> set factory-configuration from current-configuration
Warning: The current factory configuration will be replaced, and it's irreversible. Are you sure to set the
factory configuration?[Y/N]:y
Info: Successfully set factory config!

# Override the factory configuration overrides the specified configuration.


<Huawei> set factory-configuration from factory.cfg
Warning: The current factory configuration will be replaced, and it's irreversible. Are you sure to set the
factory configuration?[Y/N]:y
Info: Successfully set factory config!

# Override the factory configuration with default factory settings.


<Huawei> set factory-configuration from default
Warning: The current factory configuration will be replaced, and it's irreversible. Are you sure to set the
factory configuration?[Y/N]:y
Info: Successfully set factory config!

Related Topics
3.12.19 set factory-configuration operate-mode

3.12.19 set factory-configuration operate-mode

Function
The set factory-configuration operate-mode command sets the method for
restoring the factory configuration.

By default, the system reserves the previous configuration file when restoring the
factory configuration.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 391


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Format
set factory-configuration operate-mode { reserve-configuration | delete-
configuration }

Parameters
Parameter Description Value

reserve- Reserves current configuration -


configuration file after factory settings are
restored.

delete- Deletes current configuration file -


configuration after factory settings are
restored.

Views
User view

Default Level
3: Management level

Usage Guidelines
When you use the set factory-configuration command to specify factory settings,
run the set factory-configuration operate-mode delete-configuration
command to specify the operation as delete-configuration for restoring factory
settings. This prevents user information leak when the device is lost.

Example
# Set the mode of restoring the factory configuration to delete.
<Huawei> set factory-configuration operate-mode delete-configuration
Warning: It may delete your configuration file when executing factory configur
ation,are you sure to set the operation mode?(Y/N)y
Successfully set factory operation mode

Related Topics
3.12.18 set factory-configuration

3.12.20 startup saved-configuration

Function
The startup saved-configuration command specifies the system configuration file
for next startup.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 392


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Format
startup saved-configuration configuration-file [ slave-board | all ]

Only the AR3200 series supports the slave-board and all parameters.

Parameters
Parameter Description Value
configuration- Specifies the name of
file a configuration file. The value is a string of 1 to 64 case-
Make sure that the insensitive characters in the format of
file exists. [ drive-name ] [ file-name ]. It can
contain the following special characters:
[ ] @ ! # $ % ^ - = _ + { } , . : /. A string
containing digits, letters, and
underscores (_) is recommended. If
drive-name is not specified, the value is
the default storage medium name. The
maximum length of the entered file-
name is 64 minus the default storage
medium name.
NOTE
If the length of the entered configuration-file
is greater than 64, the system displays the
following information:
Error: The file name length is too long!

slave-board Specifies the -


configuration file for
next startup on the
slave SRU.
all Specifies the -
configuration file for
next startup on all
SRUs.

Views
User view

Default Level
3: Management level

Usage Guidelines
Usage Scenario

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 393


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

When the original configuration file cannot be used due to the software upgrade,
run the startup saved-configuration command to specify another configuration
file for next startup. The startup configuration file must be saved in the root
directory of the storage device.

Follow-up Procedure

Run the reboot or the schedule reboot command to restart the device.

Precautions

● The configuration file specified for the next startup must exist.
● The configuration file name extension must be .zip or .cfg.
– A configuration file with the file name extension .cfg is a text file, and
you can view the file content in the text file. After the file is specified as
the configuration file for next startup, the system restores all commands
in the file one by one during a startup.
– A .cfg file is compressed to a .zip file that occupies less space. After being
specified as the configuration file, the .zip file is decompressed to the .cfg
file and the system restores all commands in the .cfg file one by one
during startup.

Example
# Specify the system configuration file for the next startup.
<Huawei> startup saved-configuration vrpcfg.cfg

Related Topics
3.12.10 display startup
3.12.17 schedule reboot
3.12.14 reboot

3.12.21 startup system-software

Function
The startup system-software command specifies the system software for next
startup.

Format
startup system-software system-file [ slave-board | all ] [ verify | signature
sign-filename ]

● Only the AR3200 series supports the slave-board and all parameters.
● You cannot start the system software package in the system using an external hard disk.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 394


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Parameters
Parameter Description Value
system-file Specifies the name The value is a string of 1 to 64 case-
of the system insensitive characters in the format of
software file. [ drive-name ] [ file-name ]. It can contain
the following special characters: [ ] @ ! # $
% ^ - = _ + { } , . : /. A string containing
digits, letters, and underscores (_) is
recommended. If drive-name is not
specified, the value is the default storage
medium name. The maximum length of the
entered file-name is 64 minus the default
storage medium name.
NOTE
If the length of the entered configuration-file is
greater than 64, the system displays the following
information:
Error: The file name length is too long!

slave-board Specifies the system -


software for next
startup on the slave
SRU.
all Specifies the system -
software for next
startup on all SRU.
verify Checks validity of -
system software.
signature Checks validity of sign-filename is a character string in the
sign- the system format of [ drive-name ][ file-name ]. If
filename software's digital drive-name is not specified, the name of the
signature file. default storage device is used. The value is a
string of 1 to 64 case-insensitive characters
without spaces. The file name extension
must be .asc.

Views
User view

Default Level
3: Management level

Usage Guidelines
Usage Scenario
In system software upgrade or downgrade, run this command to specify the
system software for next startup.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 395


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Follow-up Procedure
Run the reboot or the schedule reboot command to restart the device.
Precautions
● The system software package must use .cc as the file name extension and be
saved to the root directory of the storage device.
The system software's digital signature file must use .asc as the file name
extension and be saved to the root directory of the storage device.
If a slave SRU has been specified by slave-board or the system software for all
SRUs has been specified by all, the device automatically copies the system
software from the master SRU to the slave SRU and you do not need to run the
copy source-filename destination-filename command. If the specified system
software already exists on the slave SRU, the device displays a message asking
whether you want to use the system software on the slave SRU. If not, the device
displays a message asking whether you want to overwrite the existing system
software. If the system software has been specified for next startup and cannot be
overwritten, the device will cancel the automatic copy operation.
If the storage space of the slave SRU for which the system software is specified
using the startup system-software command is insufficient, the device prompts
that a failure occurs.
If the device has dual SRUs, specify the system software for next startup on both
the master and slave SRUs.
The AR161G-L&AR161G-Lc&AR169G-L&AR169EGW-L support only the system
software upgrade. If the version of the system software specified for next startup
using the startup system-software command is earlier than the current system
software version, the system displays the following message:
Error: The version of the specified package file is too low.

Example
# Specify the system software to be loaded for next startup.
<Huawei> startup system-software basicsoft.cc

Related Topics
3.12.10 display startup
3.12.20 startup saved-configuration
3.12.17 schedule reboot
3.12.14 reboot

3.12.22 startup system-software backup


Function
The startup system-software backup command specifies the backup system
software for system startup.
By default, the device has no backup system software.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 396


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Format
startup system-software filename backup

Parameters
Parameter Description Value

filename Specifies the name of the The value is a string of 1 to 64


backup system file. case-insensitive characters in
the format of [ drive-name ]
[ file-name ]. It can contain
the following special
characters: [ ] @ ! # $ % ^ - =
_ + { } , . : /. A string
containing digits, letters, and
underscores (_) is
recommended. The
recommended format is drive
name:/file name. For
example, flash:/software.cc. If
drive-name is not specified,
the value is the default
storage medium name. The
maximum length of the
entered file-name is 64 minus
the default storage medium
name.
NOTE
If the length of the entered
configuration-file is greater than
64, the system displays the
following information:
Error: The file name length is too
long!

Views
User view

Default Level
3: Management level

Usage Guidelines
Usage Scenario

When the specified startup software package is damaged, the system uses the
backup software package to start.

Precautions

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 397


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

● The file name extension of the system software package must be .cc and the
package must be stored in the root directory.
● The backup startup software package can be the same as or different from
the current startup software package, but it must ensure a successful system
start.

Example
# Specify the backup system startup software for the system.
<Huawei> startup system-software basicsoft.cc backup
This operation will take several minutes, please wait........
Info: Succeeded in setting the backup file for booting system

Related Topics
3.12.21 startup system-software

3.12.23 startup patch

Function
The startup patch command specifies the patch file for next startup.

Format
startup patch patch-name [ slave-board | all ]

Only the AR3200&AR3600 series supports the slave-board and all parameters.

Parameters
Parameter Description Value
patch-name Specifies the name of The value is a string of 1 to 64 case-
the patch file for insensitive characters in the format of
next startup. [ drive-name ] [ file-name ]. It can contain
the following special characters: [ ] @ ! # $
% ^ - = _ + { } , . : /. A string containing
digits, letters, and underscores (_) is
recommended. If drive-name is not
specified, the value is the default storage
medium name. The maximum length of the
entered file-name is 64 minus the default
storage medium name.
NOTE
If the length of the entered configuration-file is
greater than 64, the system displays the following
information:
Error: The file name length is too long!

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 398


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Parameter Description Value


slave-board Specifies the patch -
file for next startup
on the slave SRU.

all Specifies the patch -


file for next startup
on all SRU.

Views
User view

Default Level
3: Management level

Usage Guidelines
Usage Scenario

To make the patch file take effect after the device restarts, run this command to
specify the patch file for next startup.

Follow-up Procedure

Run the reboot or the schedule reboot command to restart the device.

Precautions

● A patch file uses .pat as the file name extension and must be saved in the
root directory.
● If you use this command to specify another patch for next startup, the
previous patch will be overridden.
● After the patch file is specified for next startup, run the display patch-
information command to view the patch file.
– If the patch file for next startup is not empty, the device load the patch
automatically after next startup.
– If the patch file for next startup is empty, the device cannot load the
patch after next startup.
● After the device restarts, the system loads and runs the patch. If you do not
want the system to load the patch file after startup, use the patch delete all
command to delete the patch file.

Example
# Specify the patch file for next startup.
<Huawei> startup patch patch.pat

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 399


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Related Topics
3.12.10 display startup
3.12.17 schedule reboot
3.12.14 reboot

3.13 Upgrade Commands

3.13.1 display license


Function
The display license command displays information about the license file in the
system.

Format
display license

Parameters
None

Views
All views

Default Level
3: Management level

Usage Guidelines
A license file dynamically controls the availability of some features. Only one
license file is active in the system. Run this command to view detailed information
about the active license in the system, including license file name, version, validity
period, and control item. Based on the information, you can determine whether to
upgrade the system version to support more features.

In current version, the encoding format in displaying license information is the same as that
of the license file used by the device. If different terminals are used for login, adjust the
encoding formats of the terminals according to that of the license file to prevent garbled
characters.

Example
# Display information about the active license file of the MPU.
<Huawei> display license
Active License on master board: flash:/MPGX-5DN5-CPKH-DX3M-UVXL.dat

Active license : flash:/MPGX-5DN5-CPKH-DX3M-UVXL.dat

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 400


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

License state : Normal


Revoke ticket : No ticket

Product name : AR
Product version : V200R005
License file ESN : 210235293410C1000850
License Serial No : LIC20120517000320
Creator : Huawei Technologies Co., Ltd.
Created Time : 2012-05-17 10:51:09
Country : China
Custom : Information Not Available
Office : null

Feature name : LIC


Authorize type : COMM
Expired date : PERMANENT
Trial days : 60

Item name : LAR0PBX00


Item type : Function
Control value :1
Used value :1
Item state : Normal
Item expired date : PERMANENT
Item trial days : 60
Description : LAR0PBX00

Table 3-53 Description of the display license command output


Item Description

Active License on master board Name and path of the active license
file on the MPU.

Active license Name and path of the active license


file.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 401


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Item Description

License state Status of a license file:


● Normal
This state value indicates that a
license file is working properly. If
the status of the license file on the
live network is not Normal, check
the license file.
● Trial
– A license file enters the Trial
state if the ESN does not match
the device. A license file in Trial
state can be used only for 60
days.
To continue to use a license file
after the Trial state, apply for a
new license file using the correct
ESN.
– A temporary license file expires
and enters the Trial state.
To continue to use a license file
after the Trial state, apply for a
new license file and activate it.
– A license file is revoked and
enters the Trial state.
To continue to use a license file
after the Trial state, apply for a
new license file based on the
revocation code and activate it.
– If you replace the master main
control board but the new ESN
does not match the license file,
the license file enters the Trial
state.
To continue to use a license file
after the Trial state, apply for a
new license file matching the
new ESN and activate it.
● Demo
When you activate a temporary
license file, it enters the Demo
state. The Demo state exists only
for a demo license file used for test
and deployment.
A license file in Demo state allows
you to use normal functions within
a specified period. Before the

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 402


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Item Description

expiration of the license file in


Demo state, replace it with a
commercial license file.
● Emergency
A license file enters the Emergency
state when a disaster occurs
(commercial scenario).
In the emergency conditions like
earthquake, volcano explosion, and
tsunami, you can run the license
emergency command to trigger a
license file to enter the Emergency
state. The Emergency state stays for
seven days, and a license file can
enter the Emergency state three
times.
● Default: No license file is activated
or a license file expires.
If a license file enters the Default
state, services may be interrupted.
If you want to use services after a
license file expires or becomes
invalid, apply for a new license file
and activate it.

Revoke ticket License revocation code.

Product name Name of the product that runs the


license.

Product version Product version.

License file ESN ESN in the license file.

License Serial No Serial number of license file.

Creator Creator of the file.

Created Time Time when the file was created.

Country Country of the authorized customer.

Custom Authorized customer.

Office Office of the authorized customer.

Feature name Feature name.

Authorize type Authorization type.


● demo: trial authorization.
● comm: commercial authorization.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 403


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Item Description

Expired date License expiration date. PERMANENT


indicates that the license is
permanently valid.

Trial days Trial period.

Item name Name of a control item.

Item type Type of a control item.

Control value Authorized count of a control item.

Used value Used count of a control item.

Item state Status of a control item.

Item expired date Expiration date of a control item.

Item trial days Trial period of a control item.

Description Description of a control item.

3.13.2 display license accept agreement


Function
The display license accept agreement command displays information about
functions activated through commands, including the functions that have been
activated and time functions were used.

Format
display license accept agreement [ history ]

Parameters
Parameter Description Value

history Displays details of each -


control item including
the maximum activation
count of a resource item,
regardless of whether
the ETU license is
enabled.

Views
All views

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 404


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Default Level
3: Management level

Usage Guidelines
After the display license accept agreement history command is executed, either
of the following situations occurs:
● If function licenses are activated, the display license accept agreement
history command output is the same as the display license accept
agreement command output.
● If resource licenses are activated, the message "Maximum control value"
indicating the maximum activation count of a resource item is displayed.
If the control item is in Enable state, the function has been activated. The control
item name corresponding to the same function on different product models may
be different. Table 3-54 lists the mapping between authorized functions and
control items.

Table 3-54 Mapping between authorized functions and control items


Authorization Function Control Item

Data service (SPR and MPLS L2VPN) AR100&AR120&AR150&AR160&AR200:


NOTE LAR0DATAE01
The AR150&AR160&AR200 series does not AR1200: LAR0DATAE02
support MPLS L2VPN.
AR2200: LAR0DATAE03
AR3200: LAR0DATAE04

Security service (SAC, Efficient VPN) AR100&AR120&AR150&AR160&AR200:


LAR0SECE01
AR1200: LAR0SECE02
AR2200: LAR0SECE03
AR3200: LAR0SECE04

WLAN AC Express AR100&AR120&AR150&AR160&AR200:


LAR0AC01
AR1200: LAR0AC02
AR2200: LAR0AC03
AR3200: LAR0AC04

DSVPN AR100&AR120&AR150&AR160&AR200:
LAR0DSVPN01
AR1200: LAR0DSVPN02
AR2200: LAR0DSVPN03
AR3200: LAR0DSVPN04

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 405


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Authorization Function Control Item

XGE AR100&AR120&AR150&AR160&AR200:
LAR0XGE01
AR1200: LAR0XGE02
AR2200: LAR0XGE03
AR3200: LAR0XGE04

Example
# Display information about functions activated through commands.
<Huawei> display license accept agreement history
Active license Accept Agreement: yes

Item name : LAR0DATAE04


Item type : Function
Item state : Disable, -
Item left time :-
Item used time :-
Description : Data GTLV2

Item name : LAR0SECE04


Item type : Function
Item state : Disable, -
Item left time :-
Item used time :-
Description : LAR0SECE04

Item name : LAR0AC04


Item type : Function
Item state : Disable, -
Item left time :-
Item used time :-
Description : LAR0AC04

Item name : LAR0SSLVPN00


Item type : Resource
Control value :0
Maximum control value : 0
Item state : Disable, -
Item left time :-
Item used time :-
Description : LAR0SSLVPN00

Item name : LAR0DSVPN04


Item type : Function
Item state : Disable, -
Item left time :-
Item used time :-
Description : LAR0DSVPN04

Item name : LAR0IVR00


Item type : Resource
Control value :0
Maximum control value : 0
Item state : Disable, -
Item left time :-
Item used time :-
Description : LAR0IVR00

Item name : LAR0CT00


Item type : Resource

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 406


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Control value :0
Maximum control value : 0
Item state : Disable, -
Item left time :-
Item used time :-
Description : LAR0CT00

Item name : LAR0CM00


Item type : Resource
Control value :0
Maximum control value : 0
Item state : Disable, -
Item left time :-
Item used time :-
Description : LAR0CM00

Item name : LAR0VOICEE04


Item type : Function
Item state : Disable, -
Item left time :-
Item used time :-
Description : LAR0VOICEE04

Table 3-55 Description of the display license accept agreement history command
output
Item Description

Active license Accept Agreement ETU license status:


● yes: The ETU license is activated.
● no: The ETU license is not activated.

Item name Name of the control item.

Item type Type of the control item:


● Function
● Resource

Item state Status of the control item:


● Enable, Evaluate: This control item is
activated and is in trial period.
● Enable, Permanent: This control item
is activated and the trial period is
reached.
● Disable, Evaluate: This control item is
not activated and is in trial period.
● Disable, Permanent: This control item
is not activated and the trial period is
reached.
● Disable, -: This control item is not
activated.

Item left time Remaining time of the trial period after


the control item is activated.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 407


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Item Description

Item used time Time elapsed since the control item has
been used after the control item is
activated.

Description Description of the control item.

Control value Value of the activated resource item.

Maximum control value Maximum activation count of the


resource item.

3.13.3 display license esn


Function
The display license esn command displays the equipment serial number (ESN)
used for applying a license.

Format
display license esn

Parameters
None

Views
All views

Default Level
3: Management level

Usage Guidelines
When you need to use licensed resource items or function items, apply to Huawei
for a license file. When applying for a license, you need to provide the device ESN.
ESN is the only identifier of device components (such as MPU and interface
board), run the display license esn command to display the ESN of the current
device, and then use the ESN to apply a license file for the device.
The ESN of the chassis must be the same as the ESN in the license to be activated.
If they are different, the license file cannot be activated.

Example
# Display the ESN used for applying a license.
<Huawei> display license esn

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 408


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Master ESN is: 2102113374P0B4000046.

Table 3-56 Description of the display license esn command output

Item Description

Master ESN is ESN of the device.

3.13.4 display license resource usage


Function
The display license resource usage command displays the usage of the resource
items defined in a license file.

Format
display license resource usage

Parameters
None

Views
All views

Default Level
3: Management level

Usage Guidelines
You can use the display license resource usage command to check the usage of
the resource items defined in the license file.

Resource usage refers to the percentage of resources used out of resources defined
by the license file.

Example
# Display the usage of licensed resources.
<Huawei> display license resource usage
Activated License: flash:/LIC_ON179007_A1BB9D41960_all.dat
FeatureName | ConfigureItemName | ResourceUsage

CRFEA1 LARWLANAC00 0/0


CRFEA1 Test 0/0
CRFEA1 LAR0SSLVPN00 0/100
CRFEA1 LAR0IVR00 0/250
CRFEA1 LAR0CT00 0/250
CRFEA1 LAR0CM00 0/256

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 409


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Table 3-57 Description of the display license resource usage command output
Item Description

Activated License File name and path of an active


license name.

FeatureName Name of the feature controlled by the


license.

ConfigureItemName Name of a control item.

ResourceUsage Percentage of used resources.

3.13.5 display license revoke-ticket


Function
The display license revoke-ticket command displays the revocation code of the
current license file of the device.

Format
display license revoke-ticket

Parameters
None

Views
All views

Default Level
3: Management level

Usage Guidelines
Usage Scenario
The display license revoke-ticket command enables you to check the revocation
code of a license file that has become invalid on the device. This code proves that
the current license file is invalid and is used to apply for a new license.
Precautions
This command displays information only when the license file in current device
system is invalid. Otherwise, no command output is displayed.

Example
# Display the revocation code of the current invalid license file.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 410


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

<Huawei> display license revoke-ticket


Info: The revoke ticket is: LIC20091103006100:27C1B773ED11D9F877855CDAEE74ABFE60E07126.

3.13.6 display license state


Function
The display license state command displays the license status on the MPU.

Format
display license state

Parameters
None

Views
All views

Default Level
3: Management level

Usage Guidelines
Usage Scenario
To check the status of the running license, run this command. The command
displays the current status of the license and the number of days before the
license in this status will expire.
The system supports the following license states:
● Normal: normal license
● Demo: demonstration license
● Trial: trial license that has expired but is still valid during the trial period
● Emergency: emergency license
● Default: default license
This command helps you locate license problems and verify the license status on
the device.
Prerequisites
A license file has been stored on the main control board of the device and has
been activated. This ensures that valid entries are displayed after the execution of
the command. If the license file is not activated, no command output is displayed.

Example
# Display the status of the license on the MPU.
<Huawei> display license state

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 411


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Info: Master board license state: Trial. The remain days is 44.

3.13.7 display paf

Function
The display paf command displays information about the product adaptive file
(PAF) in the system.

Format
display paf { all | { resource | service } item-name }

Parameters
Parameter Description Value

all Displays all information -


about the PAF file.

resource Specifies the value set for a -


resource item in the PAF
file.

service Specifies the value set for a -


service item in the PAF file.

item-name Specifies the name of a The value is a string of 1 to


resource item or a service 64 characters.
item.

Views
All views

Default Level
1: Monitoring level

Usage Guidelines
A PAF file provides only required resources and features. This command can
display all the specification information about the PAF file.

Example
# Display the value set for a resource item in the PAF file.
<Huawei> display paf resource PAF_LCS_NQA_SPECS_NUM_ENTRY
PAF_LCS_NQA_SPECS_NUM_ENTRY = 0, 128, 128, 0

# Display the value set for a service item in the PAF file.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 412


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

<Huawei> display paf service PAF_LCS_BFD_BASIC_SPECS_ENABLED


PAF_LCS_BFD_BASIC_SPECS_ENABLED = 0, 1

Table 3-58 Description of the display paf resource command output

Item Description

PAF_LCS_NQA_SPECS_NUM_ENTRY Resource item name in the PAF file.

0 Whether a resource item is controlled


by a license.
● 1: yes
● 0: no

128 Default value of the resource item in


the PAF file.

128 Maximum value of the resource item


in the PAF file.

0 Minimum value of the resource item in


the PAF file.

Table 3-59 Description of the display paf service command output

Item Description

PAF_LCS_BFD_BASIC_SPECS_ENABLED Service item name in the PAF file.

0 Whether a service item is controlled by


a license.
● 1: yes
● 0: no

1 Service status.
● 1: enabled
● 0: disabled

3.13.8 display patch-information

Function
The display patch-information command displays information about the patch in
the current system.

Format
display patch-information

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 413


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Parameters
None

Views
All views

Default Level
1: Monitoring level

Usage Guidelines
After a patch is loaded or deleted, run this command to view information about
the patch, including its version, name.

Example
# Display information about the patch in the current system.
<Huawei> display patch-information
Patch version :ARV200R009C00
Patch package name :flash:/patch_ar650.pat
The state of the patch state file is:Running
The current state is:Running
******************************************************************
* The patch information,as follows *
******************************************************************
Type State Count Time(YYYY-MM-DD HH:MM:SS)
------------------------------------------------------------------
exe Running 1 2017-12-31 09:23:46+00:00

Table 3-60 Description of the display patch-information command output

Item Description

Patch version Version of the patch.

Patch package name Name of the patch file.

The state of the patch state file is Status of the patch file.

The current state is Current status of the patch.

Type Patch type.


● VRP: VRP patch for the MPU.
● CAP: CAP patch for the MPU.
● Kernel: Patch for the kernel.
● LPU: Patch for the LPU.
● soft: Patch for the software.
● exe: Patch for the file.

State Running status of the patch. (Running: The


patch is running.)

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 414


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Item Description

Count Number of patch units.

Time(YYYY-MM-DD HH:MM:SS) Time when the patch takes effect.

Related Topics
3.13.16 patch delete all
3.13.17 patch load

3.13.9 display rollback state

Function
The display rollback state command displays the rollback status of the system.

Format
display rollback state

Parameters
None

Views
All views

Default Level
1: Monitoring level

Usage Guidelines
This command enables you to:

● Check whether the rollback function is enabled.


● Preview the files used after a version rollback to avoid an unexpected
rollback.
● The rollback status can be displayed only if the rollback command can be
used. Therefore, the display rollback state command can display the rollback
status only when the following conditions are met: the system software for
rollback exists, the current software package is different from the previous
system software package, and no new package is specified for next startup
using the startup system-software command.
● If no rollback system software exists, a message "Rollback function is disabled
in current state" will be displayed when you run the display rollback state
command.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 415


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Example
# Preview the files used after a version rollback. The names and paths of various
startup files used in the rollback version are displayed if the rollback function is
enabled in the system.
<Huawei> display rollback state
Info: Rollback function is enabled in current state
The booting parameters for rollback are as follows:
Rollback system software: sd1:/software.cc
Rollback saved-configuration file: sd1:/iascf_autobackup.zip
Rollback license file: null
Rollback patch package: null
Rollback voice-files: null

Table 3-61 Description of the display rollback state command output

Item Description

Rollback system software System software package used after the


rollback.

Rollback saved-configuration file Configuration file used after the rollback.

Rollback license file License file used after the rollback.

Rollback patch package Patch file used after the rollback.

Rollback voice-files Voice file used after the rollback.

Related Topics
3.13.18 rollback

3.13.10 license active

Function
The license active command activates the license file saved in the storage of the
device.

Format
license active file-name

Parameters
Parameter Description Value

file-name Specifies the name of a The value is a string of 1


license file. to 64 characters without
spaces.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 416


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Views
User view

Default Level
3: Management level

Usage Guidelines
Usage Scenario
Change or upgrade the license file when the current license file is outdated or
needs higher specifications and more features. The initial state of a license file is
inactive and the license file does not take effect in the system. Run this command
to activate the new or updated license file.
The license active command can be used to activate a license file in the following
situations:
● The license needs to be activated for the first time.
You can directly run this command to activate a license.
● The current license file needs to be updated.
If the specifications of the new license file are lower than those of the current
license file, the system displays a message asking you whether to continue. If
you choose No, the system retains the current license file. If you choose Yes,
the master MPU activates the current license file and the system uses the new
license file.
Prerequisites
The new license file has been uploaded to the device.
Follow-up Procedure
When the system restarts, the system activates the license file that was activated
last time to ensure the license files are the same before and after restart.
Precautions
● The license file must use .dat as file name extension and be saved to the
default root directory in the storage of the device.
● If no path is specified, the license file in the working path is activated by
default.
● If the specifications of the new license file are lower than those of the current
license file (some functions are authorized in the current license file, but not
in the new license file, or the new license file allows fewer resources than the
current one), the system displays a message asking you whether to continue.
● When applying for a license, ensure that the ESN is case sensitive. If the case
of the device ESN is different from that of the ESN in the license file, the
license file cannot be activated.

Example
# Activate license.dat in the storage of the device.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 417


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

<Huawei> license active license.dat

3.13.11 license active accept agreement


Function
The license active accept agreement command activates the ETU license.
The undo license active accept agreement command deactivates the ETU
license.
By default, the ETU license is deactivated.

Format
license active accept agreement
undo license active accept agreement

Parameters
None

Views
User view

Default Level
3: Management level

Usage Guidelines
After the license active accept agreement command is executed, the system asks
you whether to sign the agreement:
● If you enter yes, the agreement is signed and this event is logged.
● If you enter no, the ETU license is deactivated.

Example
# Activate the ETU license.
<Huawei> license active accept agreement
Dear Customer,

You will active the interim ETU (Easy to Use) license for featured functions of the AR, please read the
followings carefully.

After the activation of the interim ETU license for featured functions of the AR, you can conduct evaluation
of the featured functio
ns for a period of sixty (60) days.After the sixty (60) days evaluation period, the interim license will
automatically convert to th
e perpetual license. Continuing use of the featured functions of the product after the evaluation period
requires the perpetual lice
nse, together with the additional payment. Otherwise please close the ETU license for featured functions,
and stop using the feature
d functions.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 418


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Without purchasing the perpetual license from Huawei, the continuing use of the product will constitute
the inappropriate use beyond
the interim license and infringement of rights of Huawei. The activation of the software command line
interface will be evidence of
your acceptance of the perpetual license. Huawei will reserve all necessary rights to prosecute and to seek
all remedies at law and
in equity.

ACCEPT? Yes or No[y/n]:y


INFO: Succeeded in activating the ETU license.

# Deactivate the ETU license.


<Huawei> undo license active accept agreement
INFO: Succeeded in inactivating the ETU license.

3.13.12 license emergency

Function
The license emergency command enables the emergency state for the license.

Format
license emergency

Parameters
None

Views
User view

Default Level
3: Management level

Usage Guidelines
Usage Scenario

The system configuration is classified into maximum configuration, authorized


configuration, and minimum configuration.

● In maximum configuration, the maximum number of dynamic resource items


are configured. Static resource items and function items are configured
according to license configuration.
● Authorization configuration means the functions and resources of the
software configured on the basis of contract or special authorization.
Authorized configuration depends on feature authorization of license files.
● The minimum configuration is the default configuration when no activated
license file exists in the system. The minimum configuration varies according
to products.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 419


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Configurations are classified to limit the bearer capability of the system in


different running status.
When you run the license emergency command to enable the emergency state
for the license, the system is free from license control. In this case, the system can
run with the maximum configuration of dynamic resources and the license-
defined configuration of static resources and functions. When the validity period
of the emergency state expires, dynamic resources are controlled by the license
again. One version is provided with three validity periods of emergency state, each
lasting for seven days.
The purpose for enabling the emergency state for the GTL license is disaster
tolerance. If an earthquake takes place, for example, this mechanism protects
users' services from being affected.
Precautions
● The emergency state cannot be disabled manually.
● The emergency state can only be enabled three times for each license, and
the license can keep in emergency state for 7 days each time.
● The next emergency state can be enabled only on the last day when the last
emergency state expires.

Example
# Enable the license emergency state.
<Huawei> license emergency
Warning: This operation will cause LCS into the EMERGENCY state. Continue? [Y/N]:y
Info: Emergency started cannot be stopped.

Related Topics
3.13.10 license active

3.13.13 license function


Function
The license function command activates the license of a function item.
The undo license function command deactivates the license of a function item.
By default, the license of a function item is deactivated.

Format
license function name
undo license function name

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 420


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Parameters
Parameter Description Value

name Specifies the name of Enumeration value. The


the activated ETU license options are as follows:
function item. ● ac: WLAN AC Express
● datae: data service
● dsvpn: DSVPN
● sece: security service
● voicee: voice service

Views
User view

Default Level
3: Management level

Usage Guidelines
Usage Scenario

The license function command activates the license of a function item through
the ETU license.

Prerequisites

The ETU license has been activated using the license active accept agreement
command.

Precautions

● If the license active accept agreement command is not executed, an error


message is displayed.
● You do not need to activate the license that has been activated.
● After the license is activated, there is a trial period of 60 days. After the trial
period of 60 days, you use of the controlled function will be governed by
Huawei license agreement. You must purchase the license or stop using the
activated function after the trial period.

Example
# Activate the data service.
<Huawei> license function datae
INFO: Succeeded in activating the feature.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 421


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

3.13.14 license resource


Function
The license resource command activates the license of a resource item.
The undo license resource command deactivates the license of a resource item.
By default, the license of a resource item is deactivated.

Format
license resource name value
undo license resource name

Parameters
Parameter Description Value

name Specifies the name of Enumeration value. The


the activated ETU license options are as follows:
resource item. ● cm: number of
phones that are
calling

value Specifies the value of a The value is an integer.


resource item. The value range depends
on the resource license.

Views
User view

Default Level
3: Management level

Usage Guidelines
Usage Scenario
The license resource command activates the license of a resource item.
Prerequisites
The ETU license has been activated using the license active accept agreement
command.
Precautions
● If the license active accept agreement command is not executed, an error
message is displayed.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 422


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

● You do not need to activate the license that has been activated.
● After the license is activated, there is a trial period of 60 days. After the trial
period of 60 days, your use of the controlled function will be governed by
Huawei license agreement. You must purchase the license or stop using the
activated function after the trial period.

Example
# Activate the license of a resource item.
<Huawei> license resource cm 10
INFO: Succeeded in activating the feature.

3.13.15 license revoke


Function
The license revoke command revokes a license file.

Format
license revoke

Parameters
None

Views
User view

Default Level
3: Management level

Usage Guidelines
Usage Scenario

License is an authorization file. You can apply for, upgrade, or activate the license
file to get corresponding user rights.

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 need to be expanded, you can
update the licenses used on the devices to enable more license-controlled features
and functions.

You can upgrade a license file to:

● Add new features.


● Optimizes device performance.
● Fix bugs in the current version.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 423


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Before updating a license file, run the license revoke command to revoke the
existing license. The system then returns a license revocation code. This code is the
evidence for license invalidation and is used to apply for a new license.

A license revocation code is a character string generated after a license file becomes invalid.
You can determine that a license file is invalid based on the corresponding revocation code.

Precautions
● When the existing license is going to expire, apply for a new license, upgrade,
and activate the license. If the license has expired, the service modules are
disabled and services are interrupted.
● After you run the license revoke command, the license file enters the Trial
state and cannot be activated again regardless of how long the license file
will expire.

Example
# Revoke the current license file.
<Huawei> license revoke

Related Topics
3.13.10 license active

3.13.16 patch delete all


Function
The patch delete all command deletes patches on the current system.

Format
patch delete all

Parameters
None

Views
User view

Default Level
3: Management level

Usage Guidelines
● If you find errors in patches that have been loaded to the system, run this
command to delete the patches to prevent patch errors from affecting system
operating.

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 424


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

● Before loading a non-incremental patch, run this command to delete the


existing patches (if any). Otherwise, the non-incremental patch cannot be
loaded.

Example
# Delete all patches.
<Huawei> patch delete all

Related Topics
3.13.8 display patch-information

3.13.17 patch load


Function
The patch load command loads the patches to the patch areas in the system.

Format
patch load filename all run

Parameters
Parameter Description Value

filename Specifies the path and The value is a string of5


file name of a patch to 64 case-insensitive
package. The path can characters without
be an absolute path or a spaces. The file name
relative path. must have an extension
of .pat.

all Loads the patches of all -


boards.

run Runs loaded patches of -


all boards.

Views
User view

Default Level
3: Management level

Usage Guidelines
Usage Scenario

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 425


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

When you load a patch to the current system, the system searches the patch
package for a matching patch file according to the attributes of the patch file.
● If a matching patch file is found in the patch package, the system loads the
patch.
● If no matching patch file is found in the patch package, the system does not
load any patch.

Prerequisites

The patch package has been uploaded to the root directory of the storage device.

Before loading a patch, the system must resolve the patch package, check the
validity of the patch files in the patch package, and obtain the attributes such as
the patch type and version of the patch file.

Precautions

The patch file cannot be reloaded. When you reload a patch, the system displays
an error message.

Example
# Load the patches to the patch area of the device and run the patches directly.
<Huawei> patch load patch.pat all run

Related Topics
3.13.16 patch delete all
3.12.23 startup patch
3.13.8 display patch-information

3.13.18 rollback

Function
The rollback command rolls back the system to the previous version.

Format
rollback

Parameters
None

Views
User view

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 426


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Default Level
3: Management level

Usage Guidelines
Usage Scenario

If an error occurs during an upgrade, cancel the current upgrade and run the
rollback command to roll back the system to the previous version. After the
rollback, the configuration of the device is the same as the previous configuration
before upgrading.

You can delete the rollback software using the delete (user view) command.
After the rollback software is deleted, a message will be displayed saying that the
rollback function is unavailable if you run the rollback and display rollback state
commands.

Prerequisites

The device has the rollback software. The current software package is different
from the previous software package, and no new package is configured for next
startup using the startup system-software system-file command.

Example
# Roll back the system to the previous version. After you run the command, a
message will be displayed ask you whether to continue. If you choose y, the
system rolls back to its previous version. If you choose n, no operation will be
performed.
<Huawei> rollback
After rollback, active board will reboot automatically. Please check if data has
been saved
Are you sure to rollback? (y/n)[n]:y

Related Topics
3.13.9 display rollback state

3.13.19 set output slot

Function
The set output slot command redirects LPU information to the SRU.

The undo set output slot command cancels redirection of LPU information to the
SRU.

Format
set output slot slot-id

undo set output slot slot-id

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 427


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

Parameters
Parameter Description Value

slot-id Specifies the slot ID. The value varies with the
device configuration.

Views
System view

Default Level
3: Management level

Usage Guidelines
Usage Scenario
You can upgrade the system software through the BIOS menu of the SAE card.
Precautions
● You can run this command to redirect output information of the SAE card but
not other cards to the SRU.
● You can perform the redirection operation using only the Telnet provided by a
Windows operating system, Putty.
● The terminal modes supported include VTY100, Linux, and Xterm.
● When the message "Press <DEL> or <F2> to enter setup" is displayed on the
screen, you must press F2 to enter the BIOS page.
● The up, down, left, and right buttons on the keyboard are displayed as ^, V, <,
and > on the BIOS page.
● If you use the Hyper Terminal provided by the Windows operating system to
redirect output information, the device responses slowly because the default
transmission rate of a serial port is 9600 bit/s. You are advised to change the
rate to 115,200 bit/s and then establish a connection again.

Example
# Redirect output information about the SAE card to the SRU.
<Huawei> system-view
[Huawei] set output slot 2
******************************************************
* Slot 2 output to mainboard *
******************************************************
Press Ctrl+D to quit

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 428


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

3.13.20 upgrade slot startup bootrom (User view)


Function
The upgrade slot startup bootrom command updates the BootROM of a board
to the BootROM version of the system software.

● MPUs on the AR100, AR120, and AR3200 series routers support this command.
● MPUs on the AR161, AR161EW, AR161EW-M1, AR161G-L, AR161G-Lc, AR161G-U,
AR161W, AR169, AR169CVW, AR169CVW-4B4S, AR169EW, AR169EGW-L,
AR169FVW-8S, AR169G-L, AR169W-P-M9, and AR169RW-P-M9 among the AR160
series routers support this command.
● MPUs on the AR1220-8GE and AR1220C among the AR1200 series routers support this
command.
● MPUs on the AR2204E, AR2204E-D, AR2204-24GE, AR2204-27GE-P, AR2204-51GE,
AR2204-51GE-P, and AR2204-51GE-R among the AR2200 series routers support this
command.

Format
upgrade slot slot-id startup bootrom

Parameters
Parameter Description Value

slot-id Specifies the slot ID of a The value varies with the


registered LPU. device configuration.

Views
User view

Default Level
2: Configuration level

Usage Guidelines
Usage Scenario
Boards do not support automatic loading of the corresponding BootROM.
Generally, the BootROM does not need to be upgraded. However, if an exception
occurs due to a fault in the BootROM, you need to run this command to manually
upgrade the BootROM.
If the main control board cannot automatically upgrade the BootROM during a
system software upgrade, you need to run this command to manually upgrade the
BootROM.
Precautions

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 429


Huawei AR Series Access Routers
Command Reference 3 Basic Configurations Commands

The 9ES2, 24ES2GP, 4ES2G-S, 4ES2GP-S, 1GEC, 4GECS, 2X10GL, 3G-HSPA+7, 3G-
EVDO, 1LTE-L, 1LTE-LV, 1LTEC, 1LTE-Lt, 1LTE-Lo, 1LTE-Lc, 1STM1, 1STM4, 4STM1,
16FXS, 32FXS, 1GBIS4W, 1NDE, SMXH, and DGP cards do not support this
command.

NOTICE

Ensure normal power supply to the device when you are manually upgrading the
BootROM. The component whose BootROM is upgraded may be permanently
damaged once the device is powered off during manual upgrade of the BootROM.

Example
# Upgrade the BootROM in slot 1 using the current system software package.
<Huawei> upgrade slot 1 startup bootrom
<Huawei> upgrade slot 1 startup bootrom
Warning: You can not reset, remove, or power off the board when upgrade is being
performed, are you sure to continue?[Y/N]:y
Info: Please waiting..
Info: Online upgrade slot <1>, item <BootRom>, ok.
Info: Please reset the board in slot 1 to take effect.
Warning: The operation will reset the board in slot 1. Continue? [y/
n]:n

Issue 08 (2020-04-17) Copyright © Huawei Technologies Co., Ltd. 430

You might also like