01-Fundamentals Command Reference

HomeSupportSwitchesS7500E SeriesReference GuidesCommand ReferencesH3C S7500E Switch Series Command References-R757X-GL-6W10001-Fundamentals Command Reference
06-Configuration file management commands
Title Size Download
06-Configuration file management commands 131.92 KB

Configuration file management commands

The device supports the FIPS mode that complies with NIST FIPS 140-2 requirements. Support for features, commands, and parameters might differ in FIPS mode and non-FIPS mode. For more information about FIPS mode, see Security Configuration Guide.

archive configuration

Use archive configuration to manually archive the running configuration to the configuration archive directory.

Syntax

archive configuration

Views

User view

Predefined user roles

network-admin

mdc-admin

Usage guidelines

This command saves the running configuration to the specified configuration archive directory with file names generated from the specified name prefix.

Before executing this command, you must use one of the following methods to specify a directory and a name prefix for the configuration archives:

·     For local archiving, use the archive configuration location command to specify a local configuration archive directory and a name prefix.

·     For remote archiving, use the archive configuration server command to specify a configuration archive directory and a name prefix on a remote SCP server. In addition, you must use the archive configuration server user and archive configuration server password commands to configure a username and password for logging in to the server.

(In standalone mode.) If you use the archive configuration location command to specify a local configuration archive directory, manual configuration archiving saves the running configuration only on the active MPU.

(In IRF mode.) If you use the archive configuration location command to specify a local configuration archive directory, manual configuration archiving saves the running configuration only on the global active MPU.

Examples

# Archive the running configuration.

<Sysname> archive configuration

Save the running configuration to an archive file. Continue? [Y/N]: Y

The running configuration was saved to myarchive_1.cfg.

Related commands

archive configuration interval

archive configuration location

archive configuration max

archive configuration server

archive configuration server password

archive configuration server user

display archive configuration

archive configuration interval

Use archive configuration interval to enable automatic running-configuration archiving and set the archiving interval.

Use undo archive configuration interval to disable automatic running-configuration archiving.

Syntax

archive configuration interval interval

undo archive configuration interval

Default

The automatic running-configuration archiving feature is disabled.

Views

System view

Predefined user roles

network-admin

mdc-admin

Parameters

interval: Specifies the interval for automatically saving the running configuration. The value range is 10 to 525600, in minutes.

Usage guidelines

Automatic configuration archiving enables the system to periodically save the running configuration to the archive directory. After the system finishes an automatic archive, it resets the archiving interval timer.

Before enabling automatic configuration archiving, you must use one of the following methods to specify a directory and a name prefix for the configuration archives:

·     For local archiving, use the archive configuration location command to specify a local configuration archive directory and a name prefix.

·     For remote archiving, use the archive configuration server command to specify a configuration archive directory and a name prefix on a remote SCP server. In addition, you must use the archive configuration server user and archive configuration server password commands to configure a username and password for logging in to the server.

(In standalone mode.) If you use the archive configuration location command to specify a local configuration archive directory, automatic configuration archiving saves the running configuration only on the active MPU.

(In IRF mode.) If you use the archive configuration location command to specify a local configuration archive directory, automatic configuration archiving saves the running configuration only on the global active MPU.

Examples

# Set the system to archive the running configuration every 60 minutes.

<Sysname> system-view

[Sysname] archive configuration interval 60

Archive file will be saved every 60 minutes.

Related commands

archive configuration

archive configuration location

archive configuration max

archive configuration server

archive configuration server password

archive configuration server user

display archive configuration

archive configuration location

Use archive configuration location to specify a local directory and file name prefix for archiving the running configuration.

Use undo archive configuration location to restore the default.

Syntax

archive configuration location directory filename-prefix filename-prefix

undo archive configuration location

Default

No local directory or file name prefix is specified on the device for archiving the running configuration.

Views

System view

Predefined user roles

network-admin

mdc-admin

Parameters

directory: Specifies the archive directory, a string of 1 to 63 characters. The value for this argument must take the format of storage-medium-name:/folder-name. The directory must already exist on the active MPU. (In standalone mode.)

directory: Specifies the archive directory, a string of 1 to 63 characters. The value for this argument must take the format of storage-medium-name:/folder-name. The directory must already exist on the global active MPU. (In IRF mode.)

filename-prefix: Specifies a file name prefix for configuration archives, a case-insensitive string of 1 to 30 characters. Valid characters are letters, digits, underscores (_), and hyphens (-).

Usage guidelines

Before archiving the running configuration, either manually or automatically, you must specify a local or remote directory and file name prefix for configuration archives.

The local configuration archives on the device are named in the format of prefix_serial number.cfg, for example, archive_1.cfg and archive_2.cfg. The serial number is automatically assigned from 1 to 1000, increasing by 1. After the serial number reaches 1000, it restarts from 1.

If you change the file directory or file name prefix on the device, or reboot the device, the following events occur:

·     The old configuration archives change to common configuration files.

·     The configuration archive counter is reset.

·     The display archive configuration command no longer displays the old configuration archives.

·     The serial number for new configuration archives starts at 1.

The undo archive configuration location command removes the local configuration archive directory and file name prefix settings. The command also performs the following operations:

·     Disables the configuration archive feature (both manual and automatic methods).

·     Restores the default settings of the archive configuration interval and archive configuration max commands.

·     Clears the configuration archive information displayed by using the display archive configuration command.

Examples

# Set the configuration archive directory as flash:/archive and the archive file name prefix as my_archive.

<Sysname> mkdir flash:/archive

Creating directory flash:/archive... Done.

<Sysname> system-view

[Sysname] archive configuration location flash:/archive filename-prefix my_archive

Related commands

archive configuration

archive configuration interval

archive configuration max

display archive configuration

archive configuration max

Use archive configuration max to set the maximum number of configuration archives that can be saved on the device.

Use undo archive configuration max to restore the default.

Syntax

archive configuration max file-number

undo archive configuration max

Default

The maximum number is 5.

Views

System view

Predefined user roles

network-admin

mdc-admin

Parameters

file-number: Specifies the maximum number of configuration archives that can be saved on the device. The value range is 1 to 10. Adjust the setting depending on the amount of storage space available.

Usage guidelines

Before you execute this command, use the archive configuration location command to specify a configuration archive directory and archive file name prefix on the device.

After the maximum number of configuration archives is reached, the system deletes the oldest archive for the new archive.

Changing the limit setting to a lower value does not cause immediate deletion of excess archives. Instead, the configuration archive feature deletes the oldest n files when a new archive is manually or automatically saved, where n = current archive count – new archive limit + 1. For example, seven configuration archives have been saved before the archive limit is set to four. When saving a new configuration archive, the system first deletes the oldest four (7 – 4 + 1) archives.

If you execute the undo archive configuration location command, the default archive limit is restored.

Examples

# Set the maximum number of configuration archives to 10.

<Sysname> system-view

[Sysname] archive configuration max 10

Related commands

archive configuration

archive configuration location

archive configuration interval

display archive configuration

archive configuration server

Use archive configuration server to configure the parameters for archiving the running configuration to a remote SCP server.

Use undo archive configuration server to restore the default.

Syntax

archive configuration server scp { ipv4-address | ipv6 ipv6-address } [ port port-number ] [ vpn-instance vpn-instance-name ] [ directory directory ] filename-prefix filename-prefix

undo archive configuration server

Default

No parameters are set for archiving the running configuration to a remote SCP server.

Views

System view

Predefined user roles

network-admin

mdc-admin

Parameters

scp: Specifies a remote SCP server.

ipv4-address: Specifies the SCP server by its IPv4 address.

ipv6 ipv6-address: Specifies the SCP server by its IPv6 address.

port port-number: Specifies the TCP port number of the SCP server.

vpn-instance vpn-instance-name: Specifies an MPLS L3VPN instance by its name, a case-sensitive string of 1 to 31 characters. If the SCP server is on the public network, do not specify this option.

directory directory: Specifies the archive directory, a case-insensitive string. If you do not specify this option, the archive directory is the root directory of the SCP server.

filename-prefix filename-prefix: Specifies a file name prefix for configuration archives, a case-insensitive string of 1 to 30 characters. Valid characters are letters, digits, underscores (_), and hyphens (-).

Usage guidelines

IMPORTANT

IMPORTANT:

In FIPS mode, the device does not support archiving the running configuration to a remote SCP server.

Before archiving the running configuration to a remote SCP server, you must perform the following tasks:

·     Use this command to specify a configuration archive directory and a name prefix on the remote SCP server.

·     Use the archive configuration server user and archive configuration server password commands to configure a username and password for logging in to the server.

To manually archive the running configuration, use the archive configuration command. To periodically archive the running configuration, use the archive configuration interval command.

On the specified remote SCP server, configuration archives are named in the format of filename-prefix_YYYYMMDD_HHMMSS.cfg, for example, archive_20170526_203430.cfg.

Local archiving (the archive configuration location command) and remote archiving (the archive configuration server command) are mutually exclusive. You cannot use the two features at the same time.

The maximum number of configuration archives on a remote SCP server depends on the SCP server setting and is not restricted by the archive configuration max command.

The undo archive configuration server command removes the configuration archive directory and file name prefix settings, but it does not delete the configuration archives saved on the server. The command also performs the following operations:

·     Disables the configuration archive feature (both manual and automatic methods).

·     Restores the default setting for the archive configuration interval command.

·     Clears the configuration archive information displayed by using the display archive configuration command.

Examples

# Set the configuration archive directory as archive/ on the SCP server at 192.168.1.1 and set the archive file name prefix as my_archive.

<Sysname> system-view

[Sysname] archive configuration server scp 192.168.1.1 port 22 directory /archive/ filename-prefix my_archive

Related commands

archive configuration

archive configuration interval

archive configuration location

archive configuration server password

archive configuration server user

display archive configuration

archive configuration server password

Use archive configuration server password to configure the password for logging in to the SCP server that saves configuration archives.

Use undo archive configuration server password to restore the default.

Syntax

archive configuration server password { cipher | simple } string

undo archive configuration server password

Default

No password is configured for logging in to the SCP server that saves configuration archives.

Views

System view

Predefined user roles

network-admin

mdc-admin

Parameters

cipher: Specifies a password in encrypted form.

simple: Specifies a 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 63 characters. Its encrypted form is a case-sensitive string of 33 to 117 characters.

Examples

# Set the password to admin in plaintext form for logging in to the SCP server that saves configuration archives.

<Sysname> system-view

[Sysname] archive configuration server password simple admin

Related commands

archive configuration server

archive configuration server user

display archive configuration

archive configuration server user

Use archive configuration server user to configure the username for logging in to the SCP server that saves configuration archives.

Use undo archive configuration server user to restore the default.

Syntax

archive configuration server user user-name

undo archive configuration server user

Default

No username is configured for logging in to the SCP server that saves configuration archives.

Views

System view

Predefined user roles

network-admin

mdc-admin

Parameters

user-name: Specifies the username, a case-sensitive string of 1 to 63 characters.

Examples

# Set the username to admin for logging in to the SCP server that saves configuration archives.

<Sysname> system-view

[Sysname] archive configuration server user admin

Related commands

archive configuration server

archive configuration server password

display archive configuration

backup startup-configuration

Use backup startup-configuration to back up the main next-startup configuration file to a TFTP server.

Syntax

backup startup-configuration to { ipv4-server | ipv6 ipv6-server } [ dest-filename ] [ vpn-instance vpn-instance-name ]

Views

User view

Predefined user roles

network-admin

mdc-admin

Parameters

ipv4-server: Specifies a TFTP server by its IPv4 address or host name. The host name is a case-insensitive string of 1 to 253 characters. Valid characters include letters, digits, hyphens (-), underscores (_), and dots (.).

ipv6 ipv6-server: Specifies a TFTP server by its IPv6 address or host name. The host name is a case-insensitive string of 1 to 253 characters. Valid characters include letters, digits, hyphens (-), underscores (_), and dots (.).

dest-filename: Specifies the name of the target file used for saving the file on the server. The file must be a .cfg file. The file name is a case-insensitive string of up to 255 characters. If you do not specify a target file name, the source file name is used.

vpn-instance vpn-instance-name: Specifies an MPLS L3VPN instance by its name, a case-sensitive string of 1 to 31 characters. If the TFTP server is on the public network, do not specify this option.

Usage guidelines

This command is not supported in FIPS mode.

Examples

# Back up the main next-startup configuration file to the IPv4 TFTP server at 2.2.2.2 in the public network, and set the target file name to 192-168-1-26.cfg.

<Sysname> backup startup-configuration to 2.2.2.2 192-168-1-26.cfg

Backing up the main startup configuration file to 2.2.2.2...

Done.

# Back up the main next-startup configuration file to the IPv4 TFTP server at 2.2.2.2 in MPLS L3VPN instance VPN1, and set the target file name to 192-168-1-26.cfg.

<Sysname> backup startup-configuration to 2.2.2.2 192-168-1-26.cfg vpn-instance VPN1

Backing up the main startup configuration file to 2.2.2.2 in VPN VPN1...

Done.

# Back up the main next-startup configuration file to the IPv6 TFTP server at 2001::2 in the public network, and set the target file name to 192-168-1-26.cfg.

<Sysname> backup startup-configuration to ipv6 2001::2 192-168-1-26.cfg

Backing up the main startup configuration file to 2001::2...

Done.

Related commands

restore startup-configuration

configuration commit

Use configuration commit to commit the settings configured after the configuration commit delay timer was set.

Syntax

configuration commit

Views

System view

Predefined user roles

network-admin

mdc-admin

Usage guidelines

You must execute the configuration commit delay command to set the configuration delay timer before executing this command.

The settings you made during the commit delay interval are automatically removed if you have not manually committed them before the configuration commit delay timer expires.

As a best practice, configure the information center to output logs to the console. Use the logs to determine whether you want to commit the settings. For more information about the information center, see Network Management and Monitoring Configuration Guide.

Examples

# Set the configuration commit delay timer to 10 minutes.

<Sysname> system-view

[Sysname] configuration commit delay 10

# Commit the settings configured after the configuration commit delay timer was set and before the delay timer expires.

[Sysname] configuration commit

Related commands

configuration commit delay

configuration commit delay

Use configuration commit delay to enable the configuration commit delay feature and start the configuration commit delay timer.

Syntax

configuration commit delay delay-time

Views

System view

Predefined user roles

network-admin

mdc-admin

Parameters

delay-time: Sets the configuration commit delay interval. The value range is 1 to 65535 minutes.

Usage guidelines

The system creates a rollback point to record the configuration status when you execute this command to start the configuration commit delay timer. The settings you made during the commit delay interval takes effect immediately. However, these settings will be removed automatically if you have not manually committed them before the configuration commit delay timer expires. Then, the system returns to the configuration status when the commit delay timer started.

This feature prevents a misconfiguration from causing the inability to access the device and is especially useful when you configure the device remotely.

When you use this feature, follow these restrictions and guidelines:

·     In a multi-user context, make sure no one else is configuring the device.

·     To avoid unexpected errors, do not perform any operations during the configuration rollback.

·     You can reconfigure the configuration commit delay timer before it expires to shorten or extend the commit delay interval. However, the rollback point will not change.

·     The configuration commit delay feature is a one-time setting. The feature is disabled with the rollback point removed when the commit delay timer expires or after a manual commit operation is performed. To use this feature again, you must re-execute this command.

Examples

# Set the configuration commit delay timer to 10 minutes.

<Sysname> system-view

[Sysname] configuration commit delay 10

# Change the configuration commit delay timer to 60 minutes before the old delay timer expires.

[Sysname] configuration commit delay 60

The commit delay already set 10 minutes, overwrite it? [Y/N]:y

Related commands

configuration commit

configuration encrypt

Use configuration encrypt to enable configuration encryption.

Use undo configuration encrypt to disable configuration encryption.

Syntax

configuration encrypt { private-key | public-key }

undo configuration encrypt

Default

Configuration encryption is disabled.

Views

System view

Predefined user roles

network-admin

mdc-admin

Parameters

private-key: Encrypts configuration with a private key. All devices running Comware 7 software use the same private key.

public-key: Encrypts configuration with a public key. All devices running Comware 7 software use the same public key.

Usage guidelines

Configuration encryption enables the device to automatically encrypt a configuration file when saving the running configuration to the file.

Any devices running Comware 7 software can decrypt the encrypted configuration file. To prevent an encrypted file from being decoded by unauthorized users, make sure the file is accessible only to authorized users.

Examples

# Enable the public-key method for configuration encryption.

<Sysname> system-view

[Sysname] configuration encrypt public-key

configuration replace file

Use configuration replace file to perform configuration rollback.

Syntax

configuration replace file filename

Views

System view

Predefined user roles

network-admin

mdc-admin

Parameters

filename: Specifies the path of the replacement configuration file, a string of up to 255 characters. The file must be a .cfg file. The file and file path must be valid and on the local system.

Usage guidelines

To replace the running configuration with the configuration in a configuration file without rebooting the device, use the configuration rollback feature. This feature helps you revert to a previous configuration state or adapt the running configuration to different network environments.

To ensure a successful rollback, follow these guidelines:

·     Make sure the replacement configuration file is created by using the configuration archive feature or the save command on the device.

·     If the configuration file is not created on the device, make sure the command lines in the configuration file are fully compatible with the device.

·     Make sure the replacement configuration file is not encrypted.

Examples

# Replace the running configuration with the configuration in the my_archive_1.cfg configuration file.

<Sysname> system-view

[Sysname] configuration replace file my_archive_1.cfg

Current configuration will be lost, save current configuration? [Y/N]:n

Now replacing the current configuration. Please wait...

Succeeded in replacing current configuration with the file my_archive_1.cfg.

display archive configuration

Use display archive configuration to display configuration archive information.

Syntax

display archive configuration

Views

Any view

Predefined user roles

network-admin

network-operator

mdc-admin

mdc-operator

Examples

# Display information about the configuration archives saved on the device.

<Sysname> display archive configuration

Location: flash:/archive

Filename prefix: my_archive

Archive interval in minutes: 120

Maximum number of archive files: 10

Archive history:

  No.  Timestamp                Filename

  1    Aug 05 2007 20:24:54     my_archive_1.cfg

  2    Aug 05 2007 20:34:54     my_archive_2.cfg

# 3    Aug 05 2007 20:44:54     my_archive_3.cfg

The pound sign (#) indicates the most recent archive file.

Next archive file to be saved: my_archive_4.cfg

# Display information about the configuration archives saved on a remote SCP server.

<Sysname> display archive configuration

Username: test

Location: scp://192.168.21.21:22/archive

Filename prefix: my_archive

Archive interval in minutes: 120

Archive history:

 No.   Timestamp                  Filename 

 1    Wed Dec 15 14:20:18 2010   my_archive_20170509_142018.cfg

!2    Wed Dec 15 14:33:10 2010   my_archive_20170509_143018.cfg

#!3    Wed Dec 15 14:49:37 2010   my_archive_20170509_144018.cfg

The exclamation mark (!) indicates that the remote archiving attempt failed.

The pound sign (#) indicates the most recent archive file.

Table 1 Command output

Field

Description

Username

Username for logging in to the SCP server that saves configuration archives.

Location

Absolute path of the directory for saving running-configuration archives.

Filename prefix

File name prefix for configuration archives.

Archive interval in minutes

Interval (in minutes) for the system to automatically archive the running configuration.

If automatic configuration saving is disabled, this field is not available.

Maximum number of archive files

Maximum number of configuration archives that can be saved on the device.

Archive history

History configuration archive information.

No.

Number of a configuration archive.

Timestamp

Time when the configuration archive was created.

 

Related commands

archive configuration

archive configuration interval

archive configuration location

archive configuration max

archive configuration server

archive configuration server user

display current-configuration

Use display current-configuration to display the running configuration.

Syntax

In standalone mode:

display current-configuration [ configuration [ module-name ] | exclude-provision | interface [ interface-type [ interface-number ] ] ] [ all ]

In IRF mode:

display current-configuration [ [ configuration [ module-name ] | exclude-provision | interface [ interface-type [ interface-number ] ] ] [ all ] | chassis chassis-number ]

Views

Any view

Predefined user roles

network-admin

network-operator

mdc-admin

mdc-operator

Parameters

configuration [ module-name ]: Displays the feature configuration. The module-name argument specifies a feature module. If you do not specify a feature module, the command displays all feature settings you have made.

exclude-provision: Excludes preprovisioned settings from the running configuration.

interface [ interface-type [ interface-number ] ]: Displays interface configuration, where the interface-type argument represents the interface type and the interface-number argument represents the interface number. If you do not specify the interface-type interface-number arguments, the command displays the running configuration for all interfaces. If you specify only the interface-type argument, the command displays the running configuration for all interfaces of this type.

all: Displays all settings in the running configuration, including the default settings. If you do not specify this keyword, the command displays only non-default settings in the running configuration.

chassis chassis-number: Specifies an IRF member device by its member ID. If you do not specify an IRF member device, this command displays the running configuration for all IRF member devices. (In IRF mode.)

Usage guidelines

Use this command to verify the configuration you have made.

If the system has automatically changed the setting you have made for a parameter, this command displays the effective setting instead of the configured one. An automatic change typically occurs because of system restrictions. This command does not display parameters that are using the default settings if you do not specify the all keyword.

Examples

# Display local user configuration.

<Sysname> display current-configuration configuration local-user

#

local-user ftp

 password hash $h$6$Twd73mLrN8O2vvD5$Cz1vgdpR4KoTiRQNE9pg33gU14Br2p1VguczLSVyJLO2huV5Syx/LfDIf8ROLtVErJ/C31oq2rFtmNuyZf4STw==

 service-type ftp

 authorization-attribute user-role network-operator

#

local-user root

 password hash $h$6$Twd73mLrN8O2vvD5$Cz1vgdpR4KoTiRQNE9pg33gU14Br2p1VguczLSVyJLO2huV5Syx/LfDIf8ROLtVErJ/C31oq2rFtmNuyZf4STw==

 service-type ssh telnet terminal

 authorization-attribute user-role network-admin

#

return

# Display VLAN interface configuration.

<Sysname> display current-configuration interface Vlan-interface

#

interface Vlan-interface1

 ip address 192.168.1.84 255.255.255

#

Return

display current-configuration diff

Use display current-configuration diff to display the differences that the running configuration has as compared with the next-startup configuration.

Syntax

display current-configuration diff

Views

Any view

Predefined user roles

network-admin

network-operator

mdc-admin

mdc-operator

Usage guidelines

This command searches for the next-startup configuration in the following order:

1.     The .cfg main next-startup configuration file.

2.     The .cfg backup next-startup configuration file if the .cfg main next-startup configuration file is unavailable.

If both configuration files are unavailable, the system displays a message indicating that no next-startup configuration files exist.

Examples

# Display the differences that the running configuration has as compared with the next-startup configuration.

<Sysname> display current-configuration diff

--- Startup configuration

+++ Current configuration

@@ -5,7 +5,7 @@

 #

  sysname Sysname

 #

-alias dhc display history-command

+alias dh display hotkey

 #

  system-working-mode standard

<Sysname>

Table 2 Command output

Field

Description

- - - A

+++ B

·     A represents the source configuration for comparison, which can be Startup configuration, Current configuration, or the name of the source configuration file with its directory information.

·     B represents the target configuration for comparison, which can be Current configuration, Startup configuration, or the name of the target configuration file with its directory information.

In this example, the startup configuration and the current configuration are the source and target, respectively.

@@ -linenumber1,number1 +linenumber2,number2 @@

Location information for identifying the command line differences:

·     -linenumber1,number1—Source configuration section that contains 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—Target configuration section that contains 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 differences.

·     cmd1 and cmd4—Command lines are contained in both source and target configurations 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 the source configuration but not in the target configuration.

·     + cmd3—Command lines are prefixed with a plus sign if they are contained in the target configuration but not in the source configuration.

In this example, the sample output shows that the alias dhc display history-command command is contained only in the source configuration, and the alias dh display hotkey command is contained only in the target configuration.  

 

Related commands

display current-configuration

display diff

display saved-configuration

display default-configuration

Use display default-configuration to display the factory defaults.

Syntax

display default-configuration

Views

Any view

Predefined user roles

network-admin

network-operator

mdc-admin

mdc-operator

Usage guidelines

Factory defaults are custom basic settings that came with the device. Factory defaults vary by device models and might differ from the initial default settings for the commands.

The device starts up with the factory defaults if no next-startup configuration files are available.

Examples

# Display the factory defaults.

<Sysname> display default-configuration

display diff

Use display diff to display differences between configurations.

Syntax

display diff configfile file-name-s { configfile file-name-d | current-configuration | startup-configuration }

display diff current-configuration { configfile file-name-d | startup-configuration }

display diff startup-configuration { configfile file-name-d | current-configuration }

Views

Any view

Predefined user roles

network-admin

network-operator

mdc-admin

mdc-operator

Usage guidelines

If you specify the startup-configuration keyword, the system searches for the next-startup configuration in the following order:

1.     The .cfg main next-startup configuration file.

2.     The .cfg backup next-startup configuration file if the .cfg main next-startup configuration file is unavailable.

If both configuration files are unavailable, the system displays a message indicating that no next-startup configuration files exist.

Parameters

configfile file-name-s: Specifies the source configuration file for comparison.

configfile file-name-d: Specifies the target configuration file for comparison.

current-configuration: Specifies the running configuration. In the display diff current-configuration command, this keyword specifies the source configuration for comparison. In the display diff configfile file-name-s and display diff startup-configuration commands, this keyword specifies the target configuration.

startup-configuration: Specifies the next-startup configuration. In the display diff startup-configuration command, this keyword specifies the source configuration for comparison. In the display diff configfile file-name-s and display diff current-configuration commands, this keyword specifies the target configuration.

Examples

# Display the differences between startup.cfg and test.cfg.

<Sysname> display diff configfile startup.cfg configfile test.cfg

--- flash:/startup.cfg

+++ flash:/test.cfg

@@ -5,7 +5,7 @@

 #

  sysname Sysname

 #

-alias dhc display history-command

+alias dh display hotkey

 #

  system-working-mode standard

<Sysname>

The output shows that the alias dhc display history-command command is contained only in startup.cfg, and the alias dh display hotkey command is contained only in test.cfg.

# Display the differences between the running configuration and the next-startup configuration.

<Sysname> display diff current-configuration startup-configuration

--- Current configuration

+++ Startup configuration

@@ -5,7 +5,7 @@

 #

  sysname Sysname

 #

-alias dhc display history-command

+alias dh display hotkey

 #

  system-working-mode standard

<Sysname>

The output shows that the alias dhc display history-command command is contained only in the running configuration, and the alias dh display hotkey command is contained only in the next-startup configuration.

For the command output description, see Table 2.

Related commands

display current-configuration

display current-configuration diff

display saved-configuration

display saved-configuration

Use display saved-configuration to display the contents of the configuration file for the next system startup.

Syntax

display saved-configuration

Views

Any view

Predefined user roles

network-admin

network-operator

mdc-admin

mdc-operator

Usage guidelines

Use this command to verify that important settings have been saved to the configuration file for the next system startup.

This command selects the configuration file to display in the following order:

1.     If the main startup configuration file is available, this command displays the contents of the main startup configuration file.

2.     If only the backup startup configuration file is available, this command displays the contents of the backup file.

3.     If both the main and backup startup configuration files are not available, this command does not display anything.

Examples

# Display the contents of the configuration file for the next system startup.

<Sysname> display saved-configuration

#

 version 7.1.070, Release 1201

#

 sysname Sysname

#

 ftp server enable

#

 telnet server enable

#

 domain default enable system

#

vlan 1

#

domain system

#

  ---- More ----

Related commands

reset saved-configuration

save

display startup

Use display startup to display the names of the current startup configuration file and the next-startup configuration files.

Syntax

display startup

Views

Any view

Predefined user roles

network-admin

network-operator

mdc-admin

mdc-operator

Usage guidelines

(In standalone mode.) The standby MPU always uses the same current startup configuration file as the active MPU.

(In IRF mode.) The global standby MPUs always use the same current startup configuration file as the global active MPU.

(In standalone mode.) After an active/standby switchover, it is normal that the current startup configuration files on both MPUs are displayed as NULL. This is because the new active MPU continues to run with the running configuration rather than rebooting with a startup configuration file.

(In IRF mode.) After an active/standby switchover, it is normal that the current startup configuration files on all MPUs are displayed as NULL. This is because the new global active MPU continues to run with the running configuration rather than rebooting with a startup configuration file.

Examples

# Display names of the startup configuration files.

<Sysname> display startup

MainBoard:

 Current startup saved-configuration file: flash:/startup.cfg

 Next main startup saved-configuration file: flash:/startup.cfg

 Next backup startup saved-configuration file: NULL

Table 3 Command output

Field

Description

MainBoard

(In standalone mode.) Displays the startup configuration files on the active MPU.

(In IRF mode.) Displays the startup configuration files on the global active MPU.

Current startup saved-configuration file

Configuration file that the device has started up with.

Next main startup saved-configuration file

Primary configuration file to be used at the next startup.

Next backup startup saved-configuration file

Backup configuration file to be used at the next startup.

 

Related commands

startup saved-configuration

display this

Use display this to display the running configuration in the current view.

Syntax

display this [ all ]

Views

Any view

Predefined user roles

network-admin

network-operator

mdc-admin

mdc-operator

Parameters

all: Displays all settings in the running configuration in the current view, including the default settings. If you do not specify this keyword, the command displays only non-default settings in the running configuration.

Usage guidelines

Use this command to verify the configuration you have made in a certain view.

This command does not display parameters that are using the default settings if you do not specify the all keyword.

Some parameters can be successfully set even if their dependent features are not enabled. For these parameters, this command displays their settings after the dependent features are enabled.

This command can be executed in any user line view to display the running configuration of all user lines.

Examples

# Display the running configuration on VLAN-interface 1.

<Sysname> system-view

[Sysname] interface vlan-interface 1

[Sysname-Vlan-interface1] display this

#

interface Vlan-interface1

#

return

reset saved-configuration

Use reset saved-configuration to delete a next-startup configuration file.

Syntax

reset saved-configuration [ backup | main ]

Views

User view

Predefined user roles

network-admin

mdc-admin

Parameters

backup: Specifies the backup next-startup configuration file.

main: Specifies the main next-startup configuration file.

Usage guidelines

CAUTION

CAUTION:

(In standalone mode.) This command permanently deletes the specified next-startup configuration file from the device.

(In IRF mode.) By default, this command permanently deletes the specified next-startup configuration file from all IRF member devices. To delete the configuration file only from the master device, disable automatic system-wide next-startup configuration file operations.

 

You can delete the main file, the backup file, or both.

To delete a file that is set as both main and backup next-startup configuration files, you must execute both the reset saved-configuration backup command and the reset saved-configuration main command. Using only one of the commands sets the target file attribute to NULL instead of deleting the file.

If you do not specify a configuration file attribute, the reset saved-configuration command deletes the main next-startup configuration file.

Examples

# Delete the main next-startup configuration file.

<Sysname> reset saved-configuration

The saved configuration file will be erased. Are you sure? [Y/N]:y

Configuration file in flash: is being cleared.

Please wait ...........

Configuration file is cleared.

Related commands

display saved-configuration

restore startup-configuration

Use restore startup-configuration to download a configuration file from a TFTP server and specify it as the main next-startup configuration file.

Syntax

restore startup-configuration from { ipv4-server | ipv6 ipv6-server } src-filename [ vpn-instance vpn-instance-name ]

Views

User view

Predefined user roles

network-admin

mdc-admin

Parameters

ipv4-server: Specifies a TFTP server by its IPv4 address or host name. The host name is a case-insensitive string of 1 to 253 characters. Valid characters include letters, digits, hyphens (-), underscores (_), and dots (.).

ipv6 ipv6-server: Specifies a TFTP server by its IPv6 address or host name. The host name is a case-insensitive string of 1 to 253 characters. Valid characters include letters, digits, hyphens (-), underscores (_), and dots (.).

src-filename: Specifies the name of the configuration file to be downloaded. The file must be a .cfg file. The file name is a case-insensitive string of up to 255 characters.

vpn-instance vpn-instance-name: Specifies an MPLS L3VPN instance by its name, a case-sensitive string of 1 to 31 characters. If the TFTP server is on the public network, do not specify this option.

Usage guidelines

This command is not supported in FIPS mode.

Before restoring the configuration file for the next startup, make sure the following requirements are met:

·     The server is reachable.

·     The server is enabled with TFTP service.

·     You have read and write permissions to the server.

This command downloads the configuration file to the root directory of the default storage medium on each MPU and specifies the file as the main next-startup configuration file. If the default storage medium has been partitioned, the configuration file is saved on the first partition. Make sure all MPUs use the same type of default storage media. If a standby MPU uses a different type of default storage medium than the active MPU, the command cannot propagate the configuration file to the standby MPU. For example, the standby MPU uses a USB disk, but the active MPU uses a flash memory. In this situation, you must manually restore the next-startup configuration file on the standby MPU.

Examples

# Download test.cfg from the IPv4 TFTP server at 2.2.2.2 in the public network, and specify the file as the main next-startup configuration file.

<Sysname> restore startup-configuration from 2.2.2.2 test.cfg

Restoring the next startup-configuration file from 2.2.2.2. Please wait...finished.

# Download test.cfg from the IPv4 TFTP server at 2.2.2.2 in MPLS L3VPN instance VPN1, and specify the file as the main next-startup configuration file.

<Sysname> restore startup-configuration from 2.2.2.2 test.cfg vpn-instance VPN1

Restoring the next startup-configuration file from 2.2.2.2. Please wait...finished.

# Download test.cfg from the IPv6 TFTP server at 2001::2 in the public network, and specify the file as the main next-startup configuration file.

<Sysname> restore startup-configuration from ipv6 2001::2 test.cfg

Restoring the next startup-configuration file from 2001::2. Please wait...finished.

Related commands

backup startup-configuration

save

In standalone mode:

Use save file-url [ all | slot slot-number ] to save the running configuration to a configuration file, without specifying the file as a next-startup configuration file.

Use save [ safely ] [ backup | main ] [ force ] [ mdc-all | changed ] to save the running configuration as a next-startup configuration file in the root directory of the storage medium. By default, this command automatically saves the configuration as a next-startup configuration file on each MPU. To save the configuration only to the active MPU, disable automatic system-wide next-startup configuration file operations.

In IRF mode:

Use save file-url [ all | chassis chassis-number slot slot-number ] to save the running configuration to a configuration file, without specifying the file as a next-startup configuration file.

Use save [ safely ] [ backup | main ] [ force ] [ mdc-all | changed ] to save the running configuration as a next-startup configuration file in the root directory of the storage medium. By default, this command automatically saves the configuration as a next-startup configuration file on each MPU. To save the configuration only to the global active MPU, disable automatic system-wide next-startup configuration file operations.

Syntax

In standalone mode:

save file-url [ all | slot slot-number ]

save [ safely ] [ backup | main ] [ force ] [ mdc-all | changed ]

In IRF mode:

save file-url [ all | chassis chassis-number slot slot-number ]

save [ safely ] [ backup | main ] [ force ] [ mdc-all | changed ]

Views

Any view

Predefined user roles

network-admin

mdc-admin

Parameters

file-url: Specifies a file path, a string of up to 255 characters. The file must be a .cfg file. If you specify the all keyword or the slot slot-number option, the file path cannot include a slot number. If the file path includes a folder name, the folder must already exist on the specified MPUs. (In standalone mode.)

file-url: Specifies a file path, a string of up to 255 characters. The file must be a .cfg file. If you specify the all keyword or the chassis chassis-number slot slot-number option, the file path cannot include a chassis or slot number. If the file path includes a folder name, the folder must already exist on the specified MPUs. (In IRF mode.)

all: Saves the running configuration to both MPUs. If you do not specify this keyword or the slot slot-number option, the command saves the running configuration only to the active MPU. (In standalone mode.)

all: Saves the running configuration to all MPUs. If you do not specify this keyword or the chassis chassis-number slot slot-number option, the command saves the running configuration only to the global active MPU in the IRF fabric. (In IRF mode.)

slot slot-number: Specifies the standby MPU by its slot number. If you do not specify the standby MPU or the all keyword, this command saves the running configuration only to the active MPU. (In standalone mode.)

chassis chassis-number slot slot-number: Specifies a standby MPU on an IRF member device. The chassis-number argument represents the member ID of the IRF member device. The slot-number argument represents the slot number of the standby MPU. If you do not specify a standby MPU or the all keyword, this command saves the running configuration only to the global active MPU in the IRF fabric. (In IRF mode.)

safely: Saves the configuration file in safe mode. If you do not specify this keyword, the device saves the configuration file in fast mode.

backup: Saves the running configuration to a configuration file, and specifies the file as the backup next-startup configuration file. If you do not specify this keyword or the main keyword, the command specifies the saved file as the main next-startup configuration file.

main: Saves the running configuration to a configuration file, and specifies the file as the main next-startup configuration file. If you do not specify this keyword or the backup keyword, the command specifies the saved file as the main next-startup configuration file.

force: Saves the running configuration to the existing next-startup configuration file without prompting for confirmation. If you do not specify this keyword, the system prompts you to confirm the operation. If you do not confirm the operation within 30 seconds, the system automatically aborts the operation. If you enter Y within the time limit, you can continue the save process and change the target file name during the process.

mdc-all: Saves the running configuration for each MDC. This keyword is available only on the default MDC. If this keyword is not available or you do not specify this keyword, the save command saves the running configuration only for the MDC where you are logged in.

changed: Overwrites the target configuration file with the running configuration if an inconsistency is detected between the settings in the configuration file and the running configuration. The save command does not take effect if no inconsistency is detected. If you do not specify this keyword, the save command always overwrites the target configuration file with the running configuration.

Usage guidelines

If the file specified for this command does not exist, the system creates the file before saving the configuration. If the file already exists, the system prompts you to confirm whether to overwrite the file. If you choose to not overwrite the file, the system cancels the save operation.

This command saves the running configuration to an .mdb binary file as well as a .cfg text file. The two files use the same file name. An .mdb file takes less time to load than a .cfg file.

When you use the save [ safely ] [ backup | main ] [ force ] [ mdc-all | changed ] command, follow these guidelines:

·     In safe mode, the system saves configuration in a temporary file and starts overwriting the target next-startup configuration file after the save operation is complete. If a reboot, power failure, or out of memory or storage space event occurs during the save operation, the next-startup configuration file is retained.

·     In fast mode, the device directly overwrites the target next-startup configuration file. If a reboot, power failure, or out of memory or storage space event occurs during this process, all settings in the next-startup configuration file are lost.

Safe mode is slower than fast mode, but more secure. As a best practice, specify the safely keyword for reliable configuration saving.

Examples

# Save the running configuration to backup.cfg, without specifying the file as a next-startup configuration file.

<Sysname> save backup.cfg

The current configuration will be saved to flash:/backup.cfg. Continue? [Y/N]:y

Now saving current configuration to the device.

Saving configuration flash:/backup.cfg. Please wait...

Configuration is saved to device successfully.

# Save the running configuration to the main next-startup configuration file without any confirmation required.

<Sysname> save force

Validating file. Please wait....

Saved the current configuration to mainboard device successfully.

# Save the running configuration to a file in the root directory of the default storage medium, and specify the file as the main next-startup configuration file.

<Sysname> save

The current configuration will be written to the device. Are you sure? [Y/N]:y

Please input the file name(*.cfg)[flash:/backup.cfg]

(To leave the existing filename unchanged, press the enter key):test.cfg

Validating file. Please wait............

Saved the current configuration to mainboard device successfully.

# Save the running configuration to a file in the root directory of the flash memory for each MDC, and specify the file as the main next-startup configuration file.

<Sysname> save mdc-all

Save current configuration in MDC Admin? [Y/N]:y

Please input the file name(*.cfg)[flash:/test.cfg]

(To leave the existing filename unchanged, press the enter key):

flash:/test.cfg exists, overwrite? [Y/N]:y

Validating file. Please wait...

Saved the current configuration of mdc Admin to mainboard device successfully. 

Related commands

display current-configuration

display saved-configuration

standby auto-update config

Use standby auto-update config to enable automatic system-wide next-startup configuration file operations.

Use undo standby auto-update config to disable automatic system-wide next-startup configuration file operations.

Syntax

standby auto-update config

undo standby auto-update config

Default

Next-startup configuration file operations are automatically synchronized across the entire system.

Views

System view

Predefined user roles

network-admin

mdc-admin

Usage guidelines

In standalone mode:

By default, the system performs the following operations on both active and standby MPUs:

·     Saves the running configuration to the next-startup configuration file on each MPU when you execute the save [ safely ] [ backup | main ] [ force ] [ mdc-all | changed ] command.

·     Deletes the next-startup configuration file on each MPU when you execute the reset saved-configuration command.

To have the system save the running configuration or delete the next-startup configuration file only on the active MPU, use the undo standby auto-update config command.

In IRF mode:

By default, the system performs the following operations on all MPUs:

·     Saves the running configuration to the next-startup configuration file on each MPU when you execute the save [ safely ] [ backup | main ] [ force ] [ mdc-all | changed ] command.

·     Deletes the next-startup configuration file on each MPU when you execute the reset saved-configuration command.

To have the system save the running configuration or delete the next-startup configuration file only on the global active MPU, use the undo standby auto-update config command.

Examples

# Enable automatic system-wide next-startup configuration file operations.

<Sysname> system-view

[Sysname] standby auto-update config

Related commands

reset saved-configuration

save

startup saved-configuration

Use startup saved-configuration to specify a file as a next-startup configuration file.

Use undo startup saved-configuration to configure the system to start up with the factory defaults at the next startup.

Syntax

startup saved-configuration cfgfile [ backup | main ]

undo startup saved-configuration

Default

No next-startup configuration files are specified.

Views

User view

Predefined user roles

network-admin

mdc-admin

Parameters

cfgfile: Specifies the path of a configuration file, a string of up to 255 characters. The file must be a .cfg file. The file path can include only the file name, or the storage medium information and file name. If the file is not on the default storage medium, you must specify the file name with storage medium information.

backup: Specifies the configuration file as the backup next-startup configuration file.

main: Specifies the configuration file as the main next-startup configuration file. This is the primary configuration file that the device attempts to load at startup. If the loading attempt fails, the device tries the backup next-startup configuration file.

Usage guidelines

CAUTION

CAUTION:

(In IRF mode.) In an IRF fabric, the undo startup saved-configuration command can cause an IRF split after the IRF fabric or an IRF member reboots.

(In standalone mode.) The startup saved-configuration command applies to both MPUs. To successfully execute this command, make sure the specified file has been saved in the root directory of the storage medium on both the active MPU and standby MPU.

(In IRF mode.) The startup saved-configuration command applies to all MPUs. To successfully execute this command, make sure the specified file has been saved in the root directory of the storage medium on each MPU.

If you do not specify the backup or main keyword, the startup saved-configuration command specifies the main next-startup configuration file.

As a best practice, specify different files as the main and backup next-startup configuration files.

The undo startup saved-configuration command changes the file attribute of the main and backup next-startup configuration files to NULL. However, the command does not delete the two configuration files.

You can also specify a configuration file as a next startup file when you use the save command to save the running configuration.

Examples

# Specify the main next-startup configuration file.

<Sysname> startup saved-configuration testcfg.cfg

Please wait ....... Done.

Related commands

display startup

  • 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
新华三官网