|
|
NOTE: This feature is not supported on the HP 3800 switches. |
|
|
The custom default configuration feature provides the ability to initialize a switch to a different state from the factory default state when you delete the active configuration file. The factory default configuration is not changed. If a custom configuration file has been created and the active configuration file is deleted, the switch will boot up using the custom configuration file.
The feature provides the ability to:
The existence of a custom default configuration file does not affect the results of loading a remotely stored configuration file onto the switch.
Using a custom default configuration, you can configure the features you want to be in the default configuration. When the active configuration is deleted using the erase startup command, the active configuration is removed and the custom default configuration file will be used upon bootup. The standard default configuration file remains and is used if there is no custom default configuration.
|
|
NOTE: This feature does not change the system defaults. The custom default configuration file is automatically used when the startup configuration file is erased. It has no effect on what is loaded onto the switch when a remotely stored configuration file is restored. |
|
|
The default configuration file can be customized using commands at the CLI prompt or by copying a configuration file with the desired configuration using TFTP, USB, or XMODEM copy commands. The existing default configuration file also can be transferred from the switch using these commands.
To start creating the configuration file to be used as the custom default configuration file, enter the commands that configure the features desired and then save the configuration file using the write memory command. An example is shown below.
Creating a config file with the desired features
HP Switch(config)# spanning-tree HP Switch(config)# interface 4 flow-control HP Switch(config)# write memory
This configuration, which enables flow control on interface 4, and also spanning-tree on the switch, is stored in the startup configuration file.
To save this configuration as the custom default configuration, the startup configuration file is copied to the default configuration file, as shown below.
Copying the startup configuration file to the custom default configuration file
HP Switch(config)# copy startup-config default-config
The switch can have up to 3 different configuration files stored in flash memory. (For more information about multiple configuration files, see "Multiple Configuration Files" in the Management and Configuration Guide for your switch.) To copy a configuration file that exists in flash memory to the custom default configuration file, use this command.
Syntax
Copies the configuration file specified in
[<source-filename>]
to the custom default configuration file.
Copying the abc.cfg config file to the custom default config file
HP Switch(config)# copy abc.cfg default-config
The following sections explains how to copy the custom default config file onto the switch using:
To copy a configuration file stored on a TFTP server to the custom default configuration file, use the copy tftp default-config command.
Syntax
To copy a configuration file to the custom default configuration file using XMODEM, use the copy xmodem default-config command.
Syntax
The following sections explains how to copy the custom default config file off the switch using:
To transfer a custom default configuration file off the switch using TFTP, enter the following command.
Syntax
While the switch supports an SSH server with SCP and/or SFTP running on it, the switch is not an SCP or SFTP client. To transfer the default custom configuration file to or from the switch, you must connect to the switch’s SSH server using any SCP or SFTP client. Instead of the actual name of the custom default configuration file, an alias name of "default-config" is displayed in the file listings and for get/store functions.
When you use an SCP client to connect to the switch, you must know the name of the file you wish to get or store. When you use SFTP client to connect to the switch, you are provided with a list of filenames that can be accessed by the switch.
|
|
NOTE: You must have an SCP/SFTP client implemented in order to execute copy scp or copy sftp commands on the switch. |
|
|
The following example shows the output from runningpuTTY psftp on a remote PC.
Using SFTP
C:\PuTTY> psftp 10.1.243.209 We'd like to keep you up to date about: * Software feature updates * New product announcements * Special events Please register your product at: www.register.hp.com Remote working directory is / psftp> ls Listing directory / drwxr-xr-x 2 J9145A J9145A 0 Jan 01 00:01 cfg drwxr-xr-x 2 J9145A J9145A 0 Jan 01 00:01 core drwxr-xr-x 2 J9145A J9145A 0 Jan 01 00:01 log drwxrwxrwx 2 J9145A J9145A 0 Jan 01 00:01 os drwxrwxrwx 3 J9145A J9145A 0 Jan 01 00:01 ssh psftp> ls /cfg Listing directory /cfg -rwxrw-r-- 1 J9145A J9145A 1749 Jan 01 00:01 default-config -rw-r--r-- 1 J9145A J9145A 745 Jan 01 01:19 running-config -rwxrw-r-- 1 J9145A J9145A 360 Jan 01 01:19 startup-config psftp>
If a custom default configuration file exists and the erase startup-config command is executed, the current active configuration is erased and the switch is booted with the custom default configuration.
Erasing the startup config file when a default custom config file exists
HP Switch(config)# erase startup-config Configuration will be deleted, and existing login passwords removed, and device rebooted (using the custom default configuration), continue [y/n]?
If a custom default configuration file does not exist and the erase startup-config command is executed, the current active configuration is erased and the switch is booted with the system default configuration.
Erasing the startup config file when a default custom config file does not exist
HP Switch(config)# erase startup-config Configuration will be deleted, and existing login passwords removed, and device rebooted, continue [y/n]?
To erase the custom default configuration file, execute the erase default-config command.
Theshow config files command displays the existing configuration files and indicates that a custom default configuration file exists.
Output displaying 3 configuration files
HP Switch(config)# show config files Configuration files: id | act pri sec | name ---+-------------+-------------------------- 1 * * | config 2 | secondaryconfig 3 * | Kconfig ================== A Custom default configuration file exists.
Enter the command show default config to display the custom default configuration.
Output for custom default configuration file
HP Switch(config)# show default-config Custom default configuration: ; J8693A Configuration Editor; Created on release #K.15.14.0001 ; Ver #02:0b:ef:e6 hostname "HP Switch" module 1 type J93x7 module 2 type J93x7 vlan 1 name "DEFAULT-VLAN" untagged 1-24 ip address dhcp-bootp exit interface 4 flow-control exit snmp-server community "public" unrestricted spanning-tree
If a custom default configuration file exists and you erase the current active config file (using the erase startup-config command), then issue the show running-config command, the output will display the contents of the custom default configuration file. The custom default configuration file is loaded upon bootup.
Output of custom default config file when current active config file erased
HP Switch(config)# show running-config Custom default configuration: ; J8693A Configuration Editor; Created on release #K.15.12.0001 ; Ver #02:0b:ef:e6 hostname "HP Switch" module 1 type J93x7 module 2 type J93x7 vlan 1 name "DEFAULT-VLAN" untagged 1-24 ip address dhcp-bootp exit interface 4 flow-control exit snmp-server community "public" unrestricted spanning-tree
-
If the switch will not boot because of a problem with the custom default configuration file, the file can be removed using the ROM mode interface.
-
The custom default configuration file cannot be erased using the front panel buttons on the switch. If the switch can be booted, use the erase default-config command to remove the custom default configuration file.