Chapter 1 Basic Configurations
While performing basic configurations of the
system, go to these sections for information you are interested in:
l
Basic Configurations
l
CLI Features
1.1 Basic
Configurations
This section covers the following topics:
l
Entering/Exiting System
View
l
Configuring the Device Name
l
Configuring the System Clock
l
Configuring a Banner
l
Configuring CLI Hotkeys
l
Configuring User Levels
and Command Levels
l
Displaying and Maintaining
Basic Configurations
1.1.1 Entering/Exiting System View
Follow these steps to enter/exit system view:
|
To do…
|
Use the command…
|
Remarks
|
|
Enter system view from user view
|
system-view
|
—
|
|
Return to user view from system view
|
quit
|
—
|
With the quit
command, you can return to the previous view. You can execute the return
command or press the hot key <Ctrl+Z> to return to user view.
1.1.2 Configuring the Device Name
|
To do…
|
Use the command…
|
Remarks
|
|
Enter
system view
|
system-view
|
—
|
|
Configure
the device name
|
sysname sysname
|
Optional
The device
name is H3C by default.
|
1.1.3 Configuring the System Clock
I. Configuring the system clock
Follow these steps to configure the system
clock:
|
To do…
|
Use the command…
|
Remarks
|
|
Set time and date
|
clock datetime time date
|
Optional
Available in user view.
|
|
Set the time zone
|
clock timezone zone-name { add | minus
} zone-offset
|
|
Set a summer time scheme
|
clock summer-time zone-name one-off start-time start-date end-time
end-date add-time
|
|
clock summer-time zone-name repeating start-time start-date
end-time end-date add-time
|
II. Displaying the system clock
The system clock is displayed by system
time stamp, which is the same as that displayed by the display clock
command. The system clock is decided by the commands clock datetime, clock
timezone and clock summer-time. If these three commands are not
configured, the display clock command displays the original system
clock. If you combine these three commands in different ways, the system clock
is displayed in the ways shown in Table 1-1. The meanings of the
parameters in the configuration column are as follows:
l
1 indicates date-time has been configured with
the clock datetime.
l
2 indicates time-zone has been configured with
the clock timezone command and the offset time is zone-offset.
l
3 indicates summer time has been configured with
the clock summer-time command and the offset time is summer-offset.
l
[1] indicates the clock datetime command
is an optional configuration.
l
The default system clock is 2005/1/1 1:00:00 in
the example.
Table 1-1 Relationship between the
configuration and display of the system clock
|
Configuration
|
System clock displayed by the display
clock command
|
Example
|
|
1
|
date-time
|
Configure:
clock datetime 1:00 2007/1/1
Display: 01:00:00
UTC Mon 01/01/2007
|
|
2
|
The
original system clock ± zone-offset
|
Configure:
clock timezone zone-time add 1
Display: 02:00:00
zone-time Sat 01/01/2005
|
|
1 and 2
|
date-time ± zone-offset
|
Configure: clock datetime 2:00 2007/2/2
and clock timezone zone-time add 1
Display: 03:00:00 zone-time Fri
02/02/2007
|
|
[1], 2 and 1
|
date-time
|
Configure: clock timezone zone-time add 1
and clock datetime 3:00 2007/3/3
Display: 03:00:00 zone-time Sat
03/03/2007
|
|
3
|
If the original system clock is not in
the summer time range, the original system clock is displayed.
|
Configure: clock summer-time ss one-off
1:00 2006/1/1 1:00 2006/8/8 2
Display: 01:00:00 UTC Sat 01/01/2005
|
|
If the original system clock is in the
summer time range, the original system clock + summer-offset is
displayed.
|
Configure: clock summer-time ss one-off 00:30
2005/1/1 1:00 2005/8/8 2
Display: 03:00:00 ss Sat 01/01/2005
|
|
1 and 3
|
If date-time is not in the summer
time range, date-time is displayed.
|
Configure: clock datetime 1:00 2007/1/1
and clock summer-time ss one-off 1:00 2006/1/1 1:00 2006/8/8 2
Display: 01:00:00 UTC Mon 01/01/2007
|
|
If date-time is in the summer time
range, “date-time” + “summer-offset” is
displayed.
|
Configure: clock datetime 8:00 2007/1/1
and clock summer-time ss one-off 1:00 2007/1/1 1:00 2007/8/8 2
Display: 10:00:00 ss Mon 01/01/2007
|
|
[1], 3 and 1
|
If date-time is not in the summer
time range, date-time is displayed.
|
Configure: clock summer-time ss one-off
1:00 2007/1/1 1:00 2007/8/8 2 and clock datetime 1:00 2008/1/1
Display: 01:00:00 UTC Tue 01/01/2008
|
|
date-time
is in the summer time range:
If the value of “date-time”
- “summer-offset” is not in the summer-time range, “date-time”
- “summer-offset” is displayed;
If the value of “date-time” - “summer-offset”
is in the summer-time range, date-time is displayed.
|
Configure: clock summer-time ss one-off
1:00 2007/1/1 1:00 2007/8/8 2 and clock datetime 1:30 2007/1/1
Display: 23:30:00 UTC Sun 12/31/2006
|
|
Configure: clock summer-time ss one-off
1:00 2007/1/1 1:00 2007/8/8 2 and clock datetime 3:00 2007/1/1
Display: 03:00:00 ss Mon 01/01/2007
|
|
2 and 3 or 3 and 2
|
If the value of the original system clock
± “zone-offset”
is not in the summer-time range, the original system clock ± “zone-offset”
is displayed.
|
Configure: clock timezone zone-time add 1
and clock summer-time ss one-off 1:00 2007/1/1 1:00 2007/8/8 2
Display: 02:00:00 zone-time Sat
01/01/2005
|
|
Configure: clock timezone zone-time add 1
and clock summer-time ss one-off 1:00 2005/1/1 1:00 2005/8/8 2
Display: 04:00:00 ss Sat 01/01/2005
|
|
If the value of the original system clock
± “zone-offset”
is in the summer-time range, the original system clock ± “zone-offset”
+ ”summer-offset” is displayed.
|
Configure: clock datetime 1:00 2007/1/1, clock
timezone zone-time add 1 and clock summer-time ss one-off 1:00 2008/1/1 1:00
2008/8/8 2
Display: 02:00:00 zone-time Mon
01/01/2007
|
|
1, 2 and 3
or 1, 3 and 2
|
If the
value of "date-time"±"zone-offset"
is not in the summer-time range, "date-time"±"zone-offset"
is displayed.
|
Configure:
clock datetime 1:00 2007/1/1, clock timezone zone-time add 1 and clock summer-time
ss one-off 1:00 2007/1/1 1:00 2007/8/8 2
Display: 04:00:00
ss Mon 01/01/2007
|
|
If the
value of "date-time"±"zone-offset"
is in the summer-time range, "date-time"±"zone-offset"+”summer-offset”
is displayed.
|
Configure:
clock timezone zone-time add 1, clock summer-time ss one-off 1:00 2008/1/1
1:00 2008/8/8 2 and clock datetime 1:00 2007/1/1
Display: 01:00:00
zone-time Mon 01/01/2007
|
|
[1], 2, 3 and 1 or [1], 3, 2 and 1
|
If date-time is not in the summer
time range, date-time is displayed.
|
Configure: clock timezone zone-time add 1,
clock summer-time ss one-off 1:00 2008/1/1 1:00 2008/8/8 2 and clock datetime
1:30 2008/1/1
Display: 23:30:00 zone-time Mon
12/31/2007
|
|
date-time
is in the summer time range:
If the value of “date-time”-“summer-offset”
is not in the summer-time range, “date-time”-“summer-offset”
is displayed;
If the value of “date-time”-“summer-offset” is
in the summer-time range, date-time is displayed.
|
Configure: clock timezone zone-time add 1,
clock summer-time ss one-off 1:00 2008/1/1 1:00 2008/8/8 2 and clock datetime
3:00 2008/1/1
Display: 03:00:00 ss Tue 01/01/2008
|
1.1.4 Configuring a Banner
I. Introduction to banners
Banners are prompt information displayed
by the system when users are connected to the device, perform login
authentication, and start interactive configuration. The administrator can set
corresponding banners as needed.
At present, the system supports the
following five kinds of welcome information.
l
shell banner,
also called session banner, displayed when a non Modem user enters user view.
l
incoming banner,
also called user interface banner, displayed when a user interface is activated
by a Modem user.
l
login banner, welcome
information at login authentications, displayed when password and scheme
authentications are configured.
l
motd banner, welcome
information displayed before authentication.
l
legal banner, also
called authorization information. The system displays some copyright or
authorization information, and then displays the legal banner before a
user logs in, waiting for the user to confirm whether to continue the
authentication or login. If entering Y or pressing the Enter key, the
user enters the authentication or login process; if entering N, the user quits
the authentication or login process. Y and N are case insensitive.
II. Configuring a banner
When you configure a banner, the system
supports two input modes. One is to input all the banner information right
after the command keywords. The start and end characters of the input text must
be the same but are not part of the banner information. In this case, the input
text, together with the command keywords, cannot exceed 510 characters. The
other is to input all the banner information in multiple lines by pressing the Enter
key. In this case, up to 2000 characters can be input.
The latter input mode can be achieved in
the following three ways:
l
Press the Enter key directly after the
command keywords, and end the setting with the % character. The Enter
and % characters are not part of the banner information.
l
Input a character after the command keywords at
the first line, and then press the Enter key. End the setting with the
character input at the first line. The character at the first line and the end
character are not part of the banner information.
l
Input multiple characters after the command
keywords at the first line (with the first and last characters being different),
then press the Enter key. End the setting with the first character at
the first line. The first character at the first line and the end character are
not part of the banner information.
Follow these steps to configure a banner:
|
To do…
|
Use the command…
|
Remarks
|
|
Enter system view
|
system-view
|
—
|
|
Configure the banner to be displayed at
login
|
header incoming text
|
Optional
|
|
Configure the banner to be displayed at
login authentication
|
header login text
|
Optional
|
|
Configure the authorization information
before login
|
header legal text
|
Optional
|
|
Configure the banner to be displayed when
a user enters user view
|
header shell text
|
Optional
|
|
Configure the banner to be displayed before
login
|
header motd text
|
Optional
|
1.1.5 Configuring CLI Hotkeys
Follow these steps to configure CLI
hotkeys:
|
To do…
|
Use the command…
|
Remarks
|
|
Enter system view
|
system-view
|
—
|
|
Configure CLI hotkeys
|
hotkey { CTRL_G
| CTRL_L | CTRL_O | CTRL_T | CTRL_U } command
|
Optional
The <Ctrl+G>, <Ctrl+L> and <Ctrl+O>
hotkeys are specified with command lines by default.
|
|
Display hotkeys
|
display hotkey
|
Available in any view. Refer to Table 1-2
for hotkeys reserved by the system.
|
By default, the <Ctrl+G>,
<Ctrl+L> and <Ctrl+O> hotkeys are configured with command line and
the <Ctrl+T> and <Ctrl+U> commands are NULL.
l
<Ctrl+G> corresponds to the display
current-configuration command.
l
<Ctrl+L> corresponds to the display ip
routing-table command.
l
<Ctrl+O> corresponds to the undo
debugging all command.
Table 1-2 Hotkeys reserved by the system
|
Hotkey
|
Function
|
|
<Ctrl+A>
|
Moves the cursor to the beginning of the
current line.
|
|
<Ctrl+B>
|
Moves the cursor one character to the
left.
|
|
<Ctrl+C>
|
Stops performing a command.
|
|
<Ctrl+D>
|
Deletes the character at the current
cursor position.
|
|
<Ctrl+E>
|
Moves the cursor to the end of the
current line.
|
|
<Ctrl+F>
|
Moves the cursor one character to the
right.
|
|
<Ctrl+H>
|
Deletes the character to the left of the
cursor.
|
|
<Ctrl+K>
|
Terminates an outgoing connection.
|
|
<Ctrl+N>
|
Displays the next command in the history
command buffer.
|
|
<Ctrl+P>
|
Displays the previous command in the
history command buffer.
|
|
<Ctrl+R>
|
Redisplays the current line information.
|
|
<Ctrl+V>
|
Pastes the content in the clipboard.
|
|
<Ctrl+W>
|
Deletes all the characters in a
continuous string to the left of the cursor.
|
|
<Ctrl+X>
|
Deletes all the characters to the left of
the cursor.
|
|
<Ctrl+Y>
|
Deletes all the characters to the right
of the cursor.
|
|
<Ctrl+Z>
|
Exits to user view.
|
|
<Ctrl+]>
|
Terminates an incoming connection or a redirect
connection.
|
|
<Esc+B>
|
Moves the cursor to the leading character
of the continuous string to the left.
|
|
<Esc+D>
|
Deletes all the characters of the
continuous string at the current cursor position and to the right of the
cursor.
|
|
<Esc+F>
|
Moves the cursor to the front of the next
continuous string to the right.
|
|
<Esc+N>
|
Moves the cursor down by one line
(available before you press the Enter key)
|
|
<Esc+P>
|
Moves the cursor up by one line
(available before you press the Enter key)
|
|
<Esc+<>
|
Specifies the cursor as the beginning of
the clipboard.
|
|
<Esc+>>
|
Specifies the cursor as the ending of the
clipboard.
|
These hotkeys are
defined by the device. When you interact with the device from terminal
software, these keys may be defined to perform other operations. If so, the
definition of the terminal software will dominate.
All the commands are defaulted to different
views and categorized into four levels: visit, monitor, system, and manage,
identified respectively by 0 through 3. If you want to acquire a higher privilege,
you must switch to a higher user level, and it requires password to do so for
the security’s sake.
The following table describes the default
level of the commands.
Table 1-3 Default command levels
|
Level
|
Privilege
|
Command
|
|
0
|
Visit
|
ping, tracert, telnet
|
|
1
|
Monitor
|
refresh, reset, send
|
|
2
|
System
|
All configuration commands except for
those at manage level
|
|
3
|
Manage
|
FTP, TFTP, XMODEM, and file system
operation commands
|
Follow these steps to configure user level
and command level:
|
To do…
|
Use the command…
|
Remarks
|
|
Switch the user level
|
super [ level
]
|
Optional
Available in user view.
|
|
Enter system view
|
system-view
|
—
|
|
Configure the password for switching the
user level
|
super password [ level user-level ] { simple | cipher
} password
|
Optional
By default, no password is configured.
|
|
Configure the command level in system
view
|
command-privilege level level view view command
|
Optional
|
The commands
available depend on your user level when you log onto a device. For example, if
your user level is 3 and the command level of VTY 0 interface is 1, you can use
commands below level 3 (inclusive).
Caution:
l
When you configure the password for switching
user level with the super password command, the user level is defaulted
to 3 if no user level is specified.
l
You can switch to a lower user level
unconditionally. To switch to a higher user level, however, you need to enter
the password needed (The password can be set with the super password
command.). If the entered password is incorrect or no password is configured,
the switch fails. Therefore, before switching to a higher user level, you
should configure the password needed.
l
You are recommended to use the default user
level; otherwise the change of user level may bring inconvenience to your
maintenance and operation.
1.1.7 Displaying and Maintaining Basic Configurations
|
To do…
|
Use the command…
|
Remarks
|
|
Display information on system version
|
display version
|
—
|
|
Display information on the system clock
|
display clock
|
|
Display information on terminal users
|
display users [ all ]
|
|
Display the configurations saved in the
storage device
|
display saved-configuration [ by-linenum ]
|
—
|
|
Display the current validated configurations
|
display current-configuration [ [ configuration [ configuration ] | controller
| interface [ interface-type ] [ interface-number ] ] [ by-linenum
] [ | { begin | include | exclude } text ]
]
|
|
Display the valid configuration under
current view
|
display this [ by-linenum ]
|
—
|
|
Display clipboard information
|
display clipboard
|
|
Display and save statistics of each
module’s running status
|
display diagnostic-information
|
—
|
During daily maintenance or when the system
is operating abnormally, you need to view each module’s running status to
find the problem. Therefore, you are required to execute the corresponding display
commands one by one. To collect more information one time, you can execute
the display diagnostic-information command in any view to display statistics
of each module’s running status. The execution of the display diagnostic-information command has the same effect as that of the commands display
clock, display version, display device, and display current-configuration.
l
For the detailed description of the display
users command, refer to the Login Commands part of the manual.
l
The display commands discussed above are
for the global configuration. Refer to the corresponding section for the display
command for specific protocol and interface.
1.2 CLI Features
This section covers the following topics:
l
Introduction to CLI
l
Online Help with Command
Lines
l
Synchronous Information
Output
l
undo Form of a Command
l
Edit Features
l
CLI Display
l
Saving History Commands