01-Fundamentals Command Reference

HomeSupportResource CenterSwitchesH3C S6300 Switch SeriesH3C S6300 Switch SeriesTechnical DocumentsCommandCommand ReferencesH3C S6300 Switch Series Command References-Release 243x-6W10001-Fundamentals Command Reference
06-Configuration file management commands
Title Size Download
06-Configuration file management commands 105.08 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

Usage guidelines

Before manually archiving the running configuration, you must use the archive configuration location command to specify a directory and a name prefix for the configuration archives.

Configuration archive facilitates configuration rollback. It provides manual and automatic methods for saving the running configuration. For more information about the archiving mechanism, see the section about configuration rollback in Fundamentals Configuration Guide.

Examples

# Archive the running configuration.

<Sysname> archive configuration

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

The archive configuration file myarchive_1.cfg is saved.

Related commands

·     archive configuration interval

·     archive configuration location

·     archive configuration max

·     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 restore the default.

Syntax

archive configuration interval minutes

undo archive configuration interval

Default

The system does not automatically archive the running configuration.

Views

System view

Predefined user roles

network-admin

Parameters

minutes: Specifies the interval (in minutes) for automatically saving the running configuration. The value range is 10 to 525600 (365 days).

Usage guidelines

Before enabling automatic configuration archiving, use the archive configuration location command to specify the configuration archive directory and archive file name prefix.

Configuration archive is a feature that facilitates configuration rollback. It provides manual and automatic methods for saving the running configuration.

Automatic configuration archiving enables the system to save the running configuration to the archive directory at the specified interval. For more information about the archiving mechanism, see the section about configuration rollback in Fundamentals Configuration Guide.

Change the archiving interval depending on the amount of available storage space. The shorter the interval, the more free storage space is required.

Examples

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

<Sysname> system-view

[Sysname] archive configuration interval 60

Archive files will be saved every 60 minutes.

Related commands

·     archive configuration

·     archive configuration location

·     archive configuration max

·     display archive configuration

archive configuration location

Use archive configuration location to configure the 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 configuration archive directory or configuration archive file name prefix has been set.

Views

System view

Predefined user roles

network-admin

Parameters

directory: Specifies the archive directory, a case-insensitive string of 1 to 63 characters. The directory name must take the format of storage-medium-name:/folder-name. This directory must already exist on the master.

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 configure a directory and file name prefix for configuration archives.

In an IRF fabric, the configuration archive feature saves the running configuration only on the master device. To make sure the system can archive the running configuration after a master/subordinate switchover, create the directory on all IRF members.

Configuration archives are named in the format of prefix_serial number.cfg, for example, 20080620archive_1.cfg and 20080620archive_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, 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 configuration archive directory and file name prefix settings. The command also performs the following tasks:

·     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

# Configure 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 location

·     archive configuration max

·     display archive configuration

archive configuration max

Use archive configuration max to set the maximum number of configuration archives.

Use undo archive configuration max to restore the default.

Syntax

archive configuration max file-number

undo archive configuration max

Default

Up to five configuration archives can be saved.

Views

System view

Predefined user roles

network-admin

Parameters

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

Usage guidelines

Before you can set a limit on configuration archives, use the archive configuration location command to specify a configuration archive directory and archive file name prefix.

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.

Suppose 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

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 tftp-server [ dest-filename ]

Views

User view

Predefined user roles

network-admin

Parameters

tftp-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 (.).

dest-filename: Specifies the target file name used for saving the file on the server. The file name must use the .cfg extension. If you do not specify a target file name, the source file name is used.

Usage guidelines

This command is not supported in FIPS mode.

Examples

# Back up the main next-startup configuration file to the TFTP server at 2.2.2.2, 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

Backup next startup-configuration file to 2.2.2.2, please wait…finished

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

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

# Commit the settings after the configuration commit delay timer has expired. The commit operation will fail and the system will roll back the configuration.

[Sysname] configuration commit

The system is rolling back configuration. Please wait…

configuration commit delay

Use configuration commit delay to start the configuration commit delay timer.

Syntax

configuration commit delay delay-time

Views

System view

Predefined user roles

network-admin

Parameters

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

Usage guidelines

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

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

You can reconfigure the configuration commit delay timer before it expires to shorten or extend the commit delay interval. The settings made during the delay interval will be removed if you have not committed them before the new timer expires.

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

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

·     You cannot perform any operations during the configuration rollback.

·     The configuration commit delay feature is a one-time setting. The feature is disabled when the commit delay timer expires or after a manual commit operation is performed.

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

# Attempt to set the configuration commit delay timer to 20 minutes while the system is rolling back the configuration upon expiration of the old delay timer.

[Sysname] configuration commit delay 20

The system is rolling back configuration. Please wait…

configuration encrypt

Use configuration encrypt to enable configuration encryption.

Use undo configuration encrypt to restore the default.

Syntax

configuration encrypt { private-key | public-key }

undo configuration encrypt

Default

Configuration encryption is disabled. The running configuration is saved to a configuration file without encryption.

Views

System view

Predefined user roles

network-admin

Parameters

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

public-key: Encrypts configuration with a public key. All H3C 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 H3C 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

Parameters

filename: Specifies the name of the replacement configuration file for configuration rollback. The file name is a string of 5 to 195 characters suffixed with the .cfg extension, and can include path information.

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:

·     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, including the archive directory, archive prefix, archive interval, maximum number of archives, and saved archives.

Syntax

display archive configuration

Views

Any view

Predefined user roles

network-admin

network-operator

Examples

# Display configuration archive information.

<Sysname> display archive configuration

Location: flash:/archive

Filename prefix: my_archive

Archive interval in minutes: 120

Maximum number of archive files: 10

Saved archive files:

  No. TimeStamp                  FileName

  1   Wed Jan 15 14:20:18 2012   my_archive_1.cfg

  2   Wed Jan 15 14:33:10 2012   my_archive_2.cfg

# 3   Wed Jan 15 14:49:37 2012   my_archive_3.cfg

'#' indicates the most recent archive file.

Next archive file to be saved: my_archive_4.cfg

Table 1 Command output

Field

Description

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.

Saved archive files

Configuration archives that have been saved.

TimeStamp

Time when the configuration archive was created.

 

Related commands

·     archive configuration

·     archive configuration interval

·     archive configuration location

·     archive configuration max

display current-configuration

Use display current-configuration to display the running configuration.

Syntax

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

Views

Any view

Predefined user roles

network-admin

network-operator

Parameters

configuration [ module-name ]: Displays feature configuration. The module-name argument specifies a feature module. If no feature module is specified, this command displays all feature settings you have made. Available feature modules depend on the device 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.

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.

Typically, this command does not display parameters that are using the default settings.

Examples

# Display local user configuration.

<Sysname> display current-configuration configuration local-user

#

local-user ftp

 password hash $h$6$4UDOXMkpPwLyMwIX$ohXVbEb+YPMceuyB1A9k+MBoylujMQSAedf+fskEIkYFqcIBXvAqvdbzgqFK2azda3BAtLeHakQe9hepn8ejsA==

 service-type ftp

 authorization-attribute user-role network-operator

#

local-user root

 password hash $h$6$zSWYxJ3Oj01iR7x1$a5BIEHfcqTUKrVkd6HB9vVLh8abWLm9sy/FW8J0ypdnqtH/Du6IU+9UlM8W5OM+ihHJAWXUkTEAoMuJKBwcogw==

 service-type ssh telnet terminal

 authorization-attribute user-role network-admin

#

return

# Display Ethernet interface configuration.

<Sysname> display current-configuration interface ten-gigabitethernet 1/0/1

#

interface Ten-GigabitEthernet1/0/1

 port link-type trunk

 port trunk permit vlan 1

 shutdown

#

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

Usage guidelines

This command compares the running configuration with the next-startup configuration in the following steps:

1.     Compares the running configuration with the main next-startup configuration file.

2.     If the main next-startup configuration file is unavailable, this command compares the running configuration with the backup next-startup configuration file.

If both the main and backup next-startup 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.

<TEST1> display current-configuration diff

--- Startup configuration

+++ Current configuration

@@ -6,7 +6,7 @@

 #

  stp global enable

 #

- sysname TEST

+ sysname TEST1

 #

  telnet server enable

 #

Table 2 Command output

Field

Description

- - - A

+++ B

·     A displays 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 displays 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 summary for sections that contain 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 stp global enable and telnet server enable commands are contained in both configurations, the sysname TEST1 command is contained only in the running configuration, and the sysname TEST command is contained only in the next-startup 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

Usage guidelines

Factory defaults are product-specific default settings that are different from initial settings. These default settings ensure that the device can start up and run correctly when it does not have a startup configuration file or the configuration file is corrupt.

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

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 other two display diff 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 other two display diff commands, this keyword specifies the target configuration.

Usage guidelines

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

1.     The main next-startup configuration file.

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

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

Examples

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

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

--- flash:/test.cfg

+++ flash:/testsys.cfg

@@ -6,7 +6,7 @@

 #

  stp global enable

 #

- sysname test

+ sysname test1

 #

  telnet server enable

 #

# Display the differences between test.cfg and testsys.cfg on IRF member 1 and IRF member 2.

<Sysname>display diff configfile slot1#flash:/test.cfg configfile slot2#flash:/testsys.cfg

--- flash:/test.cfg

+++ slot2#flash:/testsys.cfg

@@ -6,7 +6,7 @@

 #

  stp global enable

 #

- sysname TEST

+ sysname TEST1

 #

  telnet server enable

 #

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

<TEST> display diff current-configuration startup-configuration

--- Current configuration

+++ Startup configuration

 

@@ -6,7 +6,7 @@

 #

  stp global enable

 #

- sysname TEST

+ sysname TEST1

 #

  telnet server enable

 #

For descriptions about the command output, 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

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.045, ESS 2415

#

 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

Usage guidelines

Current startup configuration file is the configuration file that has been loaded. Next-startup configuration file is the configuration file used at the next startup.

All IRF members use the same current startup configuration file as the master. After a master/subordinate switchover, it is normal that the current startup configuration files on them are displayed as NULL. This is because the new master 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

Slot 1:

 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

Displays the startup configuration files on the master device.

Current startup saved-configuration file

Configuration file that the device has started up with.

Next main startup saved-configuration file

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

Slot n

Displays the startup configuration files on member device n.

 

Related commands

startup saved-configuration

display this

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

Syntax

display this

Views

Any view

Predefined user roles

network-admin

network-operator

Usage guidelines

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

This command does not display parameters that are set to their default settings.

Some parameters can be successfully configured 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 interface Ten-GigabitEthernet 1/0/1.

<Sysname> system-view

[Sysname] interface ten-gigabitethernet 1/0/1

[Sysname-Ten-GigabitEthernet1/0/1] display this

#

interface Ten-GigabitEthernet1/0/1

 port link-type trunk

 port trunk permit vlan 1

 shutdown

#

return

# Display the running configuration on user lines.

<Sysname> system-view

[Sysname] line vty 0

[Sysname-line-vty0] display this

#

line aux 1

 user-role network-admin

#

line vty 0 63

 authentication-mode none

 user-role network-admin

 user-role network-operator

 idle-timeout 0 0

#

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

Parameters

backup: Deletes the backup next-startup configuration file.

main: Deletes the main next-startup configuration file.

Usage guidelines

CAUTION

CAUTION:

This command permanently deletes the specified next-startup configuration file from all IRF member devices.

 

Delete a next-startup configuration file if it does not match the software version or is corrupt.

You can delete the main, the backup, 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 removes the specified file attribute instead of deleting the file.

For example, if the reset saved-configuration backup command is executed, the backup next-startup configuration file setting is set to NULL. However, the file is still used as the main file. To delete the file, you must also execute the reset saved-configuration main command.

If no configuration file attribute is specified, the reset saved-configuration command deletes the main next-startup configuration file.

Examples

# Delete the backup next-startup configuration file.

<Sysname> reset saved-configuration backup

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

Configuration file in flash: is being cleared.

Please wait ...

..

MainBoard:

Configuration file is cleared.

Slot 2:

Erase next configuration file successfully

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 tftp-server src-filename

Views

User view

Predefined user roles

network-admin

Parameters

tftp-server: Specifies a TFTP server's 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 (.).

src-filename: Specifies the name of the configuration file to be downloaded. The file name must be a string of 5 to 195 characters suffixed with the .cfg extension, and can include path information.

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 provides an easy method for configuration file restoration by automatically performing all operations required for restoring the main next-startup configuration file.

The command downloads the configuration file to the root directory of the default storage medium on each member device and specifies the file as the main next-startup configuration file. If a partitioned USB disk is used as the default storage medium, the configuration file is saved on the first partition.

Make sure all IRF members use the same type of default storage medium. If a subordinate device uses a different type of default storage medium than the master, the command cannot propagate the configuration file to the subordinate device. For example, the subordinate device uses a USB disk, but the master uses a flash memory. In this situation, you must manually restore the main next-startup configuration file on the subordinate device.

Examples

# Download config.cfg from the TFTP server at 2.2.2.2 and specify the file as the main next-startup configuration file.

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

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

Now restoring the next startup-configuration file from main board to backup board. Please wait...finished.

Related commands

backup startup-configuration

save

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 ] to save the running configuration to a file in the root directory of the default storage medium. This command automatically saves the file on each IRF member device and specifies the file as a next-startup configuration file.

Syntax

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

save [ safely ] [ backup | main ] [ force ]

Views

Any view

Predefined user roles

network-admin

Parameters

file-url: Saves the running configuration to the specified file, without specifying the file as a next-startup configuration file. The file name must be a string of 5 to 195 characters suffixed with the .cfg extension, and can include path information. If the keyword all or a member ID is specified, the file path cannot include a member ID. If the file path includes a folder name, the folder must already exist.

all: Saves the running configuration to all member devices. If you do not specify this keyword or the slot slot-number option, the command saves the running configuration only to the master.

slot slot-number: Saves the running configuration to a subordinate device. The slot-number argument represents the IRF member ID of the device. If you do not specify this option or the all keyword, the command saves the running configuration only to the master.

safely: Saves the configuration file in safe mode. If this keyword is not specified, the device saves the configuration file in fast mode. Safe mode is slower than fast mode, but more secure.

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 without prompting for confirmation. Without this keyword, the system asks 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.

Usage guidelines

Make sure all MPUs use the same type of storage medium as the default storage medium.

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.

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 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 event occurs during this process, the next-startup configuration file is lost.

As a best practice, specify the safely keyword for the command.

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 flash successfully.

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

<Sysname> save force

Validating file. Please wait....

Configuration is saved to 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:/startup.cfg]

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

Validating file. Please wait...

Saved the current configuration to mainboard device successfully.

Slot 1:

Save next configuration file successfully.

Related commands

·     display current-configuration

·     display saved-configuration

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

Parameters

cfgfile: Specifies the name of a configuration file. The file name must be a string of 5 to 195 characters suffixed with the .cfg extension, and can include the path information. This .cfg file must already exist in the root directory of the default storage medium.

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 an IRF fabric, the undo startup saved-configuration command can cause an IRF split after the IRF fabric or an IRF member reboots.

 

In an IRF fabric, the startup saved-configuration command applies to all IRF members. To successfully execute this command, make sure the specified file has been saved in the root directory of the default storage medium on each member device. In addition, make sure all IRF member devices use the same type of storage medium as the default storage medium.

If the startup configuration file is on a USB disk, do not remove the USB disk during the startup process. If you remove the USB disk, one of the following events will occur:

·     In a single-chassis IRF fabric, the device will start up with the factory defaults.

·     In a multichassis IRF fabric, the device will leave the IRF fabric at startup and run the factory defaults.

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