- Table of Contents
-
- 01-Fundamentals Command Reference
- 00-Preface
- 01-CLI commands
- 02-RBAC commands
- 03-Login management commands
- 04-FTP and TFTP commands
- 05-File system management commands
- 06-Configuration file management commands
- 07-Software upgrade commands
- 08-ISSU commands
- 09-Emergency shell commands
- 10-Device management commands
- 11-MDC commands
- 12-TCL commands
- 13-License management commands
- Related Documents
-
| Title | Size | Download |
|---|---|---|
| 03-Login management commands | 171.46 KB |
activation-key
Use activation-key to define a shortcut key for starting a terminal session.
Use undo activation-key to restore the default.
Syntax
activation-key character
undo activation-key
Default
Pressing Enter starts a terminal session.
Views
User interface view
Predefined user roles
network-admin
mdc-admin
Parameters
character: Specifies the shortcut key. It can be a single character, a key sequence, or the ASCII code value (in the range of 0 to 127) of the character or key sequence.
Usage guidelines
This command is not supported on VTY user interfaces.
To display the shortcut key you have defined, use the display current-configuration | include activation-key command.
Examples
# Configure character s as the shortcut key for starting a terminal session on the console user interface.
<Sysname> system-view
[Sysname] user-interface console 0
[Sysname-ui-console0] activation-key s
To verify the configuration:
1. Exit the console session.
[Sysname-ui-console0] return
<Sysname> quit
2. Log in to the console user interface again.
The following message appears.
Press ENTER to get started.
3. Press Enter.
Pressing Enter does not start a session.
4. Enter s.
A terminal session is started.
<Sysname>
authentication-mode
Use authentication-mode to set the authentication mode for a user interface.
Use undo authentication-mode to restore the default.
Syntax
authentication-mode { none | password | scheme }
undo authentication-mode
Default
The authentication mode is password for VTY and AUX user interfaces, and none for console user interfaces.
Views
User interface view
Predefined user roles
network-admin
mdc-admin
Parameters
none: Performs no authentication.
password: Performs local password authentication.
scheme: Performs AAA authentication. For more information about AAA, see Security Configuration Guide.
Usage guidelines
When the authentication mode is none, any user can log in without authentication. To improve device security, use the password or scheme authentication mode.
Examples
# Enable the none authentication mode for user interface VTY 0.
<Sysname> system-view
[Sysname] user-interface vty 0
[Sysname-ui-vty0] authentication-mode none
# Enable password authentication for user interface VTY 0 and set the password to 321.
<Sysname> system-view
[Sysname] user-interface vty 0
[Sysname-ui-vty0] authentication-mode password
[Sysname-ui-vty0] set authentication password simple 321
# Enable scheme authentication for user interface VTY 0 and set the username to 123 and the password to 321.
<Sysname> system-view
[Sysname] user-interface vty 0
[Sysname-ui-vty0] authentication-mode scheme
[Sysname-ui-vty0] quit
[Sysname] local-user 123 class manage
[Sysname-luser-manage-123] password simple 321
Related commands
set authentication password
auto-execute command
|
|
CAUTION: After configuring this command for a user interface, you might be unable to access the CLI through the user interface. Make sure you can access the CLI through a different user interface before you configure this command and save the configuration. |
Use auto-execute command to specify a command that is automatically executed when a user logs in to the current user interface.
Use undo auto-execute command to remove the configuration.
Syntax
auto-execute command command
undo auto-execute command
Default
Command auto-execution is disabled.
Views
User interface view
Predefined user roles
network-admin
mdc-admin
Parameters
command: Specifies the command to be automatically executed.
Usage guidelines
The device automatically executes the specified command when a user logs in to the user interface, and closes the user connection after the command is executed. If the command triggers another task, the device does not close the user connection until the task is completed.
Typically, you configure the auto-execute command telnet X.X.X.X command on the device so the device redirects a Telnet user to the host at X.X.X.X. In this case, the connection to the current device is closed when the user terminates the Telnet connection to X.X.X.X.
This command is not supported on the console user interface. If the device has only one AUX port and has no console port, this command is not supported on the AUX user interface.
Examples
# Configure the device to automatically Telnet to 192.168.1.41 after a user logs in to interface VTY 0.
<Sysname> system-view
[Sysname] user-interface vty 0
[Sysname-ui-vty0] auto-execute command telnet 192.168.1.41
% This action will lead to configuration failure through ui-vty0. Are you sure?
[Y/N]:y
[Sysname-ui-vty0]
# To verify the configuration, Telnet to 192.168.1.40.
The device automatically Telnets to 192.168.1.41, and the following output is displayed:
C:\> telnet 192.168.1.40
****************************************************************************
* Copyright (c) 2004-2012 Hangzhou H3C Tech. Co., Ltd. All rights reserved.*
* Without the owner's prior written consent, *
* no decompiling or reverse-engineering shall be allowed. *
****************************************************************************
<Sysname>
Trying 192.168.1.41 ...
Press CTRL+K to abort
Connected to 192.168.1.41 ...
****************************************************************************
* Copyright (c) 2004-2012 Hangzhou H3C Tech. 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 break the Telnet connection to 192.168.1.41, the Telnet connection to 192.168.1.40 is broken at the same time.
command accounting
Use command accounting to enable command accounting.
Use undo command accounting to restore the default.
Syntax
command accounting
undo command accounting
Default
Command accounting is disabled, and the accounting server does not record executed commands.
Views
User interface view
Predefined user roles
network-admin
mdc-admin
Usage guidelines
When command accounting is enabled and 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 issued by users are not recorded.
Examples
# Enable command accounting for user interface VTY 0.
<Sysname> system-view
[Sysname] user-interface vty 0
[Sysname-ui-vty0] command accounting
Related commands
· command authorization
· accounting command (Security Command Reference)
command authorization
Use command authorization to enable command authorization.
Use undo command authorization to restore the default.
Syntax
command authorization
undo command authorization
Default
Command authorization is disabled. Logged-in users can execute commands without authorization.
Views
User interface view
Predefined user roles
network-admin
mdc-admin
Usage guidelines
When command authorization is enabled, a command is available only if the user has the commensurate user role and is authorized to use the command by the AAA scheme.
Examples
# Enable command accounting for VTY 0 so a user logged in to VTY 0 can execute only authorized commands that are permitted by the user role.
<Sysname> system-view
[Sysname] user-interface vty 0
[Sysname-ui-vty0] command authorization
Related commands
· command accounting
· authorization command (Security Command Reference)
databits
Use databits to specify the number of data bits for each character.
Use undo databits to restore the default.
Syntax
databits { 5 | 6 | 7 | 8 }
undo databits
Default
Eight data bits are used for each character.
Views
User interface view
Predefined user roles
network-admin
mdc-admin
Parameters
5: Uses five data bits for each character.
6: Uses six data bits for each character.
7: Uses seven data bits for each character.
8: Uses eight data bits for each character.
Usage guidelines
This command is only applicable to asynchronous serial interfaces, including AUX and console ports.
This setting must be the same as that on the configuration terminal.
Examples
# Configure AUX 0 to use 5 data bits for each character.
<Sysname> system-view
[Sysname] user-interface aux 0
[Sysname-ui-aux0] databits 5
display telnet client
Use display telnet client to display the source IPv4 address or source interface configured for the device to use for outgoing Telnet packets when serving as a Telnet client.
Syntax
display telnet client
Views
Any view
Predefined user roles
network-admin
network-operator
mdc-admin
mdc-operator
Examples
# Display the Telnet client configuration of the device when it serves as a Telnet client.
<Sysname> display telnet client
The source IP address is 1.1.1.1.
The output shows that the device uses the source IPv4 address 1.1.1.1 for outgoing Telnet packets when it serves as a Telnet client.
Related commands
telnet client source
display user-interface
Use display user-interface to display user interface information.
Syntax
display user-interface [ number1 | { aux | console | vty } number2 ] [ summary ]
Views
Any view
Predefined user roles
network-admin
network-operator
mdc-admin
mdc-operator
Parameters
number1: Specifies the absolute number of a user interface, in the range of 0 to 19.
aux: Specifies the AUX user interface.
console: Specifies the console user interface.
vty: Specifies the VTY user interface.
number2: Specifies the relative number of a user interface. The value range varies with the user interface type:
· 0 to 1 for AUX user interfaces.
· 0 to 1 for console user interfaces.
· 0 to 15 for VTY user interfaces.
summary: Displays summary information about user interfaces. If you do not specify this keyword, the detailed information is displayed.
Examples
# Display information about user interface 0.
<Sysname> display user-interface 0
Idx Type Tx/Rx Modem Auth Int
0 CON 0 9600 - N -
+ : User interface is active.
F : User interface is active and in async mode.
Idx : Absolute index of user-interface.
Type : Type and relative index of user-interface.
Auth : Login authentication mode.
Int : Physical port of the user interface.
A : Authentication use AAA.
N : No authentication is required.
P : Password authentication.
Table 1 Command output
|
Field |
Description |
|
Modem |
Whether the modem allows calling in or out. By default, this attribute is not configured and an hyphen (-) is displayed. |
# Display summary information about all user interfaces.
<Sysname> display user-interface summary
User interface type : [CON]
0:XX
User interface type : [AUX]
2:XX
User interface type : [VTY]
4:UUXX XXXX XXXX XXXX
2 user interfaces used. (U)
18 user interfaces not used. (X)
Table 2 Command output
|
Fields |
Description |
|
number:status |
The number indicates the absolute number of the first user interface of the user interface type, starting from 0. The status indicates whether the user interfaces of the user interface type are used (X for unused and U for used). For example, if "4:UUXX XXXX XXXX XXXX " is displayed, there are 16 user interfaces of the user interface type, which use the absolute numbers 4 through 19. User interfaces 4 and 5 are in use, and the other user interfaces are not. |
display users
Use display users to display information about the user interfaces that are being used.
Use display users all to display information about all user interfaces that are supported by the device.
Syntax
display users [ all ]
Views
Any view
Predefined user roles
network-admin
network-operator
mdc-admin
mdc-operator
Parameters
all: Displays information about all user interfaces supported by the device.
Examples
# Display information about the user interfaces being used.
<Sysname> display users
Idx UI Idle Time Pid Type
4 VTY 0 03:09:30 Jun 27 10:50:29 238 TEL
+ 5 VTY 1 00:00:00 Jun 27 13:57:30 354 TEL
Following are more details.
VTY 0 :
Location: 192.168.3.51
VTY 1 :
Location: 192.168.3.15
+ : Current operation user.
F : Current operation user works in async mode.
The output shows that two users have logged in to the device: one is using user interface VTY 0 and the other (yourself) is using VTY 1. Your IP address is 192.168.3.15.
Table 3 Command output
|
Field |
Description |
|
Idx |
Absolute number of the user interface. |
|
UI |
Type and relative number of the user interface. |
|
Idle |
Time elapsed after the user's last input, in the format hh:mm:ss. |
|
Time |
Login time of the user. |
|
Pid |
Process ID of the user session. |
|
Type |
User type, such as Telnet and SSH. |
|
Location |
IP address of the user. |
escape-key
Use escape-key to define a shortcut key for terminating tasks.
Use undo escape-key to disable the shortcut key for terminating tasks.
Syntax
escape-key { character | default }
undo escape-key [ default ]
Default
Pressing Ctrl+C terminates a task.
Views
User interface view
Predefined user roles
network-admin
mdc-admin
Parameters
character: Specifies the shortcut key. It can be a single character, a key sequence, or the ASCII code value (in the range of 0 to 127) of the character or key sequence.
default: Restores the default escape key sequence Ctrl+C.
Usage guidelines
In some situation, some commands might take a long time to complete, for example, when the ping command has 1000 packets to send or the tracert command is used for an unreachable destination. Before such a command is completed, you can stop the command by pressing the shortcut key for terminating tasks.
Whether a command can be terminated by Ctrl+C by default depends on the software implementation of the command. For more information, see the description of the command.
If you define a single character as the shortcut key for terminating tasks, pressing the character when a command is being executed stops the command. If no command is being executed, pressing the character enters the character as a common character.
You can execute this command multiple times, but only the most recent configuration takes effect. To view the current shortcut key definition, use the display current-configuration command.
Examples
# Define character a as the shortcut key for terminating a task.
<Sysname> system-view
[Sysname] user-interface console 0
[Sysname-ui-console0] 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
56 bytes from 192.168.1.49: icmp_seq=0 ttl=255 time=0.253 ms
56 bytes from 192.168.1.49: icmp_seq=1 ttl=255 time=0.169 ms
56 bytes from 192.168.1.49: icmp_seq=2 ttl=255 time=0.151 ms
2. Press a.
The task is terminated and the system returns to user view.
--- 192.168.1.49 ping statistics ---
20 packet(s) transmitted, 20 packet(s) received, 0.0% packet loss
round-trip min/avg/max/stddev = 0.151/0.186/0.253/0.021 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
The flow control mode is none.
Views
User interface view
Predefined user roles
network-admin
mdc-admin
Parameters
hardware: Performs hardware flow control.
none: Disables flow control.
software: Performs software flow control.
Usage guidelines
This command is only applicable to asynchronous serial interfaces, including AUX and console ports.
The device supports flow control in both the inbound and outbound directions, and the specified flow control mode takes effect in both directions. In hardware or software flow control mode, the local device listens to flow control information from and sends flow control information to the remote device to control the transmission rates of incoming traffic and outgoing traffic.
To communicate, two devices must be configured with the same flow control mode.
Examples
# Configure software flow control in the inbound and outbound directions for user interface Console 0.
<Sysname> system-view
[Sysname] user-interface console 0
[Sysname-ui-console0] flow-control software
free user-interface
Use free user-interface to release a user interface.
Syntax
free user-interface { number1 | { aux | console | vty } number2 }
Views
User view
Predefined user roles
network-admin
mdc-admin
Parameters
number1: Specifies the absolute number of a user interface, in the range of 0 to 19.
aux: Specifies the AUX user interface.
console: Specifies the console user interface.
vty: Specifies the VTY user interface.
number2: Specifies the relative number of a user interface. The value range varies with the user interface type:
· 0 to 1 for AUX user interfaces.
· 0 to 1 for console user interfaces.
· 0 to 15 for VTY user interfaces.
Usage guidelines
This command cannot release the connection you are using.
Examples
# Release user interface VTY 1:
1. Display which users are operating the device.
<Sysname> display users
Idx UI Idle Time Pid Type
4 VTY 0 03:09:30 Jun 27 10:50:29 238 TEL
+ 5 VTY 1 00:00:00 Jun 27 13:57:30 354 TEL
Following are more details.
VTY 0 :
Location: 192.168.3.51
VTY 1 :
Location: 192.168.3.15
+ : Current operation user.
F : Current operation user works in async mode.
2. If the operations of the user on VTY 1 affect your operations, log out the user.
<Sysname> free user-interface vty 1
Are you sure to free user-interface vty1? [Y/N]:y
[OK]
history-command max-size
Use history-command max-size to set the size of the command history buffer for a user interface.
Use undo history-command max-size to restore the default.
Syntax
history-command max-size size-value
undo history-command max-size
Default
The buffer of a user interface saves up to 10 history commands.
Views
User interface view
Predefined user roles
network-admin
mdc-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 interface uses a separate command history buffer to save commands successfully executed by its user. The size of the buffer determines how many history commands the buffer can store.
To view stored history commands on your user interface, press the up arrow key or down arrow key or execute the display history-command command.
Terminating a CLI session clears the commands in the history buffer.
Examples
# Set the size of the command history buffer to 20 for user interface Console 0.
<Sysname> system-view
[Sysname] user-interface console 0
[Sysname-ui-console0] history-command max-size 20
idle-timeout
Use idle-timeout to set the session idle-timeout timer.
Use undo idle-timeout to restore the default.
Syntax
idle-timeout minutes [ seconds ]
undo idle-timeout
Default
The idle-timeout interval is 10 minutes.
Views
User interface view
Predefined user roles
network-admin
mdc-admin
Parameters
minutes: Specifies the number of minutes for the idle-timeout interval, in the range of 0 to 35791. The default is 10 minutes.
seconds: Specifies the number of seconds for the idle-timeout interval, in the range of 0 to 59. The default is 0 seconds.
Usage guidelines
The system automatically terminates the user connection on the user interface if there is no information interaction between the device and the user within the idle-timeout interval.
Setting the idle-timeout timer to 0 disables the idle-timeout function.
Examples
# Set the idle-timeout timer to 1 minute and 30 seconds for user interface Console 0.
<Sysname> system-view
[Sysname] user-interface console 0
[Sysname-ui-console0] idle-timeout 1 30
lock
Use lock to lock the current user interface. This method prevents unauthorized users from using the user interface.
Syntax
lock
Default
By default, the system does not lock any user interface.
Views
User view
Predefined user roles
network-admin
mdc-admin
Usage guidelines
When you execute the lock command, you are asked to enter a password (up to 16 characters) and then confirm it by entering the password again.
To unlock the user interface, press Enter and enter the correct password.
Examples
# Lock the current user interface and then unlock it.
<Sysname> lock
Please input password<1 to 16> to lock current user terminal interface:
Password:
Again:
locked !
// The user interface is locked. To unlock it, press Enter and enter the password:
Password:
<Sysname>
parity
Use parity to specify a parity check mode.
Use undo parity to restore the default.
Syntax
parity { even | mark | none | odd | space }
undo parity
Default
The setting is none, and no parity check is performed.
Views
User interface view
Predefined user roles
network-admin
mdc-admin
Parameters
even: Performs even parity check.
mark: Performs mark parity check.
none: Disables parity check.
odd: Performs odd parity check.
space: Performs space parity check.
Usage guidelines
This command is only applicable to asynchronous serial interfaces, including AUX and console ports.
The configuration terminal and the device must be configured with the same parity check mode to communicate.
Examples
# Configure user interface AUX 0 to perform odd parity check.
<Sysname> system-view
[Sysname] user-interface aux 0
[Sysname-ui-aux0] parity odd
protocol inbound
Use protocol inbound to enable a user interface to support Telnet, PAD, SSH, or all three protocols.
Use undo protocol inbound to restore the default.
Syntax
protocol inbound { all | pad | ssh | telnet }
undo protocol inbound
Default
SSH and Telnet protocols are supported.
Views
VTY user interface view
Predefined user roles
network-admin
mdc-admin
Parameters
all: Supports all three protocols.
pad: Supports PAD only. The device does not support this keyword.
ssh: Supports SSH only.
telnet: Supports Telnet only.
Usage guidelines
This configuration is effective only for a user who logs in to the user interface after the configuration is made.
Before configuring a user interface to support SSH, set the authentication mode to scheme for the user interface. For more information, see authentication-mode.
Examples
# Enable user interfaces VTY 0 through VTY 15 to support only SSH.
<Sysname> system-view
[Sysname] user-interface vty 0 15
[Sysname-ui-vty0-15] authentication-mode scheme
[Sysname-ui-vty0-15] protocol inbound ssh
screen-length
Use screen-length to set the maximum number of lines to be displayed on a screen.
Use undo screen-length to restore the default.
Syntax
screen-length screen-length
undo screen-length
Default
Up to 24 lines are displayed on a screen.
Views
User interface view
Predefined user roles
network-admin
mdc-admin
Parameters
screen-length: Specifies the maximum number of lines to be displayed on a screen, in the range of 0 to 512. Setting it to 0 disables pausing between screens of output.
Usage guidelines
This command sets the maximum number of lines that can be displayed on one screen when the screen pause function is enabled. If the screen pause function is disabled, the system displays command output without any pause.
The actual number of lines that can be displayed on a screen is restricted by the display specification of the configuration terminal. For example, if the display specification is 24 lines but the specified maximum number of lines for a screen is 40, the device sends 40 lines to the screen at a time but only the last 24 lines are displayed on the screen. To view the previous 16 lines, you must press PgUp.
The screen pause function is enabled by default. To disable this function, execute the screen-length 0 command or the screen-length disable command.
Examples
# Set the maximum number of lines to be displayed on a screen to 30 for user interface Console 0.
<Sysname> system-view
[Sysname] user-interface console 0
[Sysname-ui-console0] screen-length 30
screen-length disable
send
Use send to send messages to user interfaces.
Syntax
send { all | number1 | { aux | console | vty } number2 }
Views
User view
Predefined user roles
network-admin
mdc-admin
Parameters
all: Specifies all user interfaces.
number1: Specifies the absolute number of a user interface, in the range of 0 to 19.
aux: Specifies the AUX user interface.
console: Specifies the console user interface.
vty: Specifies the VTY user interface.
number2: Specifies the relative number of a user interface. The value range varies with the user interface type:
· 0 to 1 for AUX user interfaces.
· 0 to 1 for console user interfaces.
· 0 to 15 for VTY user interfaces.
Usage guidelines
To end a message, press Enter. To cancel a message and return to user view, press Ctrl+C.
Examples
# Before you restart the device, send a notification to VTY 1 to inform the user.
<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 screen of the user's configuration terminal, as shown in the following example:
[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 a password for password authentication.
Use undo set authentication password to remove the password.
Syntax
set authentication password { hash | simple } password
undo set authentication password
Default
No password is set for password authentication.
Views
User interface view
Predefined user roles
network-admin
mdc-admin
Parameters
hash: Sets a hashed password.
simple: Sets a plaintext password.
password: Specifies the password string. This argument is case sensitive. If simple is specified, it must be a string of 1 to 16 characters. If hash is specified, it must be a string of 1 to 110 characters.
Usage guidelines
Whether you specify the hash or simple keyword for the command, the password is hashed before being saved to the configuration file.
Examples
# Set the password for password authentication on user interface Console 0 to hello.
<Sysname> system-view
[Sysname] user-interface console 0
[Sysname-ui-console0] authentication-mode password
[Sysname-ui-console0] set authentication password simple hello
When you relog in to user interface Console 0, you must enter the password hello to pass authentication.
Related commands
authentication-mode
shell
Use shell to enable the terminal service for a user interface.
Use undo shell to disable the terminal service for a user interface.
Syntax
shell
undo shell
Default
The terminal service is enabled on all user interfaces.
Views
User interface view
Predefined user roles
network-admin
mdc-admin
Usage guidelines
The console user interface does not support the undo shell command.
The AUX user interface does not support the undo shell command when the device has only one AUX port and no console port.
You cannot disable the terminal service on the user interface you are using.
To configure the device to act as a Telnet or SSH server on a user interface, you cannot configure the undo shell command for the user interface.
Examples
# Disable the terminal service for user interface VTY 0 through VTY 15 so no user can log in to the device through the user interfaces.
<Sysname> system-view
[Sysname] user-interface vty 0 15
[Sysname-ui-vty0-15] undo shell
Disable ui-vty0-15 , are you sure? [Y/N]:y
[Sysname-ui-vty0-15]
speed
Use speed to set the transmission rate (also called the "baud rate") on a user interface.
Use undo speed to restore the default.
Syntax
speed speed-value
undo speed
Default
The transmission rate is 9600 bps.
Views
User interface view
Predefined user roles
network-admin
mdc-admin
Parameters
speed-value: Transmission rate in bps. The transmission rates available for asynchronous serial interfaces include: 300 bps, 600 bps, 1200 bps, 2400 bps, 4800 bps, 9600 bps, 19200 bps, 38400 bps, 57600 bps, and 115200 bps. The transmission rate varies with devices and configuration environments.
Usage guidelines
This command is only applicable to asynchronous serial interfaces, including AUX and console ports.
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 user interface AUX 0.
<Sysname> system-view
[Sysname] user-interface aux 0
[Sysname-ui-aux0] 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 interface view
Predefined user roles
network-admin
mdc-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.
2: Uses two stop bits.
Usage guidelines
This command is only applicable to asynchronous serial interfaces, including AUX and console ports.
The configuration terminal and the device must be configured to use the same number of stop bits to communicate.
Examples
# Set the number of stop bits to 2 for user interface AUX 0.
<Sysname> system-view
[Sysname] user-interface aux 0
[Sysname-ui-aux0] stopbits 2
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 } ]
Views
User view
Predefined user roles
network-admin
mdc-admin
Parameters
remote-host: Specifies the IPv4 address or host name of a remote host, a case-insensitive string of 1 to 20 characters.
service-port: Specifies the TCP port number for the Telnet service on the remote host, in the range of 0 to 65535. The default is 23.
vpn-instance vpn-instance-name: Specifies the MPLS L3VPN that the remote host belongs to, where vpn-instance-name is a case-sensitive string of 1 to 31 characters. If the remote host is on the public network, do not specify this option.
source: Specifies a source IPv4 address or source interface for outgoing Telnet packets.
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.
Usage guidelines
To terminate the current Telnet connection, press Ctrl+K or execute the quit command.
The source IPv4 address or source interface that is specified by this command is only applicable to the current Telnet connection.
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 outgoing Telnet packets when the device serves as a Telnet client.
Use undo telnet client source to remove the configuration.
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 for outgoing Telnet packets. The source IPv4 address is the primary IPv4 address of the outbound interface.
Views
System view
Predefined user roles
network-admin
mdc-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 source IPv4 address or source interface that is specified by this command applies to all Telnet connections. However, if a user specifies a source IPv4 address or source interface when executing the telnet command, the setting specified by the user takes effect.
Examples
# Set the source IPv4 address for outgoing Telnet packets to 1.1.1.1 when the device serves as a Telnet client.
<Sysname> system-view
[Sysname] telnet client source ip 1.1.1.1
Related commands
display telnet client
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 ]
Views
User view
Predefined user roles
network-admin
mdc-admin
Parameters
remote-host: Specifies the IP address or host name of a remote host, a case-insensitive string of 1 to 46 characters.
-i interface-type interface-number: Specifies the outbound interface for sending Telnet packets. This option is required when the destination address is a link-local address.
port-number: Specifies the TCP port number for the Telnet service on the remote host, in the range of 0 to 65535. The default is 23.
vpn-instance vpn-instance-name: Specifies the MPLS L3VPN that the remote host belongs to, where vpn-instance-name is a case-sensitive string of 1 to 31 characters. If the remote host is on the public network, do not specify this option.
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 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 acl-number
undo telnet server acl
Default
No ACL is used to filter Telnet logins.
Views
System view
Predefined user roles
network-admin
mdc-admin
Parameters
acl-number: Specifies an ACL by its number:
· Basic ACL—2000 to 2999.
· Advanced ACL—3000 to 3999.
· Ethernet frame header ACL—4000 to 4999.
Usage guidelines
Only one ACL can be used to filter Telnet logins, and only users permitted by the ACL can Telnet to the device.
This command does not take effect on existing Telnet connections.
You can specify an ACL that has not been created yet in this command. The command takes effect after the ACL is created.
For more information about ACL, see ACL and QoS Configuration Guide.
Examples
# Permit only the user at 1.1.1.1 to Telnet to the device.
<Sysname> system-view
[Sysname] acl number 2001
[Sysname-acl-basic-2001] rule permit source 1.1.1.1 0
[Sysname-acl-basic-2001] quit
[Sysname] telnet server acl 2001
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 ] acl-number
undo telnet server ipv6 acl
Default
No ACL is used to filter IPv6 Telnet logins.
Views
System view
Predefined user roles
network-admin
mdc-admin
Parameters
acl-number: Specifies an IPv6 ACL by its number:
· Basic ACL—2000 to 2999. The ipv6 option is required.
· Advanced ACL—3000 to 3999. The ipv6 option is required.
· Ethernet frame header ACL—4000 to 4999. Do not specify the ipv6 option.
Usage guidelines
If the ACL does not exist or has no rules, all users are permitted to Telnet to the device.
When the ACL exists and has rules, only users permitted by the ACL can Telnet to the device.
This command is not effective for existing Telnet connections.
If you execute this command multiple times, the most recent configuration takes effect.
For more information about ACL, see ACL and QoS Configuration Guide.
Examples
# Permit only the user at 2000::1 to Telnet to the device.
<Sysname> system-view
[Sysname] acl ipv6 number 2001
[Sysname-acl6-basic-2001] rule permit source 2000::1 128
[Sysname-acl6-basic-2001] quit
[Sysname] telnet server ipv6 acl ipv6 2001
telnet server enable
Use telnet server enable to enable the Telnet server function.
Use undo telnet server enable to disable the Telnet server function.
Syntax
telnet server enable
undo telnet server enable
Default
The Telnet server function is disabled.
Views
System view
Predefined user roles
network-admin
mdc-admin
Usage guidelines
Administrators can Telnet to the device only when the Telnet server function is enabled.
Examples
# Enable the Telnet server function.
<Sysname> system-view
[Sysname] telnet server enable
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 interface view
Predefined user roles
network-admin
mdc-admin
Parameters
ansi: Specifies the terminal display type ANSI.
vt100: Specifies the terminal display type VT100.
Usage guidelines
The device supports two terminal display types: ANSI and VT100. To ensure proper display on the terminal, set the display type of both the device and the configuration terminal to VT100. Otherwise, when a command line has more than 80 characters, an anomaly such as cursor positioning error or abnormal terminal display might occur.
Examples
# Set the terminal display type to VT100.
<Sysname> system-view
[Sysname] user-interface vty 0
[Sysname-ui-vty0] terminal type vt100
user-interface
Use user-interface to enter one or multiple user interface views.
Syntax
user-interface { first-number1 [ last-number1 ] | { aux | console | vty } first-number2 [ last-number2 ] }
Views
System view
Predefined user roles
network-admin
mdc-admin
Parameters
first-number1: Specifies the absolute number of the first user interface, in the range of 0 to 19.
last-number1: Specifies the absolute number of the last user interface, in the range of 0 to 19.
aux: Specifies the AUX user interface.
console: Specifies the console user interface.
vty: Specifies the VTY user interface.
first-number2: Specifies the relative number of the first user interface. The value range varies with the user interface type:
· 0 to 1 for AUX user interfaces.
· 0 to 1 for console user interfaces.
· 0 to 15 for VTY user interfaces.
last-number2: Specifies the relative number of the last user interface. This number cannot be smaller than first-number2.
Usage guidelines
If you use this command to enter a single user interface view, your configuration applies only to the user interface.
If you use this command to enter multiple user interface views, your configuration applies to all the specified user interfaces.
Examples
# Enter the view of user interface Console 0.
<Sysname> system-view
[Sysname] user-interface console 0
[Sysname-ui-console0]
# Enter the views of user interfaces VTY 0 to VTY 15.
<Sysname> system-view
[Sysname] user-interface vty 0 15
[Sysname-ui-vty0-15]
user-role
Use user-role to assign a user role to a user interface so users logged in to the user interface get the user role at login.
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 interface user of the default MDC is assigned the user role network-admin, users of other default MDC user interfaces are assigned the user role network-operator. A non-default MDC user switched from the default device using the switchto mdc command is assigned the user role mdc-admin, other non-default MDC users are assigned the user role mdc-operator.
Views
User interface view
Predefined user roles
network-admin
mdc-admin
Parameters
role-name: Specifies a user role name, a case-sensitive string of 1 to 63 characters. The user role can be predefined (network-admin, network-operator, mdc-admin, mdc-operator, or level-0 to level-15) or user-defined. If you do not specify this argument for the undo user-role command, the command restores the default user role.
Usage guidelines
You can assign up to 64 user roles to a user interface. A user logged in to the user interface gets all the user roles.
For more information about user roles, see "Configuring RBAC."
Examples
# Assign user role network-admin to user interface AUX 0.
<Sysname> system-view
[Sysname] user-interface aux 0
[Sysname-ui-aux0] user-role network-admin

