- 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-GIR commands
- 09-Automatic configuration commands
- 10-Target configuration management commands
- 11-Device management commands
- 12-Tcl commands
- 13-Python commands
- Related Documents
-
Title | Size | Download |
---|---|---|
10-Target configuration management commands | 78.84 KB |
Target configuration management commands
commit
Use commit to commit the target configuration command lines.
Syntax
commit [ best-effort ] [ force ] [ label labelname ] [ save-running filename ] [ confirmed [ seconds | minutes minutes ] ] [ show-error ] [ clear-error ] [ description text ]
Views
Private-mode system view and its lower-level views
Exclusive-mode system view and its lower-level views
Predefined user roles
network-admin
network-operator
Parameters
best-effort: Skips incorrect command lines in the target configuration. If you do not specify this keyword, the system checks for incorrect command lines. If an incorrect command line is found, the commit operation fails, and the system continues to use the original running configuration.
force: Skips memory check. If you do not specify this keyword, the system checks the memory before committing the target configuration command lines. If any memory problem exists, the commit operation fails, and the system continues to use the original running configuration.
label labelname: Assigns a label to the rollback point, a case-sensitive string of 1 to 20 characters. The label must be globally unique and begin with a letter. When using the configuration replace command to roll back the running configuration, you can use a label to identify the configuration to roll back to.
save-running filename: Saves the running configuration to a configuration file before committing the target configuration command lines. The filename argument represents the file name, a case-insensitive string of 1 to 255 characters. The file name must use the .cfg extension.
confirmed: Starts a configuration rollback timer for the commit operation. If you do not execute the commit command again to confirm the commit operation before the timer expires, the system automatically restores the original running configuration. If you do not specify this keyword, the command commits the target configuration command lines without requiring for a confirmation.
seconds: Sets the configuration rollback timer in seconds. The value range is 30 to 65535. The default is 600.
minutes minutes: Sets the configuration rollback timer in minutes. The value range is 1 to 1024. The default is 10.
show-error: Displays incorrect command lines in the target configuration if the commit operation fails. If you do not specify this keyword, the command does not display the incorrect command lines.
clear-error: Clears all incorrect command lines from the target configuration if the commit operation fails.
description text: Specifies a description for the rollback point, a case-sensitive string of 1 to 60 characters.
Usage guidelines
As a best practice, do not execute this command frequently. The system creates a configuration rollback point after each successful commit operation. Executing this command frequently increases device load and might cause commit failures.
If the device is disconnected before you execute the commit command, the device cannot automatically save the target configuration command lines. In this situation, you must perform target configuration again.
If a command fails due to insufficient resources during target configuration deployment, the device will ignore it and continue with the remaining configurations.
Examples
# Commit the target configuration command lines, skipping incorrect command lines.
<Sysname> system-view private
~[Sysname] sysname aaa
*[Sysname] commit
Wait for the configuration commit: Done.
~[aaa]
configuration commit auto-save path
Use configuration commit auto-save path to enable the automatic saving feature for the target configuration command lines and configure the related parameters. This feature automatically saves the running configuration each time the target configuration command lines are committed.
Use undo configuration commit auto-save path to disable the automatic saving feature for the target configuration command lines.
Syntax
configuration commit auto-save path directory filename-prefix filename-prefix [ user user-name [ password { cipher | simple } string ] | vpn-instance vpn-instance-name ] *
undo configuration commit auto-save path
Default
The automatic saving feature is disabled for the target configuration command lines.
Views
System view
Predefined user roles
network-admin
Parameters
directory: Specifies the path or URL of the .cfg configuration files to which the running configuration is automatically saved. This argument is a case-insensitive string of 1 to 63 characters. A local file path must be in the format of storage-medium-name:/[folder-name]/subfolder-name. The path must already exist on the active MPU and cannot contain a slot number. To save the configuration files to an FTP or TFTP server, specify the URL of the server. For more information about the URL formats, see the usage guidelines for this command.
filename-prefix filename-prefix: Specifies a file name prefix for the .cfg configuration files to which the running configuration is automatically saved. The total length of the file directory and file name cannot exceed 255 characters.
user user-name: Specifies the username used for accessing the directory. You can specify this option only when the URL of an FTP server is specified.
password: Specifies the password used for accessing the directory. You can specify this option only when the URL of an FTP server is specified.
cipher: Specifies the password in encrypted form.
simple: Specifies the password in plaintext form. For security purposes, the password specified in plaintext form will be stored in encrypted form.
string: Specifies the password. Its plaintext form is a case-sensitive string of 1 to 32 characters and its encrypted form is a case-sensitive string of 1 to 73 characters.
vpn-instance vpn-instance-name: Specifies the MPLS L3VPN instance to which the remote server belongs. The vpn-instance-name argument represents the VPN instance name, which is a case-sensitive string of 1 to 31 characters. If the remote server belongs to the public network, do not specify this option.
Usage guidelines
To save the running configuration while committing the target configuration command lines, you can use one of the following methods:
· Specify the save-running filename option when you use the commit command to commit the target configuration command lines. The system saves the running configuration to the specified file while committing the target configuration command lines.
· Use the configuration commit auto-save path command to enable automatic saving for the target configuration command lines. This command enables the device to automatically save the running configuration to a configuration file in the specified directory each time the commit command is executed. The directory is specified by using the directory argument. The prefix for the configuration file is specified by using the filename-prefix filename-prefix option.
The automatic saving feature takes effect if you do not specify the save-running filename option when executing the commit command. If you specify this option when executing the commit command, the automatic saving feature cannot take effect. The target configuration command lines are saved to the file specified by using this option.
If the directory specified by using the configuration commit auto-save path command belongs to an FTP or TFTP server, the directory URL formats are shown in Table 1.
Table 1 URL formats for FTP and TFTP servers
Protocol |
URL format |
Remarks |
FTP |
ftp://server-address[:port-number]/file-path |
For example, to specify folder file on FTP server 1.1.1.1, enter ftp://1.1.1.1/file. |
TFTP |
tftp://server-address[:port-number]/file-path |
For example, to specify folder file on TFTP server 1.1.1.1, enter tftp://1.1.1.1/file. |
To specify an IPv6 address, enclose the IPv6 address in square brackets ([ ]), for example, ftp://test:test@[2001::1]:21/test.cfg.
If the URL of an FTP server is specified, you must specify the user user-name option. If you do not specify this option, execution of the configuration commit auto-save path command will fail.
If the URL of a TFTP server is specified, you do not need to specify the user user-name option. If you specify this option, the system automatically ignores this option. Execution of the configuration commit auto-save path command can succeed.
Examples
# Enable automatic saving for the target configuration command lines, and save the running configuration to configuration files in directory ftp://1.1.1.1/BackupFile/ each time the commit command is executed. Set the prefix for the configuration files to backupcfg. Set the username and password used for accessing the FTP server to admin and plaintext string 123456, respectively.
<Sysname> system-view private
~[Sysname] configuration commit auto-save path ftp://1.1.1.1/BackupFile/ filename-prefix backupcfg user admin password simple 123456
# Enable automatic saving for the target configuration command lines, and save the running configuration to configuration files in directory flash:/BackupFile/ each time the commit command is executed. Set the prefix for the configuration files to save.
<Sysname> system-view private
~[Sysname] configuration commit auto-save path flash:/BackupFile/ filename-prefix save
Related commands
commit
display target-configuration
Use display target-configuration to display the target configuration command lines.
Syntax
display target-configuration [ diff | failure [ brief ] | merge | success ]
Views
Private-mode system view and its lower-level views
Exclusive-mode system view and its lower-level views
Predefined user roles
network-admin
network-operator
Parameters
diff: Display differences between the target configuration and the running configuration.
failure: Displays the configuration command lines that failed to be committed and the causes.
brief: Displays only the configuration command lines that failed to be committed.
merge: Displays the configuration that occurs if the target configuration command lines are committed to the running configuration.
success: Displays successfully committed configuration command lines and the messages output by the command lines. This keyword applies only to command lines that display messages after being executed.
Usage guidelines
If you do not specify any parameters, this command displays all target configuration command lines in the order they were configured.
The commit command does not display messages for command lines.
In real-time-mode views, some commands display messages to indicate the command execution results. When committed as a part of the target configuration, these commands do not display any messages. To display these commands and their respective messages, execute the display target-configuration success command after the commit operation is finished.
If you specify the diff or merge keyword in private-mode views or exclusive-mode views, the display status of default settings is consistent with the display status of default settings by using the display current-configuration command in real-time-mode views.
Examples
# Set the device name in private-mode system view and display the target configuration.
~[Sysname] sysname Device
*[Sysname] display target-configuration
sysname Device
refresh target-configuration
Use refresh target-configuration to refresh uncommitted target configuration.
Syntax
refresh target-configuration
Views
Private-mode system view and its lower-level views
Exclusive-mode system view and its lower-level views
Predefined user roles
network-admin
network-operator
Usage guidelines
Configuration commit fails if the running configuration has changed and the changes in the running configuration conflict with the target configuration.
Use this command to refresh uncommented target configuration to filter out command lines in target configuration that conflict with the running configuration.
Examples
# Refresh uncommitted target configuration.
<Sysname> system-view private
~[Sysname] refresh target-configuration
Trying to refresh the target configuration. Please wait …
No conflicts detected.
reset target-configuration
Use reset target-configuration to clear the target configuration command lines.
Syntax
reset target-configuration [ command [ text ] ]
Views
Private-mode system view and its lower-level views
Exclusive-mode system view and its lower-level views
Predefined user roles
network-admin
network-operator
Parameters
command: Clears a specific target configuration command line in the current view. If you do not specify this keyword, the command clears all target configuration command lines.
text: Specifies a target configuration command line. The entire length of this reset command can have a maximum of 512 characters. Whether this argument is case sensitive depends on the case sensitivity of the target configuration command line to be cleared. If you do not specify this argument, the command prompts you to enter the target configuration command line to be cleared.
Usage guidelines
CAUTION: Use this command with caution. You cannot restore the target configuration command lines cleared by using this command. To use these command lines, you must reconfigure them. |
Examples
# Clear the target configuration command lines.
<Sysname> system-view private
~[Sysname] reset target-configuration
# Clear target configuration command line sysname S1.
<Sysname> system-view private
~[Sysname] reset target-configuration command sysname S1