01-Fundamentals Command Reference

HomeSupportRoutersSR6602-I[IE] SeriesReference GuidesCommand ReferencesH3C SR6602-I[IE] AI-Powered ICT Converged Gateways Command References(V9)- R9141-6W10001-Fundamentals Command Reference
03-Login management commands
Title Size Download
03-Login management commands 448.62 KB

Contents

Login management commands· 1

activation-key· 1

authentication-mode· 3

auto-execute command· 4

command accounting· 6

command authorization· 6

databits· 7

display | original-encoding· 8

display character-encoding· 9

display https ssl-server-policy· 10

display line· 12

display telnet client 13

display user-interface· 14

display users· 15

display web menu· 16

display web users· 17

display websocket connection· 18

escape-key· 19

flow-control 20

free line· 21

free user-interface· 22

free web users· 22

history-command max-size· 23

http acl 23

http idle-timeout 24

http ipv6 acl 25

http method· 26

http slow-attack· 27

http slow-attack defense enable· 28

http url allowlist 29

https acl 29

https ipv6 acl 30

idle-timeout 31

ip http preflight enable· 32

line· 33

line class· 33

lock· 35

lock reauthentication· 36

lock-key· 36

parity· 37

protocol inbound· 38

screen-length· 40

send· 41

set authentication password· 42

shell 42

speed· 43

stopbits· 44

telnet 45

telnet client source· 46

telnet ipv6· 47

telnet server acl 48

telnet server acl-deny-log enable· 49

telnet server dscp· 49

telnet server enable· 50

telnet server ipv6 acl 50

telnet server ipv6 dscp· 51

telnet server ipv6 port 52

telnet server login-failed threshold-alarm·· 52

telnet server port 54

terminal character-encoding· 54

terminal type· 55

user-interface· 56

user-interface class· 57

user-role· 58

web captcha· 59

web https-authorization mode· 60

web idle-timeout 61

webui log enable· 61

 


Login management commands

Some login management commands are available in both user line view and user line class view. For these commands, the device uses the following rules to determine the settings to be activated:

·     A setting in user line view applies only to the user line. A setting in user line class view applies to all user lines of the class.

·     A non-default setting in either view takes precedence over a default setting in the other view. A non-default setting in user line view takes precedence over a non-default setting in user line class view.

·     A setting in user line class view takes effect on login sessions that are established after the setting is configured.

activation-key

Use activation-key to set the terminal session activation key. Pressing this shortcut key starts a terminal session.

Use undo activation-key to restore the default.

Syntax

activation-key key-string

undo activation-key

Default

The terminal session activation key is Enter.

Views

User line view

User line class view

Predefined user roles

network-admin

Parameters

key-string: Specifies a shortcut key. It can be a character (case sensitive), or an ASCII code value in the range of 0 to 127. For example, if you execute activation-key 1, the shortcut key is Ctrl+A. If you execute activation-key a, the shortcut key is a. For information about ASCII code values of individual characters, see the standard ASCII code chart. For information about ASCII code values of combined keys that use the Ctrl key, see Table 1.

Usage guidelines

This command is not supported in VTY line view or VTY line class view.

This command takes effect immediately.

This command is available in both user line view and user line class view. A non-default setting in either view takes precedence over a default setting in the other view. A non-default setting in user line view takes precedence over a non-default setting in user line class view.

You can use only the specified terminal session activation key to start a terminal session. To display the current terminal session activation key, use the display current-configuration | include activation-key command.

Table 1 ASCII code values for combined keys that use the Ctrl key

Combined key

ASCII code value

Ctrl+A

1

Ctrl+B

2

Ctrl+C

3

Ctrl+D

4

Ctrl+E

5

Ctrl+F

6

Ctrl+G

7

Ctrl+H

8

Ctrl+I

9

Ctrl+J

10

Ctrl+K

11

Ctrl+L

12

Ctrl+M

13

Ctrl+N

14

Ctrl+O

15

Ctrl+P

16

Ctrl+Q

17

Ctrl+R

18

Ctrl+S

19

Ctrl+T

20

Ctrl+U

21

Ctrl+V

22

Ctrl+W

23

Ctrl+X

24

Ctrl+Y

25

Ctrl+Z

26

CTRL+ [

27

CTRL+\

28

CTRL+]

29

CTRL+^

30

CTRL+_

31

Examples

# Configure character s as the terminal session activation key for console line 0.

<Sysname> system-view

[Sysname] line console 0

[Sysname-line-console0] activation-key s

To verify the configuration:

1.     Exit the console session.

[Sysname-line-console0] return

<Sysname> quit

2.     Log in again through the console line.

The following message appears:

Press ENTER to get started.

3.     Press Enter.

Pressing Enter does not start a session.

4.     Press s.

A terminal session is started.

<Sysname>

authentication-mode

Use authentication-mode to set the authentication mode for a user line.

Use undo authentication-mode to restore the default.

Syntax

authentication-mode { none | password | scheme }

undo authentication-mode

Default

The authentication mode is none for console login.

The authentication mode is password for the VTY line.

Views

User line view

User line class view

Predefined user roles

network-admin

Parameters

none: Disables authentication.

password: Performs local password authentication.

scheme: Performs AAA authentication. For more information about AAA, see User Access and Authentication Configuration Guide.

Usage guidelines

CAUTION

CAUTION:

·     When authentication is disabled, users can login without authentication. For security purpose, disable authentication with caution.

·     When you enable password authentication, you must also configure an authentication password for the line or line class. If no authentication password is configured, you cannot log in to the device through the line or line class at the next time.

·     When you enable scheme authentication, make sure an authentication user account is available. If no authentication user account is available, you cannot log in to the device through the line or line class at the next time.

 

Only users assigned the network-admin, or level-15 user role can execute this command. Other users cannot execute this command, even if they are granted the right to execute this command.

In VTY line view, this command is associated with the protocol inbound command.

·     If the settings of the two commands in VTY line view are both the default settings, the settings for the commands in VTY line class view take effect.

·     If the settings of the two commands in VTY line view are both non-default settings, the non-default settings in VTY line view take effect.

·     If only one command has a non-default setting in VTY line view, the other command uses the default setting, regardless of the setting in VTY line class view.

An authentication mode change does not take effect on the current session. It takes effect on subsequent login sessions.

Examples

# Enable the none authentication mode for VTY line 0.

<Sysname> system-view

[Sysname] line vty 0

[Sysname-line-vty0] authentication-mode none

# Enable password authentication for VTY line 0 and set the password to hello12345.

<Sysname> system-view

[Sysname] line vty 0

[Sysname-line-vty0] authentication-mode password

[Sysname-line-vty0] set authentication password simple hello12345

# Enable scheme authentication for VTY line 0. Configure the local user test and set the password to hello12345. Assign the Telnet service and the user role network-admin to the user.

<Sysname> system-view

[Sysname] line vty 0

[Sysname-line-vty0] authentication-mode scheme

[Sysname-line-vty0] quit

[Sysname] local-user test

[Sysname-luser-manage-test] password simple hello12345

[Sysname-luser-manage-test] service-type telnet

[Sysname-luser-manage-test] authorization-attribute user-role network-admin

Related commands

set authentication password

auto-execute command

Use auto-execute command to specify the command to be automatically executed for a login user.

Use undo auto-execute command to restore the default.

Syntax

auto-execute command command

undo auto-execute command

Default

No command is specified to be automatically executed for a login user.

Views

User line view

User line class view

Predefined user roles

network-admin

Parameters

command: Specifies the command to be automatically executed.

Usage guidelines

CAUTION

CAUTION:

After using this command for a user line, you might be unable to access the CLI through the user line. Make sure you can access the CLI through a different user line before you execute this command and save the configuration.

The device will automatically execute the specified command when a user logs in through the user line, and close the user connection after the command is executed.

This command is not supported in console line view or console line class view.

This command is available in both user line view and user line class view. A non-default setting in either view takes precedence over a default setting in the other view. A non-default setting in user line view takes precedence over a non-default setting in user line class view.

A configuration change made by this command does not take effect on the current session. It takes effect on subsequent login sessions.

Examples

# Configure the device to automatically execute the telnet 192.168.1.41 command when a user logs in through VTY line 0.

<Sysname> system-view

[Sysname] line vty 0

[Sysname-line-vty0] auto-execute command telnet 192.168.1.41

This action will lead to configuration failure through line-vty0. Are you sure?

[Y/N]:y

[Sysname-line-vty0]

# To verify the configuration, Telnet to the device (192.168.1.40).

The device automatically Telnets to 192.168.1.41. The following output is displayed on the configuration terminal:

C:\> telnet 192.168.1.40

******************************************************************************

* Copyright (c) 2004-2020 New H3C Technologies Co., Ltd. All rights reserved.*

* Without the owner's prior written consent,                                 *

* no decompiling or reverse-engineering shall be allowed.                    *

******************************************************************************

 

Trying 192.168.1.41 ...

Press CTRL+K to abort

Connected to 192.168.1.41 ...

******************************************************************************

* Copyright (c) 2004-2020 New H3C Technologies Co., Ltd. All rights reserved.*

* Without the owner's prior written consent,                                 *

* no decompiling or reverse-engineering shall be allowed.                    *

******************************************************************************

<Sysname.41>

This operation is the same as directly logging in to the device at 192.168.1.41 through Telnet. When you close the Telnet connection to 192.168.1.41, the Telnet connection to 192.168.1.40 is closed at the same time.

command accounting

Use command accounting to enable command accounting.

Use undo command accounting to disable command accounting.

Syntax

command accounting

undo command accounting

Default

Command accounting is disabled. The accounting server does not record executed commands.

Views

User line view

User line class view

Predefined user roles

network-admin

Usage guidelines

When command accounting is enabled but command authorization is not, every executed command is recorded on the HWTACACS server. When both command accounting and command authorization are enabled, only authorized commands that are executed are recorded on the HWTACACS server.

Invalid commands are not recorded.

A configuration change made by this command does not take effect on the current session. It takes effect on subsequent login sessions.

After you execute the command accounting command in user line class view, you cannot execute the undo command accounting command in any user line views in the class.

Examples

# Enable command accounting for VTY line 0.

<Sysname> system-view

[Sysname] line vty 0

[Sysname-line-vty0] command accounting

Related commands

accounting command (User Access and Authentication Command Reference)

command authorization

command authorization

Use command authorization to enable command authorization.

Use undo command authorization to disable command authorization.

Syntax

command authorization

undo command authorization

Default

Command authorization is disabled. Logged-in users can execute commands without authorization.

Views

User line view

User line class view

Predefined user roles

network-admin

Usage guidelines

When command authorization is enabled, a user can only use commands that are permitted by both the AAA scheme and user role.

To have command authorization take effect, you must set the authentication mode for device login to scheme. If the authentication mode is none or password, command authorization will not take effect after you execute the command authorization command.

A configuration change made by this command does not take effect on the current session. It takes effect on subsequent login sessions.

If you execute the command authorization command in user line class view, command authorization is enabled for all user lines in the class. You cannot execute the undo command authorization command in the view of a user line in the class.

Examples

# Enable command authorization for VTY line 0.

<Sysname> system-view

[Sysname] line vty 0

[Sysname-line-vty0] command authorization

Related commands

authorization command (User Access and Authentication Command Reference)

command accounting

databits

Use databits to specify the number of data bits for a character.

Use undo databits to restore the default.

Syntax

databits { 7 | 8 }

undo databits

Default

Eight data bits are used for a character.

Views

User line view

Predefined user roles

network-admin

Parameters

7: Uses seven data bits for a character.

8: Uses eight data bits for a character.

Usage guidelines

This command is not supported in VTY line class view.

This setting must be the same as the setting on the configuration terminal.

Examples

# Configure console line 0 to use seven data bits for a character.

<Sysname> system-view

[Sysname] line console 0

[Sysname-line-console0] databits 7

display | original-encoding

Use display | original-encoding to convert the output from a command from the original encoding to the specified encoding.

Syntax

display command | original-encoding { gb18030 | utf-8 }

Default

The original encoding is the system encoding.

Views

Any view

Predefined user roles

network-admin

Parameters

gb18030: Specifies the GB18030 encoding.

utf-8: Specifies the UTF-8 encoding.

Usage guidelines

When you execute only the display command command, the device displays the output from the specified command in the system encoding. The display command | original-encoding { gb18030 | utf-8 } command enables the device to convert the output from the specified command to the specified encoding.

This feature is mainly used to identify whether the current configuration or command output can be correctly parsed in a new character encoding. If the matching information cannot be correctly parsed, perform one of following operations:

·     Modify the command lines that cannot be correctly parsed, and then reboot the device.

·     Reboot the device for the new character encoding to take effect, and then modify the command lines that cannot be correctly parsed.

Examples

# Convert the current configuration from the original encoding to the UTF-8 encoding.

<Sysname> display current-configuration | include sysname | origin-encoding utf-8

sysname 中文

Related commands

display character-encoding

terminal character-encoding

display character-encoding

Use display character-encoding to display the character encoding information on the device or login terminal.

Syntax

display character-encoding [ terminal ]

Views

Any view

Predefined user roles

network-admin

Parameters

terminal: Displays the character encoding used on the login terminal. If you do not specify this keyword, this command displays the character encoding used on the device.

Usage guidelines

For the user's login terminal to correctly display Chinese characters in the messages received from the device, the device and the terminal must use the same character encoding.

Use the display character-encoding terminal command to identify the character encoding used on the login terminal. The device will send test characters in both UTF-8 and GB18030 encodings to the login terminal. The test characters will be displayed as 中文 for the character encoding used on the login terminal.

Examples

# Display the current character encoding information on the device.

<Sysname> display character-encoding

Current system character encoding: NULL

Next system character encoding: UTF-8

Default terminal character encoding: UTF-8

SNMP character encoding: UTF-8

Encoding check: Enable

# Display the current character encoding information on the login terminal.

<Sysname>display character-encoding terminal

Character encoding            Test characters

UTF-8                         涓枃    

GB18030                       中文

Current terminal character encoding: GB18030

Table 2 Command output

Field

Description

Current system character encoding

Current character encoding used by the system. Options include UTF-8, GB18030, and NULL. The NULL option indicates that no system character encoding is configured.

Next system character encoding

System character encoding that will take effect after device reboot. Options include UTF-8, GB18030, and NULL. The NULL option indicates that no system character encoding is configured.

Default terminal character encoding

Character encoding used on CLI terminals. Options include UTF-8 and GB18030.

SNMP character encoding

Character encoding used by SNMP clients. Options include UTF-8 and GB18030.

Encoding check

Enablement status of encoding check. Options include Enable and Disable.

Character encoding

Character encoding used by the device to send test strings to the login terminal. Options include UTF-8 and GB18030.

Test characters

Parsing result of the test characters.

The test characters will be displayed as 中文 for the character encoding used on the login terminal.

Current terminal character encoding

Character encoding currently used on the current terminal. Options include UTF-8 and GB18030.

Related commands

character-encoding

terminal character-encoding

display https ssl-server-policy

Use display https ssl-server-policy to display information about SSL server policies associated with the HTTPS service.

Syntax

display https ssl-server-policy [ port port-number ]

Views

Any view

Predefined user roles

network-admin

network-operator

Parameters

port port-number: Specifies an HTTPS port by its port number. The value range for the port-number argument is 1 to 65535. If you do not specify this option, this command displays information for all HTTPS ports.

Usage guidelines

You can execute this command to obtain information about SSL server policies associated with the HTTPS service, including open service port, registered URL, and policy name.

Examples

# Display information about SSL server policies associated with the HTTPS service.

<Sysname> display https ssl-server-policy

HTTPS port: 832

Address family: IPv4

SSL server policy: Not configured

URL: /soap/netconf/

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

HTTPS port: 832

Address family: IPv6

SSL server policy: Not configured

URL: /soap/netconf/

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

HTTPS port: 443

Address family: IPv4

SSL server policy: policy-test

URL: /doc/

/websocket/cli/

/api/v1/deviceList

/doc/

/websocket/cli

/wnm/

/wnm/check.j

/wnm/frame/changepswd.php

/wnm/frame/login.php

/wnm/frame/redirect.php

/wnm/vcode.bmp

/wnm/weakPasswordLog.j

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

HTTPS port: 443

Address family: IPv6

SSL server policy: policy-test

URL: /doc/

/websocket/cli/

/api/v1/deviceList

/doc/

/websocket/cli

/wnm/

/wnm/check.j

/wnm/frame/changepswd.php

/wnm/frame/login.php

/wnm/frame/redirect.php

/wnm/vcode.bmp

/wnm/weakPasswordLog.j

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

Table 3 Command output

Field

Description

HTTPS port

HTTPS service port.

Address family

Address family type, including IPv4 and IPv6.

SSL server policy

Name of the SSL server policy.

URL

URL for service registration.

Related commands

display ssl server-policy

ip https ssl-server-policy

ssl server-policy (Security Command Reference)

display line

Use display line to display user line information.

Syntax

display line [ number1 | { console | vty } number2 ] [ summary ]

Views

Any view

Predefined user roles

network-admin

network-operator

Parameters

number1: Specifies the absolute number of a user line. The value range is 0 to 66.

console: Specifies the console line.

vty: Specifies the VTY line.

number2: Specifies the relative number of a user line. The value range is 0 to 2 for console lines and 0 to 63 for VTY lines.

summary: Displays summary information about user lines. If you do not specify this keyword, the command displays detailed information.

Examples

# Display information about line 0.

<Sysname> display line 0

  Idx  Type     Tx/Rx      Modem Auth  Int        Location

F 0    CON 0    9600       -     N     -           0/0

 

  +    : Line is active.

  F    : Line is active and in async mode.

  Idx  : Absolute index of line.

  Type : Type and relative index of line.

  Auth : Login authentication mode.

  Int  : Physical port of the line.

  A    : Authentication use AAA.

  N    : No authentication is required.

  P    : Password authentication.

Table 4 Command output

Field

Description

Modem

This field is not supported in the current software version.

Whether the modem allows calling in or out. By default, this attribute is not configured and this field displays a hyphen (-).

Int

Physical port for the line. If there is no physical port for the line or the port is a console port, this field displays a hyphen (-).

Location

Physical position of the line, in the form of slot number/CPU number.

# Display summary information about all user lines.

<Sysname> display line summary

  Line type : [CON]                                                            

           0:XXX                                                                

  Line type : [VTY]                                                            

           3:UUUX XXXX XXXX XXXX                                               

          19:XXXX XXXX XXXX XXXX                                               

          35:XXXX XXXX XXXX XXXX                                               

          51:XXXX XXXX XXXX XXXX                                               

                                                                               

   3 lines used.      (U)                                                      

  64 lines not used.  (X)

Table 5 Command output

Fields

Description

Line type

Type of the user line:

·     CON—Console line.

·     VTY—VTY line.

number:status

number: Absolute number of the first user line in the user line class.

status: User line status. X is for unused and U is for used.

display telnet client

Use display telnet client to display the packet source setting for the Telnet client.

Syntax

display telnet client

Views

Any view

Predefined user roles

network-admin

network-operator

Usage guidelines

This command displays the source IPv4 address or source interface specified for the Telnet client to use in outgoing Telnet packets, depending on the telnet client source command.

Examples

# Display the packet source setting for the Telnet client.

<Sysname> display telnet client

 The source IP address is 1.1.1.1.

Related commands

telnet client source

display user-interface

Use display user-interface to display user line information.

Syntax

display user-interface [ number1 | { console | vty } number2 ] [ summary ]

Views

Any view

Predefined user roles

network-admin

network-operator

Parameters

number1: Specifies the absolute number of a user line. The value range is 0 to 66.

console: Specifies the console line.

vty: Specifies the VTY line.

number2: Specifies the relative number of a user line. The value range is 0 to 2 for console lines and 0 to 63 for VTY lines.

summary: Displays summary information about user lines. If you do not specify this keyword, the detailed information is displayed.

Usage guidelines

This command is an older version reserved for backward compatibility purposes. It has the same functionality and output as the display line command. As a best practice, use the display line command.

Examples

# Display information about line 0.

<Sysname> display user-interface 0

  Idx  Type     Tx/Rx      Modem Auth  Int        Location

F 0    CON 0    9600       -     N     -          0/0

 

  +    : Line is active.

  F    : Line is active and in async mode.

  Idx  : Absolute index of line.

  Type : Type and relative index of line.

  Auth : Login authentication mode.

  Int  : Physical port of the line.

  A    : Authentication use AAA.

  N    : No authentication is required.

  P    : Password authentication.

Table 6 Command output

Field

Description

Modem

This field is not supported in the current software version.

Whether the modem allows calling in or out. By default, this attribute is not configured and this field displays a hyphen (-).

Int

Physical port for the line. If there is no physical port for the line or the port is a console port, this field displays a hyphen (-).

Location

Physical position of the line, in the form of slot number/CPU number.

# Display summary information about all user lines.

<Sysname> display user-interface summary

  Line type : [CON]                                                            

           0:XXX                                                               

  Line type : [VTY]                                                            

           3:UXUX XXXX XXXX XXXX                                               

          19:XXXX XXXX XXXX XXXX                                               

          35:XXXX XXXX XXXX XXXX                                               

          51:XXXX XXXX XXXX XXXX                                               

                                                                               

   2 lines used.      (U)                                                      

  65 lines not used.  (X)

Table 7 Command output

Fields

Description

Line type

Type of the user line:

·     CON—Console line.

·     VTY—VTY line.

number:status

number: Absolute number of the first user line in the user line class.

status: User line status. X is for unused and U is for used.

display users

Use display users to display online CLI users.

Syntax

display users [ all ]

Views

Any view

Predefined user roles

network-admin

network-operator

Parameters

all: Displays all user lines supported by the device.

Examples

# Display online user information.

<Sysname> display users

  Idx  Line     Idle       Time              Pid     Type                      

+ 10   VTY 0    00:00:00   Jan 01 00:33:10   484     TEL                       

  12   VTY 2    00:06:22   Jan 01 00:33:22   495     TEL                       

                                                                                

Following are more details.                                                    

VTY 0   :                                                                      

        User role list: network-admin network-operator

        Location: 192.168.1.107                                                

VTY 2   :                                                                      

        User role list: level-0 network-admin network-operator

        Location: 192.168.1.134                                                

 +    : Current operation user.                                                

 F    : Current operation user works in async mode.

Table 8 Command output

Field

Description

Idx

Absolute number of the user line.

Line

Type and relative number of the user line.

Idle

Time elapsed after the user's most recent input, in the hh:mm:ss format.

Time

Login time of the user.

Pid

Process ID of the user session.

Type

User type:

·     TEL—Telnet user.

·     SSH—SSH user.

For a user who logged in through the console port, this field does not display anything.

+

User line you are using.

User role list

User roles assigned to the user. The user has logged in to the device by using a user line.

Location

IP address of the user.

display web menu

Use display web menu to display Web interface navigation tree information.

Syntax

display web menu [ chinese ]

Views

Any view

Predefined user roles

network-admin

network-operator

Parameters

chinese: Displays information about the Chinese Web interface navigation tree. If you do not specify this keyword, the command displays information about the English Web interface navigation tree.

Usage guidelines

This command displays all options on the Web interface navigation tree.

Examples

# Display Web interface navigation tree information.

<Sysname> display web menu

  .                                                                            

  |--Dashboard: ID = m_dashboard                                                

  |--Device: ID = m_device                                                     

  |    |--Maintenance: ID = m_maintenance                                      

  |    |    |--Settings: ID = m_devicesettings                                 

  |    |    |--Administrators: ID = m_admin                                    

  |    |    |--Configuration: ID = m_config                                    

  |    |    |--File System: ID = m_filesystem                                  

  |    |    |--Upgrade: ID = m_upgrade                                         

  |    |    |--Diagnostics: ID = m_diagnostic                                  

  |    |    |--Reboot: ID = m_reboot                                           

  |    |    `--About: ID = m_about                                             

  |    `--Virtualization: ID = m_virtualdevice                                 

  |         |--Cluster: ID = m_cluster                                         

  |         `--Context: ID = m_context                                          

  |--Network: ID = m_network                                                   

  |    |--Probe: ID = m_probe                                                  

  |    |    |--Ping: ID = m_ping                                               

  |    |    `--Tracert: ID = m_tracert                                         

  |    |--Interfaces: ID = m_if                                                

  |    |    |--Interfaces: ID = m_interface                                    

  |    |    |--Link Aggregation: ID = m_lagg                                   

  |    |    |--Storm Constrain: ID = m_stormconstrain                          

...

display web users

Use display web users to display online Web users.

Syntax

display web users

Views

Any view

Predefined user roles

network-admin

network-operator

Examples

# Display online Web users.

<Sysname> display web users

UserID          Name            Type   Language JobCount LoginTime LastOperation

AB2039483271293 Administrator   HTTP   Chinese     3     12:00:23  14:10:05

F09382BA2014AC8 user            HTTPS  English     1     13:05:00  14:11:00

Table 9 Command output

Field

Description

UserID

ID used to uniquely identify the online Web user.

JobCount

Number of connections established by the user.

display websocket connection

Use display websocket connection to display information about current WebSocket connections.

Syntax

display websocket connection

Views

Any view

Predefined user roles

network-admin

network-operator

Usage guidelines

When the device acts as the WebSocket server, it can actively push data to a client after that client establishes a connection to the server. The connection is bidirectional. That client can also send information to the server.

To view information about the connections established between the WebSocket server and clients, use this command.

Examples

# Display information about current WebSocket connections.

<Sysname> display websocket connection

Connection ID: 1

Status: established

Established at: 2022-01-23T15:11:19

PktSendCount: 10

PktRecvCount: 22

PktRecvErrCount: 1

Table 10 Command output

Field

Description

Connection ID

WebSocket connection ID.

Status

WebSocket connection state:

·     Connecting—Handshake stage.

·     Established—The connection has been established.

Established at

Time when the connection was established.

This field is not available when the connection is in connecting state.

PktSendCount

Number of WebSocket packets sent to the webpage over the connection.

PktRecvCount

Number of WebSocket packets received from the webpage over the connection.

PktRecvErrCount

Number of error WebSocket packets received from the webpage over the connection.

escape-key

Use escape-key to set the escape key.

Use undo escape-key to disable the escape key.

Syntax

escape-key { key-string | default }

undo escape-key

Default

The escape key is Ctrl+C.

Views

User line view

User line class view

Predefined user roles

network-admin

Parameters

key-string: Specifies a shortcut key. It can be a character (case sensitive, except for d and D), or an ASCII code value in the range of 0 to 127. For example, if you execute escape-key 1, the shortcut key is Ctrl+A. If you execute escape-key a, the shortcut key is a. If you specify the character d or D for this argument, the actual shortcut key is Ctrl+C. To use d or D as the shortcut key, you must specify the ASCII code value of the character for this argument. For information about ASCII code values of individual characters, see the standard ASCII code chart. For information about ASCII code values of combined keys that use the Ctrl key, see Table 1.

default: Restores the default escape key Ctrl+C.

Usage guidelines

You can press the escape key to abort a command that is being executed, for example, a ping or tracert command. Whether a command can be aborted by Ctrl+C by default depends on the software implementation of the command. For more information, see the usage guidelines for the command.

As a best practice, use a key sequence as the escape key. If you define a single character as the escape key, pressing the key while a command is being executed stops the command. If no command is being executed, pressing the key enters the character as a common character. If you Telnet from the device to a remote device, pressing the key enters the character as a common character on the remote device. The key acts as the escape key on the remote device only when the following conditions are met:

·     You define the same character as the escape key on the remote device.

·     You press the key while a command is being executed on the remote device.

The undo escape-key command disables the current escape key. After you execute this undo command, no escape key is available.

This command is available in both user line view and user line class view. A non-default setting in either view takes precedence over a default setting in the other view. A non-default setting in user line view takes precedence over a non-default setting in user line class view.

The setting in user line view takes effect immediately on the current session. The setting in user line class view takes effect on login sessions that are established after the setting is configured.

To display the current escape key, use the display current-configuration | include escape-key command.

Examples

# Configure character a as the escape key for VTY line 0.

<Sysname> system-view

[Sysname] line vty 0

[Sysname-line-vty0] escape-key a

To verify the configuration:

1.     Ping IP address 192.168.1.49, specifying the -c keyword to set the number of ICMP echo request packets to 20.

<Sysname> ping -c 20 192.168.1.49

Ping 192.168.1.49 (192.168.1.49): 56 data bytes, press 'a' to break

56 bytes from 192.168.1.49: icmp_seq=0 ttl=255 time=1.000 ms

56 bytes from 192.168.1.49: icmp_seq=1 ttl=255 time=0.000 ms

2.     Press a.

The system aborts the command and returns to user view.

--- Ping statistics for 192.168.1.49 ---

20 packet(s) transmitted, 20 packet(s) received, 0.0% packet loss

round-trip min/avg/max/std-dev = 0.000/0.200/1.000/0.400 ms

<Sysname>

flow-control

Use flow-control to configure the flow control mode.

Use undo flow-control to restore the default.

Syntax

flow-control { hardware | none | software }

undo flow-control

Default

Flow control is disabled.

Views

User line view

Predefined user roles

network-admin

Parameters

hardware: Performs hardware flow control.

none: Disables flow control.

software: Performs software flow control.

Usage guidelines

This command is not supported in VTY line view.

The device supports flow control in both the inbound and outbound directions.

·     For flow control in the inbound direction, the local device listens to flow control information from the remote device.

·     For flow control in the outbound direction, the local device sends flow control information to the remote device.

The flow control setting takes effect in both directions.

To communicate, two devices must operate in the same flow control mode.

Examples

# Configure software flow control in the inbound and outbound directions for console line 0.

<Sysname> system-view

[Sysname] line console 0

[Sysname-line-console0] flow-control software

free line

Use free line to release a user line.

Syntax

free line { number1 | { console | vty } number2 }

Views

User view

Predefined user roles

network-admin

Parameters

number1: Specifies the absolute number of a user line. The value range is 0 to 66.

console: Specifies the console line.

vty: Specifies the VTY line.

number2: Specifies the relative number of a user line. The value range is 0 to 2 for console lines and 0 to 63 for VTY lines.

Usage guidelines

This command does not release the line you are using.

Examples

# Release VTY line 1.

<Sysname> free line vty 1

Are you sure to free line vty1? [Y/N]:y

 [OK]

free user-interface

Use free user-interface to release a user line.

Syntax

free user-interface { number1 | { console | vty } number2 }

Views

User view

Predefined user roles

network-admin

Parameters

number1: Specifies the absolute number of a user line. The value range is 0 to 66.

console: Specifies the console line.

vty: Specifies the VTY line.

number2: Specifies the relative number of a user line. The value range is 0 to 2 for console lines and 0 to 63 for VTY lines.

Usage guidelines

This command does not release the line you are using.

This command is an older version reserved for backward compatibility purposes. It has the same functionality and output as the free line command. As a best practice, use the free line command.

Examples

# Release VTY line 1.

<Sysname> free user-interface vty 1

Are you sure to free line vty1? [Y/N]:y

 [OK]

free web users

Use free web users to log off online Web users.

Syntax

free web users { all | user-id user-id | user-name user-name }

Views

User view

Predefined user roles

network-admin

Parameters

all: Specifies all Web users.

user-id: Specifies a Web user by the ID, a hexadecimal number of 15 digits. The system assigns each Web user a unique ID at login to identify the user.

user-name: Specifies a Web user by the username, a case-sensitive string of 1 to 255 characters.

Examples

# Log off all online Web users.

<Sysname> free web users all

Related commands

display web users

history-command max-size

Use history-command max-size to set the size of the command history buffer for a user line.

Use undo history-command max-size to restore the default.

Syntax

history-command max-size size-value

undo history-command max-size

Default

The command history buffer for a user line stores up to 10 history commands.

Views

User line view

User line class view

Predefined user roles

network-admin

Parameters

size-value: Specifies the maximum number of history commands the buffer can store, in the range of 0 to 256.

Usage guidelines

Each user line uses a separate command history buffer to store commands successfully executed by its user. The buffer size determines how many history commands the buffer can store.

To display history commands in the buffer for your session, press the up or down arrow key, or execute the display history-command command. For more information about the command history buffer, see CLI introduction in Fundamentals Configuration Guide.

Terminating a CLI session clears the commands in the command history buffer.

The setting in user line view takes effect immediately on the current session. The setting in user line class view takes effect on login sessions that are established after the setting is configured.

Examples

# Set the command history buffer size to 20 for VTY line 0.

<Sysname> system-view

[Sysname] line vty 0

[Sysname-line-vty0] history-command max-size 20

http acl

Use http acl to control TCP connections from IPv4 HTTP clients.

Use undo http acl to restore the default.

Syntax

http acl { advanced-acl-number | basic-acl-number }

undo http acl

Default

The device permits TCP connections from all IPv4 HTTP clients.

Views

System view

Predefined user roles

network-admin

Parameters

advanced-acl-number: Specifies an advanced IPv4 ACL number in the range of 3000 to 3999.

basic-acl-number: Specifies a basic IPv4 ACL number in the range of 2000 to 2999.

Usage guidelines

This command does not take effect on the existing TCP connections.

To control TCP connections from IPv4 HTTP clients, specify an existing ACL that has rules. Then, only IPv4 HTTP clients permitted by the ACL can establish TCP connections to the device. If no ACL is applied or the applied ACL does not exist or does not have rules, all IPv4 HTTP clients can establish TCP connections.

If a VPN instance is specified in an ACL rule, the rule applies only to the packets of the VPN instance. If no VPN instance is specified in an ACL rule, the rule applies only to the packets on the public network.

Whether an IPv4 HTTP client can use a service after it establishes a TCP connection to the device depends on the configuration for the service. For example, for an IPv4 HTTP client to log in to the device's Web interface, both this command and the ip http acl command must permit the IPv4 HTTP client. As another example, for an IPv4 HTTP client to use the NETCONF over SOAP service, both this command and the netconf soap acl command must permit the IPv4 HTTP client. For more information about the netconf soap acl command, see NETCONF commands in Network Programmability Command Reference.

Examples

# Use ACL 2001 to allow only IPv4 HTTP clients from 1.1.1.1 to establish TCP connections to the device.

<Sysname> system-view

[Sysname] acl basic 2001

[Sysname-acl-ipv4-basic-2001] rule permit source 1.1.1.1 0

[Sysname-acl-ipv4-basic-2001] quit

[Sysname] http acl 2001

Related commands

ip http acl

netconf soap acl (Network Programmability Command Reference)

http idle-timeout

Use http idle-timeout to set the HTTP connection idle-timeout timer.

Use undo http idle-timeout to restore the default.

Syntax

http idle-timeout minutes

undo http idle-timeout

Default

The HTTP connection idle-timeout timer is 30 minutes.

Views

System view

Predefined user roles

network-admin

Parameters

minutes: Specifies the number of minutes, in the range of 1 to 60.

Usage guidelines

If the TCP connection with the HTTP server is abnormally interrupted, the connection continues. Use this command to enable the system to automatically terminate the TCP connection with the HTTP server if no information interaction occurs on the connection within the idle-timeout interval.

Examples

# Set the HTTP connection idle-timeout timer to 30 minutes.

<Sysname> system-view

[Sysname] http idle-timeout 30

http ipv6 acl

Use http ipv6 acl to control TCP connections from IPv6 HTTP clients.

Use undo http ipv6 acl to restore the default.

Syntax

http ipv6 acl { advanced-acl-number | basic-acl-number }

undo http ipv6 acl

Default

The device permits TCP connections from all IPv6 HTTP clients.

Views

System view

Predefined user roles

network-admin

Parameters

advanced-acl-number: Specifies an advanced IPv6 ACL number in the range of 3000 to 3999.

basic-acl-number: Specifies a basic IPv6 ACL number in the range of 2000 to 2999.

Usage guidelines

This command does not take effect on the existing TCP connections.

To control TCP connections from IPv6 HTTP clients, specify an existing ACL that has rules. Then, only IPv6 HTTP clients permitted by the ACL can establish TCP connections to the device. If no ACL is applied or the applied ACL does not exist or does not have rules, all IPv6 HTTP clients can establish TCP connections.

If a VPN instance is specified in an ACL rule, the rule applies only to the packets of the VPN instance. If no VPN instance is specified in an ACL rule, the rule applies only to the packets on the public network.

Examples

# Use ACL 2001 to allow only IPv6 HTTP clients from 2001::1 to establish TCP connections to the device.

<Sysname> system-view

[Sysname] acl ipv6 basic 2001

[Sysname-acl-ipv6-basic-2001] rule permit source 2001::1 128

[Sysname-acl-ipv6-basic-2001] quit

[Sysname] http ipv6 acl 2001

http method

Use http method to specify the HTTP methods to be added to the reply to an OPTIONS request.

Use undo http method to remove the HTTP methods to be added to the reply to an OPTIONS request.

Syntax

http method { delete | get | head | options | post | put } *

undo http method { delete | get | head | options | post | put } *

Default

No HTTP methods are specified.

Views

System view

Predefined user roles

network-admin

Parameters

delete: Specifies the DELETE method.

get: Specifies the GET method.

head: Specifies the HEAD method.

options: Specifies the OPTIONS method.

post: Specifies the POST method.

put: Specifies the PUT method.

Usage guidelines

An HTTP client sends an OPTIONS request to the device to obtain the HTTP methods supported by the device. The device identifies whether the requested URL resources have a service that has registered for the OPTIONS method.

·     If yes, the service responds to the OPTIONS request.

·     If not, the device identifies whether the options keyword is specified for this command.

¡     If yes, the device uses the settings for this command to generate and return a reply to the OPTIONS request.

¡     If not, the device returns the 405 Method Not Allowed message.

This command does not affect HTTP requests except for OPTIONS requests.

Examples

# Specify GET, HEAD, POST, and OPTIONS methods as the HTTP methods to be added to the reply to an OPTIONS request.

<Sysname> system-view

[Sysname] http method get head post options

http slow-attack

Use http slow-attack to specify a timeout timer for a slow HTTP attack.

Use undo http slow-attack to restore the default.

Syntax

http slow-attack { packet-header-timeout seconds | packet-body-timeout seconds | client-read-timeout seconds } *

undo http slow-attack [ packet-header-timeout seconds | packet-body-timeout seconds | client-read-timeout seconds ] *

Default

The timeout timer for a Slow Headers attack  is 10 seconds.

The timeout timer for a Slow Body attack is 20 seconds.

The timeout timer for a Slow Read attack is 30 seconds.

Views

System view

Predefined user roles

network-admin

Parameters

packet-header-timeout: Specifies the maximum time allowed for a client to transmit an HTTP request header to a server.

packet-body-timeout: Specifies the maximum time allowed for a client to transmit an HTTP request to a server.

client-read-timeout: Specifies the maximum time allowed for a server to respond to a client after it receives an HTTP request from the client.

seconds: Specifies the number of seconds, in the range of 1 to 65535.

Usage guidelines

Slow HTTP attacks are typically of three types: Slow Headers, Slow Body, and Slow Read. To defense against slow HTTP attacks, this command enables the device to automatically disconnect a user connection when the specified timer expires.

Examples

# Set the timeout timer for Slow Headers attacks to 15 seconds, Slow Body attacks to 25 seconds, and Slow Read attacks to 35 seconds.

<Sysname> system-view

[Sysname] http slow-attack packet-header-timeout 15 packet-body-timeout 25 client-read-timeout 35

http slow-attack defense enable

Use http slow-attack defense enable to enable slow HTTP attack defense.

Use undo http slow-attack defense enable to disable slow HTTP attack defense.

Syntax

http slow-attack defense enable

undo http slow-attack defense enable

Default

Slow HTTP attack defense is disabled.

Views

System view

Predefined user roles

network-admin

Usage guidelines

Slow HTTP attack is a DoS attack. It sends legitimate HTTP traffic according to HTTP and TCP protocols at a very low speed, which consumes many resources of the server. The server has to keep the connections open and wait for the rest of the request data. This occupies HTTP connections and causes the normal HTTP requests to fail to be processed.

Slow HTTP attacks are typically of three types as follows:

·     Slow Headers—Also referred to as Slowloris. A Web application must receive a complete HTTP header before processing an HTTP request. The Web server considers an HTTP header incomplete before it receives two consecutive \r\n. A Slow Headers attacker sends part of an HTTP request header to the server many times at a low speed, thus occupying the connections and memory resources of the server.

·     Slow Body—Also referred to as Slow HTTP POST. An attacker sends an HTTP POST request with a big header value. The Web server or proxy assumes the client wants to send a large amount of data. The server will keep the connection alive to receive data while the attacker sends only a little data each time, consuming the server's connections and memory resources.

·     Slow Read—The attacking client establishes a connection to the server and sends a valid HTTP request. Then, the client keeps the connection alive by reading the response from the server slowly, making the server mistakenly consider the client busy. The client might read one byte until the connection is about to time out to consume the connections and memory resources of the server.

After slow HTTP attack defense is enabled, you can use http slow-attack to specify timeout timers for the device to determine whether an attack occurs. The device will disconnect an illegitimate connection if the timer expires.

Examples

# Enable defense against slow HTTP attacks.

<Sysname> system-view

[Sysname] http slow-attack defense enable

http url allowlist

Use http url allowlist to add a URL to the URL allowlist for HTTP access.

Use undo http url allowlist to remove a URL form the URL allowlist.

Syntax

http url allowlist url

undo http url allowlist url

Default

No URL is specified in the URL allowlist for HTTP access.

Views

System view

Predefined user roles

network-admin

Parameters

url: Specifies a relative path of an accessible webpage, a case-insensitive string of 1 to 255 characters. A relative path is an absolute path that excludes the protocol, domain name (IP address), and port number.

Usage guidelines

When you log in to the Web interface of the device, the device acts as an HTTP server. After Web login, if you click a tab or link on the current webpage, the device automatically generates an HTTP request to access the target webpage. The HTTP request typically contains the following fields:

·     Referer field—Value of the referer field is the URL for the current webpage to indicate the source address of the HTTP request.

·     Host field—Value of the host field is the URL of the target webpage to indicate the domain name (or IP address) and port number of the target HTTP server.

The device identifies whether IP addresses in the referer and host fields are the same. If the IP addresses are the same, the device considers the HTTP request legitimate and continues to process the request. If the IP addresses are different, the device considers the HTTP request illegitimate, which might be an attack packet, and denies the request.

If a target URL of the webpage to be accessed is a domain name or the target HTTP server is not the device, you can execute this command to add the target URL to the URL allowlist. If the URL in the host field is a URL in the URL allowlist, the device does not verify the referer and host fields and directly considers the request legitimate.

A maximum of 16 URL allowlist entries are supported.

Examples

# Add a URL allowlist entry.

<Sysname> system-view

[Sysname] http url allowlist /web/frame/login.html

https acl

Use https acl to control TCP connections from IPv4 HTTPS clients.

Use undo https acl to restore the default.

Syntax

https acl { advanced-acl-number | basic-acl-number }

undo https acl

Default

The device permits TCP connections from all IPv4 HTTPS clients.

Views

System view

Predefined user roles

network-admin

Parameters

advanced-acl-number: Specifies an advanced IPv4 ACL number in the range of 3000 to 3999.

basic-acl-number: Specifies a basic IPv4 ACL number in the range of 2000 to 2999.

Usage guidelines

This command does not take effect on the existing TCP connections.

To control TCP connections from IPv4 HTTPS clients, specify an existing ACL that has rules. Then, only IPv4 HTTPS clients permitted by the ACL can establish TCP connections to the device. If no ACL is applied or the applied ACL does not exist or does not have rules, all IPv4 HTTPS clients can establish TCP connections.

If a VPN instance is specified in an ACL rule, the rule applies only to the packets of the VPN instance. If no VPN instance is specified in an ACL rule, the rule applies only to the packets on the public network.

Whether an IPv4 HTTPS client can use a service after it establishes a TCP connection to the device depends on the configuration for the service. For example, for an IPv4 HTTPS client to log in to the device's Web interface, both this command and the ip https acl command must permit the IPv4 HTTPS client. As another example, for an IPv4 HTTPS client to use the NETCONF over SOAP service, both this command and the netconf soap acl command must permit the IPv4 HTTPS client. For more information about the netconf soap acl command, see NETCONF commands in Network Programmability Command Reference.

Examples

# Use ACL 2001 to allow only IPv4 HTTPS clients from 1.1.1.1 to establish TCP connections to the device.

<Sysname> system-view

[Sysname] acl basic 2001

[Sysname-acl-ipv4-basic-2001] rule permit source 1.1.1.1 0

[Sysname-acl-ipv4-basic-2001] quit

[Sysname] https acl 2001

Related commands

ip https acl

netconf soap acl (Network Programmability Command Reference)

https ipv6 acl

Use https ipv6 acl to control TCP connections from IPv6 HTTPS clients.

Use undo https ipv6 acl to restore the default.

Syntax

https ipv6 acl { advanced-acl-number | basic-acl-number }

undo https ipv6 acl

Default

The device permits TCP connections from all IPv6 HTTPS clients.

Views

System view

Predefined user roles

network-admin

Parameters

advanced-acl-number: Specifies an advanced IPv6 ACL number in the range of 3000 to 3999.

basic-acl-number: Specifies a basic IPv6 ACL number in the range of 2000 to 2999.

Usage guidelines

This command does not take effect on the existing TCP connections.

To control TCP connections from IPv6 HTTPS clients, specify an existing ACL that has rules. Then, only IPv6 HTTPS clients permitted by the ACL can establish TCP connections to the device. If no ACL is applied or the applied ACL does not exist or does not have rules, all IPv6 HTTPS clients can establish TCP connections.

If a VPN instance is specified in an ACL rule, the rule applies only to the packets of the VPN instance. If no VPN instance is specified in an ACL rule, the rule applies only to the packets on the public network.

Examples

# Use ACL 2001 to allow only IPv6 HTTPS clients from 2001::1 to establish TCP connections to the device.

<Sysname> system-view

[Sysname] acl ipv6 basic 2001

[Sysname-acl-ipv6-basic-2001] rule permit source 2001::1 128

[Sysname-acl-ipv6-basic-2001] quit

[Sysname] https ipv6 acl 2001

idle-timeout

Use idle-timeout to set the CLI connection idle-timeout timer.

Use undo idle-timeout to restore the default.

Syntax

idle-timeout minutes [ seconds ]

undo idle-timeout

Default

The CLI connection idle-timeout timer is 10 minutes.

Views

User line view

User line class view

Predefined user roles

network-admin

Parameters

minutes: Specifies the number of minutes, in the range of 0 to 35791.

seconds: Specifies the number of seconds, in the range of 0 to 59. The default is 0 seconds.

Usage guidelines

The system automatically terminates a user connection if no information interaction occurs on the connection within the idle-timeout interval.

To disable the idle-timeout feature, execute the idle-timeout 0 command.

This command is available in both user line view and user line class view. A non-default setting in either view takes precedence over a default setting in the other view. A non-default setting in user line view takes precedence over a non-default setting in user line class view.

The setting in user line view takes effect immediately on the current session. The setting in user line class view takes effect on login sessions that are established after the setting is configured.

Examples

# Set the CLI connection idle-timeout timer to 1 minute and 30 seconds for VTY line 0.

<Sysname> system-view

[Sysname] line vty 0

[Sysname-line-vty0] idle-timeout 1 30

ip http preflight enable

Use ip http preflight enable to enable the HTTP preflight request feature.

Use undo ip http preflight enable to disable the HTTP preflight request feature.

Syntax

ip http preflight enable

undo ip http preflight enable

Default

The HTTP preflight request feature is disabled.

Views

System view

Predefined user roles

network-admin

Usage guidelines

Because of the same-origin security policy of Web browsers, a webpage can request only resources in its domain. Cross-origin resource sharing (CORS) enables webpages to request resources from other domains by using extra HTTP header information for CORS negotiation between the browser and server. CORS divides HTTP requests into simple cross-domain requests and preflight cross-domain requests. A Web browser uses an HTTP OPTIONS request to send a preflight cross-domain request to solicit approval from the server before sending an actual request.

Examples

# Enable the HTTP preflight request feature.

<Sysname> system-view

[Sysname] ip http preflight enable

line

Use line to enter one or multiple user line views.

Syntax

line { first-number1 [ last-number1 ] | { console | vty } first-number2 [ last-number2 ] }

Views

System view

Predefined user roles

network-admin

Parameters

first-number1: Specifies the absolute number of the first user line. The value range is 0 to 66.

last-number1: Specifies the absolute number of the last user line. The value range is 1 to 66. This number must be greater than first-number1.

console: Specifies the console line.

vty: Specifies the VTY line.

first-number2: Specifies the relative number of the first user line. The value range is 0 to 2 for console lines and 0 to 63 for VTY lines.

last-number2: Specifies the relative number of the last user line. The value range is 1 or 2 for console lines and 1 to 63 for VTY lines. This number must be greater than first-number2.

Examples

# Enter the view of VTY line 0.

<Sysname> system-view

[Sysname] line vty 0

[Sysname-line-vty0]

# Enter the views of VTY lines 0 to 63.

<Sysname> system-view

[Sysname] line vty 0 63

[Sysname-line-vty0-63]

Related commands

line class

line class

Use line class to enter user line class view.

Syntax

line class { console | vty }

Views

System view

Predefined user roles

network-admin

Parameters

console: Specifies the console line class view.

vty: Specifies the VTY line class view.

Usage guidelines

To configure the same settings for all user lines of a line class, use this command to enter the user line class view.

In user line class view, you can execute the following commands:

·     activation-key

·     auto-execute command

·     authentication-mode

·     command accounting

·     command authorization

·     escape-key

·     history-command max-size

·     idle-timeout

·     protocol inbound

·     screen-length

·     set authentication password

·     shell

·     terminal type

·     user-role

For commands that are available in both user line view and user line class view, the device uses the following rules to determine the settings to use:

·     A setting in user line view applies only to the user line. A setting in user line class view applies to all user lines of the class.

·     A non-default setting in either view takes precedence over a default setting in the other view. A non-default setting in user line view takes precedence over a non-default setting in user line class view.

·     A setting in user line class view does not take effect on current online users. It takes effect only on new login users.

Examples

# Set the CLI connection idle-timeout timer to 15 minutes in VTY line class view.

<Sysname> system-view

[Sysname] line class vty

[Sysname-line-class-vty] idle-timeout 15

# In console line class view, configure the character s as the terminal session activation key.

<Sysname> system-view

[Sysname] line class console

[Sysname-line-class-console] activation-key s

[Sysname-line-class-console] quit

# In the view of console line 0, restore the default terminal session activation key.

[Sysname] line console 0

[Sysname-line-console0] undo activation-key

Alternatively, you can use the following command:

[Sysname-line-console0] activation-key 13

To verify the configuration:

3.     Exit the session on console line 0.

[Sysname-line-console0] return

<Sysname> quit

4.     Log in again through the user line.

The following message appears:

Press ENTER to get started.

5.     Press Enter.

Pressing Enter does not start a session.

6.     Enter s.

A terminal session is started.

<Sysname>

Related commands

line

lock

Use lock to lock the current user line and set the password for unlocking the line.

Syntax

lock

Default

The system does not lock any user lines.

Views

User view

Predefined user roles

network-admin

Usage guidelines

This command locks the current user line to prevent unauthorized users from using the line. You must set the password for unlocking the line as prompted. The user line is locked after you enter the password and confirm the password.

To unlock the user line, press Enter and enter the password you set.

Examples

# Lock the current user line and set the password for unlocking the line.

<Sysname> lock

Please input password<1 to 16> to lock current line:

Password:

Again:

 

                   locked !

// The user line is locked. To unlock it, press Enter and enter the password:

Password:

<Sysname>

lock reauthentication

Use lock reauthentication to lock the current user line and enable unlocking authentication.

Syntax

lock reauthentication

Default

The system does not lock any user lines or initiate reauthentication.

Views

Any view

Predefined user roles

network-admin

Usage guidelines

This command locks the current user line. To unlock the user line, you must press Enter and provide the login password to pass reauthentication. If you have changed the login password after login, you must provide the new password. If no login password is set, the system unlocks the user line after you press Enter.

Examples

# Lock the current user line and enable unlocking authentication.

<Sysname> lock reauthentication

 

Please press Enter to unlock the screen.

// The user line is locked. To unlock it, press Enter and enter the login password:

Password:

 

<Sysname>

Related commands

lock-key

lock-key

Use lock-key to set the user line locking key. Pressing this shortcut key locks the current user line and enables unlocking authentication.

Use undo lock-key to restore the default.

Syntax

lock-key key-string

undo lock-key

Default

No user line locking key is set.

Views

User line view

User line class view

Predefined user roles

network-admin

Parameters

key-string: Specifies a shortcut key. It can be a character (case sensitive), or an ASCII code value in the range of 0 to 127. For example, if you execute lock-key 1, the shortcut key is Ctrl+A. If you execute lock-key a, the shortcut key is a. For information about ASCII code values of individual characters, see the standard ASCII code chart. For information about ASCII code values of combined keys that use the Ctrl key, see Table 1.

Usage guidelines

As a best practice, specify a combined key as the user line locking key. If you specify a single character as the key, the character acts only as the user line locking key. You cannot type the character for any commands, keywords, or arguments.

Pressing the user line locking key is equivalent to executing the lock reauthentication command.

This command takes effect immediately.

To display the current user line locking key, use the display current-configuration | include lock-key command.

Examples

# Set the user line locking key to Ctrl+A for VTY line 0.

<Sysname> system-view

[Sysname] line vty 0

[Sysname-line-vty0] lock-key 1

[Sysname-line-vty0] quit

To verify the configuration:

7.     Press Ctrl+A.

[Sysname]

 

Please press Enter to unlock the screen.

8.     Press Enter and enter the login password.

Password:

 

[Sysname]

Related commands

lock reauthentication

parity

Use parity to specify the parity.

Use undo parity to restore the default.

Syntax

parity { even | mark | none | odd | space }

undo parity

Default

The setting is none. No parity is used.

Views

User line view

Predefined user roles

network-admin

Parameters

even: Uses even parity.

mark: Uses mark parity.

none: Uses no parity.

odd: Uses odd parity.

space: Uses space parity.

Usage guidelines

This command is not supported in VTY line view.

The configuration terminal and the device must use the same parity.

Examples

# Configure console line 0 to use odd parity.

<Sysname> system-view

[Sysname] line console 0

[Sysname-line-console0] parity odd

protocol inbound

Use protocol inbound to specify the supported protocols.

Use undo protocol inbound to restore the default.

Syntax

protocol inbound { all | pad| ssh | telnet }

undo protocol inbound

Default

All protocols are supported.

Views

VTY line view

VTY line class view

Predefined user roles

network-admin

Parameters

all: Supports all protocols, including SSH, PAD, and Telnet.

pad: Supports PAD only.

ssh: Supports SSH only.

telnet: Supports Telnet only.

Usage guidelines

Only users assigned the network-admin, or level-15 user role can execute this command. Other users cannot execute this command, even if they are granted the right to execute this command.

A configuration change in user line view does not take effect on the current session. It takes effect on subsequent login sessions.

Before configuring a user line to support SSH, set the authentication mode to scheme for the user line.

In VTY line view, this command is associated with the authentication-mode command. If you specify a non-default value for one of the two commands, the other command uses the default setting, regardless of the setting in VTY line class view.

·     If the settings of the two commands in VTY line view are both the default settings, the settings for the commands in VTY line class view take effect.

·     If the settings of the two commands in VTY line view are both non-default settings, the non-default settings in VTY line view take effect.

·     If only one command has a non-default setting in VTY line view, the other command uses the default setting, regardless of the setting in VTY line class view.

Examples

# Enable user lines VTY 0 through VTY 4 to support only SSH.

<Sysname> system-view

[Sysname] line vty 0 4

[Sysname-line-vty0-4] authentication-mode scheme

[Sysname-line-vty0-4] protocol inbound ssh

# Enable SSH support and set the authentication mode to scheme in VTY line class view. Enable user lines VTY 0 through VTY 4 to support all protocols and disable authentication for the user lines.

<Sysname> system-view

[Sysname] line class vty

[Sysname-line-class-vty] authentication-mode scheme

[Sysname-line-class-vty] protocol inbound ssh

[Sysname-line-class-vty] line vty 0 4

[Sysname-line-vty0-4] authentication-mode none

To verify the configuration:

1.     Telnet to the device.

<Client> telnet 192.168.1.241

Trying 192.168.1.241 ...

Press CTRL+K to abort

Connected to 192.168.1.241 ...

 

******************************************************************************

* Copyright (c) 2004-2020 New H3C Technologies Co., Ltd. All rights reserved.*

* Without the owner's prior written consent,                                 *

* no decompiling or reverse-engineering shall be allowed.                    *

******************************************************************************

 

<Server>

You are logged in without authentication.

2.     Display online CLI user information.

<Server> display users

  Idx  Line     Idle       Time              Pid     Type

+ 50   VTY 0    00:00:00   Jan 17 15:29:27   189     TEL

 

Following are more details.

VTY 0   :

        Location: 192.168.1.186

 +    : Current operation user.

 F    : Current operation user works in async mode.

The output shows that you are using VTY 0. The configuration in user line view is effective.

Related commands

authentication-mode

screen-length

Use screen-length to set the maximum number of lines of command output to send to the terminal at a time when the screen pausing feature is enabled.

Use undo screen-length to restore the default.

Syntax

screen-length screen-length

undo screen-length

Default

A maximum of 24 lines are sent.

Views

User line view

User line class view

Predefined user roles

network-admin

Parameters

screen-length: Specifies the maximum number of lines to send, in the range of 0 to 512. To send command output without pausing, set the number to 0 or execute the screen-length disable command.

Usage guidelines

The number of lines that can be displayed on the terminal screen is restricted by both this setting and the display specification of the terminal. For example, if this setting is 40, the device sends 40 lines to the terminal at a time. If the terminal display specification is 24 lines, only the last 24 lines are displayed on the terminal screen. To view the previous 16 lines, you must press PgUp.

To continue to display command output after a pause, press the space bar.

By default, pausing between screens of output is enabled.

This command is available in both user line view and user line class view. A non-default setting in either view takes precedence over a default setting in the other view. A non-default setting in user line view takes precedence over a non-default setting in user line class view.

The setting in user line view takes effect immediately on the current session. The setting in user line class view takes effect on login sessions that are established after the setting is configured.

Examples

# Set the maximum number of lines to send at a time to 30 for VTY line 0.

<Sysname> system-view

[Sysname] line vty 0

[Sysname-line-vty0] screen-length 30

Related commands

screen-length disable

send

Use send to send messages to online login users.

Syntax

send { all | number1 | { console | vty } number2 }

Views

User view

Predefined user roles

network-admin

Parameters

all: Specifies all user lines.

number1: Specifies the absolute number of a user line. The value range is 0 to 66.

console: Specifies the console line.

vty: Specifies the VTY line.

number2: Specifies the relative number of a user line. The value range is 0 to 2 for console lines and 0 to 63 for VTY lines.

Usage guidelines

You can use this command to send notifications to online users before performing an operation that might affect other online users, for example, before rebooting the device.

To end a message, press Enter. To abort the send operation, press Ctrl+C.

Examples

# Send a notification to the user on VTY 1.

<Sysname> send vty 1

Input message, end with Enter; abort with CTRL+C:

Your attention, please. I will reboot the system in 3 minutes.

Send message? [Y/N]:y

The message should appear on the user's terminal screen as follows:

[Sysname]

 

***

***

***Message from vty0 to vty1

***

Your attention, please. I will reboot the system in 3 minutes.

set authentication password

Use set authentication password to set the password for local password authentication.

Use undo set authentication password to restore the default.

Syntax

set authentication password { hash | simple } string

undo set authentication password

Default

No password is set for local password authentication.

Views

User line view

User line class view

Predefined user roles

network-admin

Parameters

hash: Specifies a password in hashed form.

simple: Sets a password in plaintext form. For security purposes, the password specified in plaintext form will be stored in hashed form.

string: Specifies the password. Its plaintext form is a case-sensitive string of 4 to 16 characters and must contain a minimum of two character types. Its hashed form is a case-sensitive string of 1 to 110 characters.

Usage guidelines

Only users assigned the network-admin, or level-15 user role can execute this command. Other users cannot execute this command, even if they are granted the right to execute this command.

This command is available in both user line view and user line class view. A non-default setting in either view takes precedence over a default setting in the other view. A non-default setting in user line view takes precedence over a non-default setting in user line class view.

A password change does not take effect on the current session. It takes effect on subsequent login sessions.

Examples

# Set the password to hello12345 for local password authentication on VTY line 0.

<Sysname> system-view

[Sysname] line vty 0

[Sysname-line-vty0] authentication-mode password

[Sysname-line-vty0] set authentication password simple hello12345

Related commands

authentication-mode

shell

Use shell to enable the terminal service for user lines.

Use undo shell to disable the terminal service for user lines.

Syntax

shell

undo shell

Default

The terminal service is enabled on all user lines.

Views

User line view

User line class view

Predefined user roles

network-admin

Usage guidelines

The undo shell command is not supported in console line view or console line class view.

You cannot disable the terminal service on the user line you are using.

When the device acts as a Telnet or SSH server, you cannot execute the undo shell command.

If the undo shell command is executed in user line class view, you cannot execute the shell command in the view of a user line in the class.

Examples

# Disable the terminal service for VTY lines VTY 0 through 4 so no user can log in to the device through the user lines.

<Sysname> system-view

[Sysname] line vty 0 4

[Sysname-line-vty0-4] undo shell

Disable ui-vty0-4 , are you sure? [Y/N]:y

[Sysname-line-vty0-4]

speed

Use speed to set the transmission rate (also called the baud rate) on a user line.

Use undo speed to restore the default.

Syntax

speed speed-value

undo speed

Default

The transmission rate is 9600 bps on a user line.

Views

User line view

Predefined user roles

network-admin

Parameters

speed-value: Specifies the transmission rate in bps. Supported transmission rates depend on the network environment. The transmission rates for asynchronous serial interfaces might include:

·     4800 bps.

·     9600 bps.

·     19200 bps.

·     38400 bps.

·     57600 bps.

·     115200 bps.

Usage guidelines

This command is not supported in VTY line view.

The configuration terminal and the device must be configured with the same transmission rate to communicate.

Examples

# Set the transmission rate to 19200 bps for console line 0.

<Sysname> system-view

[Sysname] line console 0

[Sysname-line-console0] speed 19200

stopbits

Use stopbits to specify the number of stop bits for a character.

Use undo stopbits to restore the default.

Syntax

stopbits { 1 | 1.5 | 2 }

undo stopbits

Default

One stop bit is used.

Views

User line view

Predefined user roles

network-admin

Parameters

1: Uses one stop bit.

1.5: Uses one and a half stop bits. The device does not support using one and a half stop bits. If you specify this keyword, two stop bits are used.

2: Uses two stop bits.

Usage guidelines

This command is not supported in VTY line view.

The configuration terminal and the device must use the same number of stop bits to communicate.

Examples

# Set the number of stop bits to 1 for console line 0.

<Sysname> system-view

[Sysname] line console 0

[Sysname-line-console0] stopbits 1

telnet

Use telnet to Telnet to a host in an IPv4 network.

Syntax

telnet remote-host [ service-port ] [ vpn-instance vpn-instance-name ] [ source { interface  interface-type interface-number | ip ip-address } | dscp dscp-value ] * [ escape character ]

Views

User view

Predefined user roles

network-admin

Parameters

remote-host: Specifies the IPv4 address or host name of a remote host. A host name can be a case-insensitive string of 1 to 253 characters. Valid characters include letters, digits, hyphens (-), underscores (_), and dots (.).

service-port: Specifies the TCP port number for the Telnet service on the remote host. The value range is 0 to 65535 and the default is 23.

vpn-instance vpn-instance-name: Specifies the MPLS L3VPN instance to which the remote host belongs. The vpn-instance-name argument represents the VPN instance name, a case-sensitive string of 1 to 31 characters. If the remote host belongs to the public network, do not specify this option.

source: Specifies a source IPv4 address or source interface for outgoing Telnet packets. If you do not specify this option, the device uses the primary IPv4 address of the output interface for the route to the server as the source address.

interface interface-type interface-number: Specifies the source interface. The primary IPv4 address of the interface will be used as the source IPv4 address for outgoing Telnet packets.

ip ip-address: Specifies the source IPv4 address for outgoing Telnet packets.

dscp dscp-value: Specifies a DSCP value for outgoing Telnet packets. The value range is 0 to 63. The default is 48. The DSCP value is carried in the TOS field of an IPv4 packet to indicate the packet transmission priority.

escape character: Specifies an escape character. The specified escape character works together with a period (.) to terminate the current Telnet connection and return to the previous-level connection view. The escape character is a case-sensitive character and cannot be the same as the username used for login. As a best practice, specify the tilde (~) as the escape character.

Usage guidelines

To terminate the current Telnet connection, perform one of the following operations:

·     Press Ctrl+K.

This operation can be performed under any circumstances. It terminates all Telnet connections.

·     Execute the quit command.

This operation terminates the current Telnet connection and returns to the previous-level connection view. The quit command is not usable when the server is operating incorrectly or is restarting.

·     Enter the escape character.

This operation can be performed under any circumstances. It terminates the current Telnet connection and returns to the previous-level connection view.

When you perform this operation, enter the escape character in conjunction with a period at the beginning of a line. Otherwise, this operation cannot take effect. If the line contains other characters or has executed other operations (such as backspace), you must enter the escape character and the period in a new line.

If an escape character is specified, the Ctrl+K key combination will become ineffective.

The source address or interface specified by this command is applied only to the Telnet connection that is being established.

Examples

# Telnet to host 1.1.1.2, using 1.1.1.1 as the source IP address for outgoing Telnet packets.

<Sysname> telnet 1.1.1.2 source ip 1.1.1.1

Related commands

telnet client source

telnet client source

Use telnet client source to specify a source IPv4 address or source interface for the Telnet client to use for outgoing Telnet packets.

Use undo telnet client source to restore the default.

Syntax

telnet client source { interface interface-type interface-number | ip ip-address }

undo telnet client source

Default

No source IPv4 address or source interface is specified. The Telnet client uses the primary IPv4 address of the output interface for the route to the server as the source IPv4 address.

Views

System view

Predefined user roles

network-admin

Parameters

interface interface-type interface-number: Specifies a source interface. The primary IPv4 address of the interface will be used as the source IPv4 address for outgoing Telnet packets.

ip ip-address: Specifies a source IPv4 address.

Usage guidelines

The setting configured by this command applies to all Telnet connections but has a lower precedence than the source setting specified for the telnet command.

Examples

# Set the source IPv4 address to 1.1.1.1 for outgoing Telnet packets.

<Sysname> system-view

[Sysname] telnet client source ip 1.1.1.1

Related commands

display telnet client configuration

telnet ipv6

Use telnet ipv6 to Telnet to a host in an IPv6 network.

Syntax

telnet ipv6 remote-host [ -i interface-type interface-number ] [ port-number ] [ vpn-instance vpn-instance-name ] [ source { interface interface-type interface-number | ipv6 ipv6-address } | dscp dscp-value ] *

Views

User view

Predefined user roles

network-admin

Parameters

remote-host: Specifies the IPv6 address or host name of a remote host. A host name can be a case-insensitive string of 1 to 253 characters. Valid characters include letters, digits, hyphens (-), underscores (_), and dots (.).

-i interface-type interface-number: Specifies the interface for sending Telnet packets. This option is required when the remote host address is a link-local address. When the server address is a global unicast address, you cannot specify this option.

port-number: Specifies the TCP port number for the Telnet service on the remote host. The value range is 0 to 65535 and the default is 23.

vpn-instance vpn-instance-name: Specifies the MPLS L3VPN instance to which the remote host belongs. The vpn-instance-name argument represents the VPN instance name, a case-sensitive string of 1 to 31 characters. If the remote host belongs to the public network, do not specify this option.

source: Specifies a source IPv6 address or source interface for outgoing Telnet packets. If you do not specify this option, the device uses the primary IPv6 address of the output interface for the route to the server as the source address.

interface interface-type interface-number: Specifies the source interface. The primary IPv6 address of the interface will be used as the source IPv6 address for outgoing Telnet packets.

ipv6 ipv6-address: Specifies the source IPv6 address for outgoing Telnet packets.

dscp dscp-value: Specifies a DSCP value for outgoing Telnet packets. The value range is 0 to 63. The default is 48. The DSCP value is carried in the Traffic class field of an IPv6 packet to indicate the packet transmission priority.

Usage guidelines

To terminate the current Telnet connection, press Ctrl+K or execute the quit command.

Examples

# Telnet to the host at 5000::1.

<Sysname> telnet ipv6 5000::1

# Telnet to the host at 2000::1. Use 1000::1 as the source address for outgoing Telnet packets.

<Sysname> telnet ipv6 2000::1 source ipv6 1000::1

telnet server acl

Use telnet server acl to apply an ACL to filter Telnet logins.

Use undo telnet server acl to restore the default.

Syntax

telnet server acl [ mac ] acl-number

undo telnet server acl

Default

No ACL is used to filter Telnet logins.

Views

System view

Predefined user roles

network-admin

Parameters

mac: Specifies a Layer 2 ACL. To specify an ACL of a different type, do not specify this keyword.

acl-number: Specifies an ACL by its number. If you specify the mac keyword, the value range for this argument is 4000 to 4999. If you do not specify the mac keyword, the value range for this argument is 2000 to 3999.

Usage guidelines

When no ACL is applied to the Telnet service, all users can Telnet to the device. To control Telnet logins, specify an ACL that exists and has rules so that only users permitted by the ACL can Telnet to the device. If you specify an ACL that does not exist or does not have rules, no users can Telnet to the device.

If a VPN instance is specified in an ACL rule, the rule applies only to the packets of the VPN instance. If no VPN instance is specified in an ACL rule, the rule applies only to the packets on the public network.

For more information about ACLs, see ACL and QoS Configuration Guide.

If you execute this command multiple times, the most recent configuration takes effect.

This command does not take effect on existing Telnet connections.

Examples

# Permit only the user at 1.1.1.1 to Telnet to the device.

<Sysname> system-view

[Sysname] acl basic 2001

[Sysname-acl-ipv4-basic-2001] rule permit source 1.1.1.1 0

[Sysname-acl-ipv4-basic-2001] quit

[Sysname] telnet server acl 2001

telnet server acl-deny-log enable

Use telnet server acl-deny-log enable to enable logging for Telnet login attempts that are denied by the Telnet login control ACL.

Use undo telnet server acl-deny-log enable to disable logging for Telnet login attempts that are denied by the Telnet login control ACL.

Syntax

telnet server acl-deny-log enable

undo telnet server acl-deny-log enable

Default

Logging is disabled for Telnet login attempts that are denied by the Telnet login control ACL.

Views

System view

Predefined user roles

network-admin

Usage guidelines

Only clients permitted by the Telnet login control ACL can Telnet to the device. This logging feature generates log messages for Telnet login attempts that are denied by the Telnet login control ACL.

For information about log message output, see the information center in Network Management and Monitoring Configuration Guide. For information about configuring a Telnet login control ACL, see the telnet server acl or telnet server ipv6 acl command.

Examples

# Enable logging for Telnet login attempts that are denied by the Telnet login control ACL.

<Sysname> system-view

[Sysname] telnet server acl-deny-log enable

Related commands

telnet server acl

telnet server ipv6 acl

telnet server dscp

Use telnet server dscp to specify the DSCP value for IPv4 to use for Telnet packets sent to a Telnet client.

Use undo telnet server dscp to restore the default.

Syntax

telnet server dscp dscp-value

undo telnet server dscp

Default

IPv4 uses the DSCP value 48 for Telnet packets sent to a Telnet client.

Views

System view

Predefined user roles

network-admin

Parameters

dscp-value: Specifies a DSCP value in the range of 0 to 63.

Usage guidelines

The DSCP value is carried in the ToS field of an IPv4 packet to indicate the packet transmission priority.

Examples

# Set the DSCP value for IPv4 to use for outgoing Telnet packets to 30 on a Telnet server.

<Sysname> system-view

[Sysname] telnet server dscp 30

telnet server enable

Use telnet server enable to enable the Telnet server.

Use undo telnet server enable to disable the Telnet server.

Syntax

telnet server enable

undo telnet server enable

Default

The Telnet server is disabled.

Views

System view

Predefined user roles

network-admin

Usage guidelines

Users can Telnet to the device only when the Telnet server is enabled.

Examples

# Enable the Telnet server.

<Sysname> system-view

[Sysname] telnet server enable

telnet server ipv6 acl

Use telnet server ipv6 acl to apply an IPv6 ACL to filter IPv6 Telnet logins.

Use undo telnet server ipv6 acl to restore the default.

Syntax

telnet server ipv6 acl { ipv6 | mac } acl-number

undo telnet server ipv6 acl

Default

No IPv6 ACL is used to filter IPv6 Telnet logins.

Views

System view

Predefined user roles

network-admin

Parameters

ipv6: Specifies an IPv6 ACL.

mac: Specifies a Layer 2 ACL. To specify an ACL of a different type, do not specify this keyword.

acl-number: Specifies an ACL by its number. If you specify the ipv6 keyword, the value range for this argument is 2000 to 3999. If you specify the mac keyword, the value range for this argument is 4000 to 4999.

Usage guidelines

When no ACL is applied to the Telnet service, all users can Telnet to the device. To control Telnet logins, specify an ACL that exists and has rules so that only users permitted by the ACL can Telnet to the device. If you specify an ACL that does not exist or does not have rules, no users can Telnet to the device.

If a VPN instance is specified in an ACL rule, the rule applies only to the packets of the VPN instance. If no VPN instance is specified in an ACL rule, the rule applies only to the packets on the public network.

For more information about ACLs, see ACL and QoS Configuration Guide.

If you execute this command multiple times, the most recent configuration takes effect.

This command does not take effect on existing Telnet connections.

Examples

# Permit only the user at 2000::1 to Telnet to the device.

<Sysname> system-view

[Sysname] acl ipv6 basic 2001

[Sysname-acl6-ipv6-basic-2001] rule permit source 2000::1 128

[Sysname-acl6-ipv6-basic-2001] quit

[Sysname] telnet server ipv6 acl ipv6 2001

telnet server ipv6 dscp

Use telnet server ipv6 dscp to specify the DSCP value for IPv6 to use for Telnet packets sent to a Telnet client.

Use undo telnet server ipv6 dscp to restore the default.

Syntax

telnet server ipv6 dscp dscp-value

undo telnet server ipv6 dscp

Default

IPv6 uses the DSCP value 48 for Telnet packets sent to a Telnet client.

Views

System view

Predefined user roles

network-admin

Parameters

dscp-value: Specifies a DSCP value in the range of 0 to 63.

Usage guidelines

The DSCP value is carried in the Traffic class field of an IPv6 packet to indicate the packet transmission priority.

Examples

# Set the DSCP value for IPv6 to use for outgoing Telnet packets to 30 on a Telnet server.

<Sysname> system-view

[Sysname] telnet server ipv6 dscp 30

telnet server ipv6 port

Use telnet server ipv6 port to specify the IPv6 Telnet service port number.

Use undo telnet server ipv6 port to restore the default.

Syntax

telnet server ipv6 port port-number

undo telnet server ipv6 port

Default

The IPv6 Telnet service port number is 23.

Views

System view

Predefined user roles

network-admin

Parameters

port-number: Specifies a port number. The value can be 23 or in the range of 1025 to 65535.

Usage guidelines

This command terminates all existing Telnet connections to the IPv6 Telnet server. To use the Telnet service, users must reestablish Telnet connections.

Examples

# Set the IPv6 Telnet service port number to 1026.

<Sysname> system-view

[Sysname] telnet server ipv6 port 1026

telnet server login-failed threshold-alarm

Use telnet server login-failed threshold-alarm to configure the alarm threshold and alarm clearance threshold for Telnet login failures in a statistics period.

Use undo telnet server login-failed threshold-alarm to restore the default.

Syntax

telnet server login-failed threshold-alarm upper-limit report-times lower-limit resume-times period period-time

undo telnet server login-failed threshold-alarm

Default

The statistics period is five minutes and the alarm threshold and alarm clearance threshold for Telnet login failures in the statistics period is 30 and 20, respectively.

Views

System view

Predefined user roles

network-admin

Parameters

upper-limit report-times: Specifies the alarm threshold for Telnet login failures. The device generates an alarm message if the number of Telnet login failures in the statistics period specified by the period period-time option reaches or exceeds the alarm threshold. The report-times argument specifies the number of Telnet login failures, in the range of 0 to 100. If you set the report-times argument to 0, the device does not generate any alarm message upon Telnet login failures.

lower-limit resume-times: Specifies the alarm clearance threshold for Telnet login failures. The device generates an alarm clearance message if the number of Telnet login failures in the statistics period specified by the period period-time option drops below the alarm clearance threshold. The resume-times argument specifies the number of Telnet login failures. If the value for the report-times argument is equal to or smaller than 45, the value range for the resume-times argument is 0 to the report-times argument. If the value for the report-times argument is greater than 45, the value range for the resume-times argument is 0 to 45. Both values 0 and 1 indicate that the device generates an alarm clearance message only when no Telnet login failure occurs in the specified statistics period.

period period-time: Specifies the statistics period for Telnet login failures, in the range of 1 to 120 minutes. The default is 5.

Usage guidelines

Application scenarios

By default, an alarm message or alarm clearance message is generated when the number of Telnet login failures is not smaller than 30 or is smaller than 20, respectively. You can configure the settings as follows:

·     If you do not care about the number of Telnet login failures and do not want to obtain alarm information upon these failures, set the report-times argument to 0. In this case, the device does not generate any alarm information about Telnet login failures.

·     If you care about care about the number of Telnet login failures and want to obtain alarm information about these failures, use this command as needed.

Restrictions and guidelines

The value for the report-times argument must be equal to or greater than that for the resume-times argument.

Examples

# Specify the statistics period for Telnet login failures as three minutes and set the alarm threshold and alarm clearance threshold to 20 and 10, respectively.

<Sysname> system-view

[Sysname] telnet server login-failed threshold-alarm upper-limit 20 lower-limit 10 period 3

telnet server port

Use telnet server port to specify the IPv4 Telnet service port number.

Use undo telnet server port to restore the default.

Syntax

telnet server port port-number

undo telnet server port

Default

The IPv4 Telnet service port number is 23.

Views

System view

Predefined user roles

network-admin

Parameters

port-number: Specifies a port number. The value can be 23 or in the range of 1025 to 65535.

Usage guidelines

This command terminates all existing Telnet connections to the IPv4 Telnet server. To use the Telnet service, users must reestablish Telnet connections.

Examples

# Set the IPv4 Telnet service port number to 1025.

<Sysname> system-view

[Sysname] telnet server port 1025

terminal character-encoding

Use terminal character-encoding to specify a character encoding for the current terminal.

Use undo terminal character-encoding to restore the default.

Syntax

terminal character-encoding { gb18030 | utf-8 }

undo terminal character-encoding

Default

The character encoding of the current terminal is the same as the CLI.

Views

User view

Predefined user roles

network-admin

Parameters

gb18030: Specifies the GB18030 encoding.

utf-8: Specifies the UTF-8 encoding.

Usage guidelines

This command makes sense only when the system character encoding is configured. You can use character-encoding to specify the system and terminal encodings. If you change the user encoding on the user interface, use terminal character-encoding to change the terminal encoding to keep user encoding and terminal encoding consistent. The terminal character-encoding command takes effect immediately.

Examples

# Set the character encoding on the current terminal to UTF-8.

<Sysname> terminal character-encoding utf-8

Related commands

character-encoding

display character-encoding

terminal type

Use terminal type to specify the terminal display type.

Use undo terminal type to restore the default.

Syntax

terminal type { ansi | vt100 }

undo terminal type

Default

The terminal display type is ANSI.

Views

User line view

User line class view

Predefined user roles

network-admin

Parameters

ansi: Specifies the ANSI type.

vt100: Specifies the VT100 type.

Usage guidelines

The device supports two terminal display types: ANSI and VT100. As a best practice, specify the VT100 type on both the device and the configuration terminal. If either side uses the ANSI type, a display problem might occur when a command line has more than 80 characters. For example, a cursor positioning error might occur.

This command is available in both user line view and user line class view. A non-default setting in either view takes precedence over a default setting in the other view. A non-default setting in user line view takes precedence over a non-default setting in user line class view.

A terminal display type change does not take effect on the current session. It takes effect on subsequent login sessions.

Examples

# Set the terminal display type to VT100.

<Sysname> system-view

[Sysname] line vty 0

[Sysname-line-vty0] terminal type vt100

user-interface

Use user-interface to enter one or multiple user line views.

Syntax

user-interface { first-number1 [ last-number1 ] | { console | vty } first-number2 [ last-number2 ] }

Views

System view

Predefined user roles

network-admin

Parameters

first-number1: Specifies the absolute number of the first user line. The value range is 0 to 66.

last-number1: Specifies the absolute number of the last user line. The value range is 1 to 66. This number must be greater than first-number1.

console: Specifies the console line.

vty: Specifies the VTY line.

first-number2: Specifies the relative number of the first user line. The value range is 0 to 2 for console lines and 0 to 63 for VTY lines.

last-number2: Specifies the relative number of the last user line. The value is 1 or 2 for console lines and the value range is 1 to 63 for VTY lines. This number must be greater than first-number2.

Usage guidelines

This command is an older version reserved for backward compatibility purposes. It has the same functionality and output as the line command. As a best practice, use the line command.

To configure settings for a single user line, use this command to enter the user line view.

To configure the same settings for multiple user lines, use this command to enter multiple user line views.

Examples

# Enter the view of console line 0.

<Sysname> system-view

[Sysname] user-interface console 0

[Sysname-line-console0]

# Enter the views of VTY lines 0 to 4.

<Sysname> system-view

[Sysname] user-interface vty 0 4

[Sysname-line-vty0-4]

Related commands

user-interface class

user-interface class

Use user-interface class to enter user line class view.

Syntax

user-interface class { console | vty }

Views

System view

Predefined user roles

network-admin

Parameters

console: Specifies the console line class view.

vty: Specifies the VTY line class view.

Usage guidelines

This command is an older version reserved for backward compatibility purposes. It has the same functionality and output as the line class command. As a best practice, use the line class command.

To configure the same settings for all user lines of a line class, you can use this command to enter the user line class view.

The following commands are available in user line class view:

·     activation-key

·     auto-execute command

·     authentication-mode

·     command accounting

·     command authorization

·     escape-key

·     history-command max-size

·     idle-timeout

·     protocol inbound

·     screen-length

·     set authentication password

·     shell

·     terminal type

·     user-role

For commands that are available in both user line view and user line class view, the device uses the following rules to determine the settings to use:

·     A setting in user line view applies only to the user line. A setting in user line class view applies to all user lines of the class.

·     A non-default setting in either view takes precedence over a default setting in the other view. A non-default setting in user line view takes precedence over a non-default setting in user line class view.

·     A setting in user line class view does not take effect on current online users. It takes effect only for new login users.

Examples

# Set the CLI connection idle-timeout timer to 15 minutes in VTY line class view.

<Sysname> system-view

[Sysname] user-interface class vty

[Sysname-line-class-vty] idle-timeout 15

# In console line class view, configure character s as the terminal session activation key.

<Sysname> system-view

[Sysname] user-interface class console

[Sysname-line-class-console] activation-key s

[Sysname-line-class-console] quit

# In the view of console line 0, restore the default terminal session activation key.

[Sysname] user-interface console 0

[Sysname-line-console0] undo activation-key

Alternatively, you can use the following command:

[Sysname-line-console0] activation-key 13

To verify the configuration:

3.     Exit the session on console line 0.

[Sysname-line-console0] return

<Sysname> quit

4.     Log in again through the AUX line.

The following message appears:

Press ENTER to get started.

5.     Press Enter.

Pressing Enter does not start a session.

6.     Enter s.

A terminal session is started.

<Sysname>

Related commands

user-interface

user-role

Use user-role to assign a user role to a user line. The device assigns the user role to a user of the line when the user logs in.

Use undo user-role to remove a user role or restore the default.

Syntax

user-role role-name

undo user-role [ role-name ]

Default

A console user is assigned the network-admin user role. Other users are assigned the network-operator user role.

Views

User line view

User line class view

Predefined user roles

network-admin

Parameters

role-name: Specifies a user role name, a case-sensitive string of 1 to 63 characters. The user role can be user-defined or predefined. Available predefined user roles include network-admin, network-operator, and level-0 to level-15. The predefined security-audit and guest-manager user roles are not supported in user line view or user line class view. If you do not specify this argument, the undo user-role command restores the default user role.

Usage guidelines

Only users assigned the network-admin, or level-15 user role can execute this command. Other users cannot execute this command, even if they are granted the right to execute this command.

This command is available in both user line view and user line class view. A non-default setting in either view takes precedence over a default setting in the other view. A non-default setting in user line view takes precedence over a non-default setting in user line class view.

A user role change does not take effect on the current session. It takes effect on subsequent login sessions.

You can assign up to 64 user roles to a user line.

For more information about user roles, see RBAC configuration in Fundamentals Configuration Guide.

Examples

# Assign user role network-admin to console line 0.

<Sysname> system-view

[Sysname] line console 0

[Sysname-line-console0] user-role network-admin

web captcha

Use web captcha to specify a fixed verification code for Web login.

Use undo web captcha to restore the default.

Syntax

web captcha verification-code

undo web captcha

Default

No fixed verification code is specified for Web login. A Web user must enter the verification code displayed on the login page.

Views

User view

Predefined user roles

network-admin

Parameters

verification-code: Specifies the fixed verification code, a case-sensitive 4-character string.

Usage guidelines

In test environments where a script is used for Web function tests, you can configure a fixed verification code to improve test efficiency.

For Web access security purposes, do not use this feature in production environments.

If you execute the web captcha command multiple times, the most recent configuration takes effect.

This command is not saved to the configuration file and will not take effect after a reboot.

Examples

# Set the fixed verification code to test for Web login.

<Sysname> web captcha test

web https-authorization mode

Use web https-authorization mode to set the authentication mode for HTTPS login.

Use undo web https-authorization mode to restore the default.

Syntax

web https-authorization mode { auto | manual }

undo web https-authorization mode

Default

Manual authentication mode is used for HTTPS login.

Views

System view

Predefined user roles

network-admin

Parameters

auto: Uses the PKI certificate of an HTTPS client to authenticate the client automatically.

manual: Sends the login page to the HTTPS client, and uses the username and password entered on the page to authenticate the client.

Usage guidelines

In auto authentication mode, the device uses the PKI certificate of an HTTPS client to authenticate the client automatically.

·     If the certificate is valid, the value of the CN field is used as the username for AAA authentication.

¡     If the authentication succeeds, the Web interface appears on the client.

¡     If the authentication fails, the login page appears on the client. The user can log in to the Web interface after entering the correct username and password.

·     If the certificate is invalid (for example, expired), the device closes the HTTPS connection.

Examples

# Set the HTTPS login authentication mode to auto.

<Sysname> system-view

[Sysname] web https-authorization mode auto

web idle-timeout

Use web idle-timeout to set the Web connection idle-timeout timer.

Use undo web idle-timeout to restore the default.

Syntax

web idle-timeout idle-time

undo web idle-timeout

Default

The Web connection idle-timeout timer is 10 minutes.

Views

System view

Predefined user roles

network-admin

Parameters

idle-time: Specifies the Web connection idle-timeout timer in minutes. The value range is 1 to 999.

Usage guidelines

The system automatically terminates a Web user connection if no mouse or keyboard operation occurs within the idle-timeout interval.

This command takes effect immediately on current Web connections.

Examples

# Set the Web connection idle-timeout timer to 100 minutes.

<Sysname> system-view

[Sysname] web idle-timeout 100

webui log enable

Use webui log enable to enable Web operation logging.

Use undo webui log enable to disable Web operation logging.

Syntax

webui log enable

undo webui log enable

Default

Web operation logging is disabled.

Views

System view

Predefined user roles

network-admin

Usage guidelines

When Web operation logging is enabled, the device generates log messages for important Web operations, for example, system time change. The device outputs log messages as indicated by information center settings.

A Web operation log message includes the following information:

·     Module name WEB.

·     Mnemonic prefix WEBOPT_.

·     Web client IP address.

·     Web user's username.

The following is a sample log message:

%Feb 25 14:32:38:802 2020 Sysname WEB/6/WEBOPT_SET_TIME: -HostIP=192.168.100.235-User=Admin; Set the system date and time to 2020-02-27T10:00:00.

Examples

# Enable Web operation logging.

<Sysname> system-view

[Sysname] webui log enable

 

 

 

 

  • Cloud & AI
  • InterConnect
  • Intelligent Computing
  • Intelligent Storage
  • Security
  • SMB Products
  • Intelligent Terminal Products
  • Product Support Services
  • Technical Service Solutions
All Services
  • Resource Center
  • Policy
  • Online Help
  • Technical Blogs
All Support
  • Become A Partner
  • Partner Policy & Program
  • Global Learning
  • Partner Sales Resources
  • Partner Business Management
  • Service Business
All Partners
  • Profile
  • News & Events
  • Online Exhibition Center
  • Contact Us
All About Us
新华三官网