01-Fundamentals Command Reference

HomeSupportRoutersCR16000-F SeriesReference GuidesCommand ReferencesH3C CR16000-F Routers Command References-Release795x-6W10001-Fundamentals Command Reference
08-Target configuration management commands
Title Size Download
08-Target configuration management commands 82.06 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.

Examples

# Commit the target configuration command lines, skipping incorrect command lines.

<Sysname> system-view private

~[Sysname] commit best-effort

Wait for the configuration commit: Done.

~[Sysname]

configuration commit max-number

Use configuration commit max-number to specify 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

There is no limit to the number of rollback points.

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 { commit-id commit-id | label labelname | last number }

Views

System view

Predefined user roles

network-admin

Parameters

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.

last number: Specifies a rollback point by its number counting from the most recent rollback point.

Usage guidelines

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 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 1 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.

 

display target-configuration

Use display target-configuration to display the target configuration command lines.

Syntax

display target-configuration [ 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

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.

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.

Examples

# Set the device name in private-mode system view and display the target configuration.

<Sysname> system-view private

~[Sysname] sysname Device

~[Sysname] display target-configuration

#

 sysname Sysname

#

return

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. If you do not specify this keyword, the command clears all target configuration command lines.

text: Specifies a target configuration command line, a case-insensitive string. The entire length of this reset command can have a maximum of 512 characters. If you do not specify this argument, the command prompts you to enter the target configuration command line to be cleared.

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

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

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

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 the running configuration and each rollback point.

Examples

# Display the configuration differences between rollback point 2 and the next rollback point.

<Sysname> display configuration commit diff at 2

--- Current configuration

+++ Next configuration

@@ -3,4 +3,4 @@

  #

Vlan1

-  description test

+  description world

  #

Table 2 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 3 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.

 

  • Cloud & AI
  • InterConnect
  • Intelligent Computing
  • Security
  • SMB Products
  • Intelligent Terminal Products
  • Product Support Services
  • Technical Service Solutions
All Services
  • Resource Center
  • Policy
  • Online Help
All Support
  • Become a Partner
  • Partner Resources
  • Partner Business Management
All Partners
  • Profile
  • News & Events
  • Online Exhibition Center
  • Contact Us
All About Us
新华三官网