- 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-Automatic configuration commands
- 09-Target configuration management commands
- 10-ISSU commands
- Related Documents
-
Title | Size | Download |
---|---|---|
09-Target configuration management commands | 105.71 KB |
Target configuration management commands
configuration commit max-number
display configuration commit diff
display configuration commit list
display configuration sessions
Target configuration management commands
configuration commit max-number
Use configuration commit max-number to set the maximum number of rollback points.
Use undo configuration commit max-number to restore the default.
Syntax
configuration commit max-number max-number
undo configuration commit max-number
Default
The maximum number of rollback points is 100.
Views
System view
Predefined user roles
network-admin
Parameters
max-number: Specifies the maximum number of rollback points, in the range of 1 to 65535.
Usage guidelines
To store a new rollback point when the number of rollback points reaches the maximum, the system deletes the oldest rollback point.
Examples
# Set the maximum number of rollback points to 10.
<Sysname> system-view
[Sysname] configuration commit max-number 10
configuration replace
Use configuration replace to roll back the running configuration based on a rollback point.
Syntax
configuration replace { last number | commit-id commit-id | label labelname }
Views
System view
Predefined user roles
network-admin
Parameters
last number: Specifies a rollback point by its number counting from the most recent rollback point.
commit-id commit-id: Specifies a rollback point by its commit ID. The value range for the commit-id argument depends on the number of existing rollback points.
label labelname: Specifies a rollback point by its label, a case-sensitive string of 1 to 20 characters. The label is globally unique and must begin with a letter.
Usage guidelines
CAUTION: This command will cause settings not at the rollback point to be lost, which might cause service interruption. When you perform configuration rollback, make sure you fully understand its impact on your network. |
When you roll back the running configuration or commit target configuration command lines, the system creates a rollback point and assigns a unique commit ID to the rollback point.
Examples
# Roll back the running configuration based on rollback point 2.
<Sysname> system-view
[Sysname] configuration replace commit-id 2
Current configuration will be lost, Save running configuration? [Y/N]:n
Now rolling back the running configuration. Please wait...
Running configuration successfully rolled back.
display configuration commit diff
Use display configuration commit diff to display configuration differences between a rollback point and the running configuration or between two rollback points.
Syntax
display configuration commit diff [ at commit-id | last number | since commit-id ]
Views
Any view
Predefined user roles
network-admin
network-operator
Parameters
at commit-id: Displays the configuration differences between a rollback point and the next rollback point. The commit-id argument identifies a rollback point by its commit ID. The value range depends on the commit IDs of existing rollback points. If you specify the most recently created rollback point, this command displays configuration differences between the most recently created rollback point and the running configuration.
last number: Displays the configuration differences between a rollback point and the running configuration. The number argument specifies a rollback point by its number counting from the most recent rollback point.
since commit-id: Displays the configuration differences between a rollback point and the running configuration. The commit-id argument identifies a rollback point by its commit ID. The value range depends on the commit IDs of existing rollback points.
Usage guidelines
If you do not specify any parameters, this command displays the configuration differences between each two adjacent rollback points, and between the most recent rollback point and the running configuration.
If the at commit-id option specifies the most recent rollback point, this command displays the configuration differences between the most recent rollback point and the running configuration.
Examples
# Display the configuration differences between rollback point 2 and the next rollback point.
<Sysname> display configuration commit diff at 2
--- CommitId 2 configuration
+++ CommitId 3 configuration
@@ -3,4 +3,4 @@
#
Vlan1
- description test
+ description world
#
Table 1 Command output
Field |
Description |
--- A +++ B |
· A represents the configuration for comparison, which can be the configuration of the specified rollback point. · B represents the configuration compared by the command, which can be the running configuration or configuration of the next rollback point. |
@@ -linenumber1,number1 +linenumber2,number2 @@ |
Location summary for sections that have command line differences: · -linenumber1,number1—Configuration A section that has command line differences. The linenumber1 argument represents the start line of the section. The number1 argument represents the number of lines between the start line and the end line of the section. · +linenumber2,number2—Configuration B section that has command line differences. The linenumber2 argument represents the start line of the section. The number2 argument represents the number of lines between the start line and the end line of the section. |
cmd1 - cmd2 + cmd3 cmd4 |
Displays command line differences. · cmd1 and cmd4—Command lines are contained in both configurations A and B if they are not prefixed with a minus (-) or plus (+) sign. They provide a context for locating command line differences. · - cmd2—Command lines are prefixed with a minus sign if they are contained in configuration A but not in configuration B. · + cmd3—Command lines are prefixed with a plus sign if they are contained in configuration B but not in configuration A. |
display configuration commit list
Use display configuration commit list to display rollback point information.
Syntax
display configuration commit list [ number | label ] [ verbose ]
Views
Any view
Predefined user roles
network-admin
network-operator
Parameters
number: Displays the most recent rollback points. The number argument represents the number of the rollback points to be displayed.
label: Displays the rollback points that have labels.
verbose: Displays detailed rollback point information. If you do not specify this keyword, the command displays brief rollback point information.
Usage guidelines
If you do not specify any parameters, this command displays brief information about all rollback points.
Examples
# Display the most recent three rollback points.
<Sysname> display configuration commit list 3
--------------------------------------------------------------------------------
Commit ID Label User Time stamp
3 conf3 - 2016-07-11 14:34:06
2 conf2 - 2016-07-11 14:33:06
1 - - 2016-07-11 14:32:19
Table 2 Command output
Field |
Description |
Commit ID |
Commit ID of the rollback point. |
Label |
Label of the rollback point. This field displays a hyphen (-) if the rollback point does not have a label. |
User |
Username of the session. · For a NETCONF over SSH, NETCONF over Telnet, or NETCONF over console session that was established after scheme authentication, this field displays the username of the session. For other NETCONF sessions, this field displays a hyphen (-). · For SNMP and CWMP sessions, this field displays a hyphen (-). |
Time stamp |
Time when the rollback point was created. |
display configuration sessions
Use display configuration sessions to display device configuration sessions, such as CLI, NETCONF, CWMP, and SNMP sessions.
Syntax
display configuration sessions
Views
Any view
Predefined user roles
network-admin
network-operator
Examples
# Display device configuration sessions.
<Sysname> display configuration sessions
Type Line User Time Lock
+ CLI VTY 0 admin May 04 09:13:33 -
CLI VTY 1 ad May 04 08:55:21 *
NETCONF VTY 1 user1 May 04 08:55:34 -
SNMP - - May 04 08:55:20 -
CWMP - - May 04 08:55:25 -
Table 3 Command output
Field |
Description |
Type |
Type of the session. The plus sign (+) indicates the session you are using. For sessions established over Web or RESTful, this field displays NETCONF. |
Line |
CLI user line used by the session, identified by the user line type and relative number. For information about user lines, see "Configuring CLI login." · For a NETCONF over SSH, NETCONF over Telnet, or NETCONF over console session, this field displays the user line used by the session. For other NETCONF sessions, this field displays a hyphen (-). · For SNMP and CWMP sessions, this field displays a hyphen (-). |
User |
Username of the session. · For a NETCONF over SSH, NETCONF over Telnet, or NETCONF over console session that was established after scheme authentication, this field displays the username of the session. For other NETCONF sessions, this field displays a hyphen (-). · For SNMP and CWMP sessions, this field displays a hyphen (-). |
Time |
Time when the session was established. |
Lock |
Whether the user of the session is in an exclusive-mode or private-mode view. · Asterisk (*)—The user is in an exclusive-mode view. · Hyphen (-)—The user is in a private-mode view. |
reset configuration commit
Use reset configuration commit to clear old rollback points.
Syntax
reset configuration commit number
Views
User view
Predefined user roles
network-admin
Parameters
number: Specifies the number of the oldest rollback points to be cleared. This argument must be equal to or less than the number of existing rollback points.
Usage guidelines
CAUTION: Use this command with caution. You cannot restore the rollback points cleared by using this command. |
Clear rollback points that are not in use anymore to release the memory space used by the rollback points.
Examples
# Clear the oldest nine rollback points.
<Sysname> reset configuration commit 9