Vous êtes sur la page 1sur 54

VRP Basic Configuration P-0

Confidential Information of Huawei. No Spreading Without


Permission
VRP Basic Configuration P-1

Confidential Information of Huawei. No Spreading Without


Permission
VRP Basic Configuration P-2

Confidential Information of Huawei. No Spreading Without


Permission
VRP Basic Configuration P-3

Confidential Information of Huawei. No Spreading Without


Permission
VRP Basic Configuration P-4

Confidential Information of Huawei. No Spreading Without


Permission
VRP Basic Configuration P-5

 You can log in to a router that is powered on for the first time only through a console
port. After you log in to the router, you can configure other login modes.

 To log in through console port,


 first, run the terminal emulation program, for example, Hyper Terminal of
WIN XP, on the PC.
 Click Start > Program > Communication > Hyper Terminal
 Set the COM1 settings as shown:
 Remark: user can click the restore default to obtain this settings.

 NOTE: When a router is powered on for the first time, you must log in to the router
through the console port, which is a prerequisite for other login modes as well. For
example, you can use Telnet to log in to a router only after you use the console port to
log in to the router and configure an IP address.

Confidential Information of Huawei. No Spreading Without


Permission
VRP Basic Configuration P-6

 NOTE: A password is entered in man-machine interaction mode. The system does


not display the entered password.
 A password is a string of 6 to 16 case-sensitive characters and must contain at least
two types of the following characters: uppercase letters, lowercase letters, digits, and
special characters.
 Special characters do not include question marks (?) or spaces. However, when
double quotation marks are used around a password, spaces are allowed in the
password.
 Double quotation marks cannot contain double quotation marks if spaces are
used in a password.
 Double quotation marks can contain double quotation marks if no space is
used in a password.
 For example, the password "a123"45"" is valid, but the password "a 123"45"" is invalid.
 The configured password is displayed in ciphertext in the configuration file.

Confidential Information of Huawei. No Spreading Without


Permission
VRP Basic Configuration P-7

Confidential Information of Huawei. No Spreading Without


Permission
VRP Basic Configuration P-8

 System commands are rated from low to high into four levels:
 The visit level: includes commands for network diagnosis such as ping and tracert and
commands for visiting external equipment such as Telnet client, SSH commands.
 The monitor level: includes commands for system maintenance and service trouble
diagnosis such as the display and debugging commands.
 The config level: includes service configuration commands involving routing commands,
commands for all network layers and commands for providing direct network services
for users.
 The manage level: includes commands that supports the running of the system and
other services involving file system commands, FTP, TFTP commands, configuration
file switching commands, the slave board controlling commands, user management
commands, command level setting commands and parameter setting commands.

 Users are also divided into 4 levels to match with the command levels, which means that users
can only use commands whose levels are equal to or lower than their levels.

 By default, commands are registered at Level 0 to Level 3. If refined rights management is


required, you can divide commands into 16 levels (Level 0 to Level 15).
 If you do not change a command level separately, all originally registered commands
automatically change based on to the following rules after the command level is updated:
 The commands of Level 0 and Level 1 remain unchanged.
 The commands of Level 2 are updated to Level 10 and the commands of Level 3 are
updated to Level 15.
 No commands exist in Level 2 to Level 9 and Level 11 to Level 14. You can change the
commands to these levels separately to refine rights management.
 CAUTION: Do not change the default level of a command. If the default level of a command is
VRP Basic Configuration P-8

changed, some users may be unable to use the command any longer.

Confidential Information of Huawei. No Spreading Without


Permission
VRP Basic Configuration P-9

 You enter the user view as soon as you log in to the router through the method described
previously. The CLI provides multiple command views. All commands are registered in one or
more command views. In general, you can run a command only after entering its view.
 NOTE: The system supports two configuration validation modes: immediate validation and
two-phase validation. By default, the two-phase validation mode is used.

 The user view can be switched to the system view by running the system-view command.
And the system view can be switched back to the user-view after running the quit command.

 You can enter views of other services by running corresponding commands in the system
view. Commands that can be run in different views are different.

Confidential Information of Huawei. No Spreading Without


Permission
VRP Basic Configuration P-10

Confidential Information of Huawei. No Spreading Without


Permission
VRP Basic Configuration P-11

 To simplify operations, you can use shortcut keys to enter commands.

Confidential Information of Huawei. No Spreading Without


Permission
VRP Basic Configuration P-12

Confidential Information of Huawei. No Spreading Without


Permission
VRP Basic Configuration P-13

 Full Help
 You can obtain full help using any of the following methods:
 Enter a question mark (?) in any command view to obtain all the commands and
their simple descriptions.
 Enter a command followed by a space and a question mark (?). If the position of
the question mark (?) is for a keyword, all the keywords and their brief description
are listed.
 Enter a command followed by a space and a question mark (?). If the position of
the question mark (?) is for a parameter, the value range and function of the
parameter are listed.
 Partial Help
 You can obtain partial help using any of the following methods:
 Enter a string followed by a question mark (?). The system lists all the keywords
that start with the string.
 Enter a command followed by a question mark (?) if there are several matches for
the keyword. The system lists all the keywords that start with the string.
 Enter the initial letters of a keyword in a command line and press Tab. The system
lists the complete keyword. If there are several matches for the keyword, you can
press Tab repeatedly. The system lists various keywords for you to choose the
one you need.

Confidential Information of Huawei. No Spreading Without


Permission
VRP Basic Configuration P-14

Confidential Information of Huawei. No Spreading Without


Permission
VRP Basic Configuration P-15

 When you access a router, a message is displayed. You can configure desired
content for the message.
 Header information refers to a message that is displayed after you access a router or
a message that is displayed after the login authentication is successful and before you
start to configure the router. Header information provides explicit indications for your
login.

Confidential Information of Huawei. No Spreading Without


Permission
VRP Basic Configuration P-16

 The sysname command sets the host name of the router.

Confidential Information of Huawei. No Spreading Without


Permission
VRP Basic Configuration P-17

 A device allows multiple users to perform configurations at the same time. If


configurations performed by different users conflict, services will be affected. To
prevent this problem, run the lock configuration command to allow only one user to
configure the system.

Confidential Information of Huawei. No Spreading Without


Permission
VRP Basic Configuration P-18

Confidential Information of Huawei. No Spreading Without


Permission
VRP Basic Configuration P-19

 To remotely maintain a router, configure Telnet login and use Telnet to log in to the
router.

 ip address ip-address { mask | mask-length } [ sub ]


 The ip address command configures an IP address for an interface.

Confidential Information of Huawei. No Spreading Without


Permission
VRP Basic Configuration P-20

 user-interface maximum-vty number


 The maximum number of VTY user interfaces is set.
 shell
 The VTY terminal service is started.
 idle-timeout minutes [ seconds ]
 A timeout period is set for an idle connection.
 If a connection remains idle within a specified timeout period, the system
automatically ends the connection after the timeout period expires.
 The default timeout period is 10 minutes.
 screen-length screen-length
 The number of rows displayed on each terminal screen is set.
 The default number of rows is 24.
 history-command max-size size-value
 A buffer size is set for historical commands.
 The default buffer size is 10. That is, the buffer can save a maximum of 10
historical commands.
 authentication-mode { aaa | password }
 The authentication-mode command sets the authentication mode for login to
the user interface view.
By default, Information
Confidential
 no authentication mode isNo
of Huawei. set.Spreading Without
Permission
VRP Basic Configuration P-21

 local-user user-name password


 The local-user password command creates a local user and sets a login
password for the user.
 local-user user-name service-type { [ ppp | terminal | telnet | ftp | ssh ] * | all |
none }
 The local-user service-type command sets an access type for a local user.
 By default, a local user can not use any access type.
 local-user user-name level level
 The local-user level command sets a priority for a local user.
 By default, the priority of a local user is assigned by a user management
module.

Confidential Information of Huawei. No Spreading Without


Permission
VRP Basic Configuration P-22

Confidential Information of Huawei. No Spreading Without


Permission
VRP Basic Configuration P-23

 You can manage directories by changing and displaying directories, displaying files in
directories and sub-directories, and creating and deleting directories.
 Managing files include displaying file content, copying files, moving files, renaming
files, compressing files, deleting files, restoring deleted files, deleting files in the
recycle bin, running batch files, and configuring notification modes.
 To operate a file, run the cd directory command to switch the current directory to the
file's directory.
 The directory and file command are executed in the user-view.

Confidential Information of Huawei. No Spreading Without


Permission
VRP Basic Configuration P-24

 Files can be uploaded or downloaded using FTP.


 Precautions
 After you log in to the FTP server through the console port, configure an IP address
for FTP login on the management interface. For the detailed configuration, please
refer to the Example for Configuring Telnet Login(1/2).
 ftp server enable
 The ftp server enable command enables the FTP server function on a device,
allowing FTP users to log in.
 By default, the FTP server function is disabled.
 local-user user-name password
 The local-user password command creates a local user and sets a login
password for the user.
 local-user user-name service-type { [ ppp | terminal | telnet | ftp | ssh ] * | all |
none }
 The local-user service-type command sets an access type for a local user.
 By default, a local user can not use any access type.
 local-user user-name level level
 The local-user level command sets a priority for a local user.
 By default, the priority of a local user is assigned by a user management
VRP Basic Configuration P-24

module.
 local-user user-name ftp-directory directory
 The local-user ftp-directory command sets the File Transfer Protocol (FTP)
directory for the local user.
 By default, the FTP directory for the local user is null.

Confidential Information of Huawei. No Spreading Without


Permission
VRP Basic Configuration P-25

Confidential Information of Huawei. No Spreading Without


Permission
VRP Basic Configuration P-26

 The two configuration validation modes are described as follows:


 The immediate validation mode is a traditional configuration validation mode.
 In this mode, the system-view immediately command is used to enter the
system view. After you enter a command and press Enter, the system
performs a syntax check. If the check is successful, the configuration
immediately takes effect.
 In two-phase validation mode, the system configuration process is divided into two
phases:
 In this mode, the system-view command is used to enter the system view. In
the first phase, after you enter a configuration command, the system performs
syntax and semantics checks on the candidate database. If an incorrect clause
is found, the system displays a message on the command line terminal,
indicating the fault and cause. After entering a series of commands to
complete a configuration, you can run the commit command to commit the
configuration. The system then enters the second phase, that is, configuration
commitment phase. In the second phase, the system delivers the configuration
in the candidate database to the corresponding service module. If the
configuration takes effect, the system adds it to the running database. If the
same configuration is added, the system displays a message.
 All configurations take effect at the same time.
VRP Basic Configuration P-26

 Configurations in the candidate database can be previewed.


 When you find that a configuration in the candidate database is incorrect or
does not meet your expectation, you can immediately clear the configurations
that have not taken effect.
 The impacts of service configurations on the existing services can be
minimized.

Confidential Information of Huawei. No Spreading Without


Permission
VRP Basic Configuration P-27

 The display configuration candidate command displays commands that have been
configured but not submitted.
 The display configuration commit changes command displays configuration
changes at specific configuration rollback points.
 –
 A deleted configuration
 +
 A new configuration
 For each modified configuration, both "-" indicating the deleted configuration
and "+" indicating the created configuration are displayed.

 The display configuration commit list command displays the list of configuration
rollback points.

Confidential Information of Huawei. No Spreading Without


Permission
VRP Basic Configuration P-28

 NOTE: Configuration rollback is not supported in immediate validation mode.

Confidential Information of Huawei. No Spreading Without


Permission
VRP Basic Configuration P-29

 As shown in the figure, a user logs in to the router and configures IP addresses for
interfaces on the router. After the IP addresses of interfaces are configured, the user
detects an IP address planning error and expects to reconfigure the IP addresses of
interfaces. Traditionally speaking, the user must delete the IP addresses one by one
and reconfigure them.
 Configuration rollback simplifies configuration restoration. Configuration rollback
allows the user to easily roll system configurations back to what they were before the
IP addresses were configured.

Confidential Information of Huawei. No Spreading Without


Permission
VRP Basic Configuration P-30

 Configure IP addresses for GE 0/1/0, GE 0/1/1 on the router.

Confidential Information of Huawei. No Spreading Without


Permission
VRP Basic Configuration P-31

 Step1 Check information about configuration rollback points and the differences
between the previous and current configurations.

Confidential Information of Huawei. No Spreading Without


Permission
VRP Basic Configuration P-32

Confidential Information of Huawei. No Spreading Without


Permission
VRP Basic Configuration P-33

 Step2 Perform configuration rollback.

 Note: In this example, the rollback configuration to commit-id 1000000125


command has the same return result as the rollback configuration last 1 command.

Confidential Information of Huawei. No Spreading Without


Permission
VRP Basic Configuration P-34

Confidential Information of Huawei. No Spreading Without


Permission
VRP Basic Configuration P-35

Confidential Information of Huawei. No Spreading Without


Permission
VRP Basic Configuration P-36

 Step3 Verify the Configuration. The rollback has taken effect.

Confidential Information of Huawei. No Spreading Without


Permission
VRP Basic Configuration P-37

Confidential Information of Huawei. No Spreading Without


Permission
VRP Basic Configuration P-38

 To avoid configuration loss on a router due to power-off or an unexpected reset, the


system supports automatic and manual configuration saving.

 The set save-configuration command configures the function of saving system


configurations periodically.
 By default, the system does not enable the function.
 set save-configuration [ interval interval | cpu-limit cpu-usage | delay delay-
interval ] *
 The system automatically saves configurations at the interval specified
by interval interval expires regardless of whether any configurations
have changed. If interval is not specified, the system automatically
saves configurations every 30 minutes.
 If the automatic configuration saving timer expires and the CPU usage
of the system is higher than the value specified by cpu-limit cpu-usage,
the system cancels the current automatic configuration saving
operation.
 If delay-interval is specified and configurations change, the system
waits a specified delay before automatically saving configurations.
 After automatic configuration saving is configured, the system automatically
saves configurations to the configuration file to be loaded at the next startup.

Confidential Information of Huawei. No Spreading Without


Permission
VRP Basic Configuration P-38

The content in the configuration file varies with configuration changes.

Confidential Information of Huawei. No Spreading Without


Permission
VRP Basic Configuration P-39

 The save command saves the current configuration to the storage device.
 The save command saves the current configuration to the configuration file for
the next startup. If no configuration file is available for the next startup, the
system prompts you to save the configuration to vrpcfg.zip. You can save the
configuration to this file or another file and specify this file as the configuration
file for the next startup.
 The save configuration-file command saves the current configuration to the
specified directory of the storage device. Generally, the command does not
affect the current startup configuration file. When configuration-file is the same
as the default save path and configuration file name, this command can be
used as the save command.
 When you save the configuration file for the first time without specifying
configuration-file, you are asked whether to name the configuration file
vrpcfg.zip.
 The extension of the configuration file name must be .zip, .cfg or .dat. The
system configuration file must be saved in the root directory of the storage
device.
 A .cfg file is a text file. You can directly view the content of a .cfg file.
After a .cfg file is specified as the configuration file, the system restores
the commands in the file one by one when startup.

Confidential Information of Huawei. No Spreading Without


Permission
VRP Basic Configuration P-39

 A .zip file is the compression of a .cfg file, occupying less space. After
a .zip file is specified as the configuration file, the system decompresses
the file into a .cfg file, and then restores the commands in the file one by
one when startup.
 A .dat file is a binary file. If the startup software version and the .dat file
version are the same, the system restores all configurations in the .dat
file in batches when the device starts. This speeds up the system
startup.
 When you run the save command several times, the latest configuration
overrides the previous configuration. If the file of the same name already exists,
the contents of the original file are changed.

Confidential Information of Huawei. No Spreading Without


Permission
VRP Basic Configuration P-40

 The current configuration is compared with the configuration file for the next startup or
a specified configuration file.
 The comparison begins with the first lines of the configuration files.
 When comparing differences between the configuration files, the system displays the
content of the current and saved configuration files from the first different line. By
default, 150 characters are displayed for each configuration file. If the number of
characters from the first different line to the end is less than 150, the content after the
first different line is all displayed.
 When comparing the current configuration file with the configuration file for the next
startup, the system displays a message indicating that reading the configuration file
fails if the configuration file for the next startup is unavailable or its content is empty.

Confidential Information of Huawei. No Spreading Without


Permission
VRP Basic Configuration P-41

 You can specify a configuration file to be loaded at the next startup of the system.
 After the system restarts, it uses the specified configuration file to restore
configurations.

 Pre-configuration for this example:


 <HUAWEI>save backup0311.cfg
 <HUAWEI>dir
 Directory of cfcard:/
 Idx Attr Size(Byte) Date Time FileName
6 -rw- 8,774 Mar 11 2014 10:48:37 backup0311.cfg

 The startup saved-configuration command specifies the configuration file to be


loaded at the next startup of the system.

Confidential Information of Huawei. No Spreading Without


Permission
VRP Basic Configuration P-42

 You can clear the configuration file that is loaded at the startup of the system.
 The configuration file needs to be cleared in either of the following situations:
 The system software does not match the configuration file after a router is
upgraded.
 The configuration file is damaged or an incorrect configuration file is loaded.

 reset saved-configuration
 NOTE: Before clearing the configuration file of a router, the system compares
the configuration file loaded at the current startup with that to be loaded at the
next startup.
 If the two configuration files are consistent, running the reset saved-
configuration command clears the settings for both files. The default
configuration file will be used for the next startup.
 If the two configuration files are inconsistent, running the reset saved-
configuration command clears the settings for the configuration file for
the next startup, and the settings for the current configuration file are
not cleared.
 If the current configuration file is empty, and the configuration file for
the next startup is not empty, running the reset saved-configuration
command clears the settings for the configuration file for the next
startup.
Confidential Information of Huawei. No Spreading Without
Permission
VRP Basic Configuration P-43

 If the configuration file for the next startup is empty, and the current
configuration file is not empty, after the reset saved-configuration
command is run, the system prompts an error and no settings are
cleared.
 If you run the command to restart a device, addresses configured for
management interfaces on the device will become invalid, and you
have to log in to the device through a serial interface to re-configure the
addresses.
 WARNING: Exercise caution when running this command. If this command is
required, run it with assistance from Huawei technical support personnel.

 [system-view]clear configuration interface interface-type interface-number


 Deletes configurations on a specified interface at a time.

 [interface-view]clear configuration this


 Deletes configurations on the current interface at a time.

Confidential Information of Huawei. No Spreading Without


Permission
VRP Basic Configuration P-44

Confidential Information of Huawei. No Spreading Without


Permission
VRP Basic Configuration P-45

Confidential Information of Huawei. No Spreading Without


Permission
VRP Basic Configuration P-46

Confidential Information of Huawei. No Spreading Without


Permission
VRP Basic Configuration P-47

Confidential Information of Huawei. No Spreading Without


Permission
VRP Basic Configuration P-48

Confidential Information of Huawei. No Spreading Without


Permission

Vous aimerez peut-être aussi