Configuration and Image File Commands

This chapter contains the following sections:

boot host auto-config

To enable the DHCP Auto Configuration feature on the switch, use the boot host auto-config Global Configuration mode command.

To disable this feature on the switch, use the no form of this command.

Syntax

boot host auto-config

no boot host auto-config

Parameters

N/A

Default Configuration

DHCP Auto Configuration is enabled.

Command Mode

Global Configuration mode

User Guidelines

Auto Configuration enables passing configuration information to hosts on a TCP/IP network. Based on this protocol, the Auto Configuration feature enables a switch to download configuration files from a TFTP server. The switch can be configured as a DHCPv4 client in which auto configuration from a DHCPv4 server is supported or a DHCPv6 client in which auto configuration from a DHCPv6 server is supported.

After the switch obtains information such as configuration file name and TFTP server IP address from the DHCP server, it will first automatically download the specific configuration file from the remote TFTP server, copy the downloaded configuration to the startup configuration, and then reboot.

Example

switchxxxxxx(config)# boot host auto-config

boot system

To specify the active system image file that will be loaded at startup, use the boot system Global Configuration mode command.

Syntax

boot system {image-1 | image-2}

Parameters

image-1—Specifies that image1 will be loaded as the system image during the next startup.

image-2—Specifies that image2 will be loaded as the system image during the next startup.

Default Configuration

N/A

Command Mode

Global Configuration mode

Example

The following example specifies image1 as the active system image file:

switchxxxxxx(config)# boot system image-1
Select "image1" Success

ca-certificate install

To manually install a CA certificate, use the ca-certificate install command in Global Configuration mode. To remove a static CA certificate, use the no form of this command.

Syntax

ca-certificate install name WORD<1-160> [owner WORD<1-32>]

no ca-certificate install name WORD<1-160>

Parameters

name—Specifies the certificate name. The range is from 1 to 160 characters.

owner—specifies the owner of the certificate. This is a string of 0 to 32 characters. If an owner is not specified, the default owner is "Static".

Default Configuration

There are no installed certificates.

Command Mode

Global Configuration mode

User Guidelines

Use the ca-certificate install name command to install a CA certificate. Following the command, the user will be prompted to enter the certificate in the command line.

The user will need to enter or paste the certificate. Entering a period on a separate line indicates that the certificate input is complete. The entered certificate must use the pem format.

Up to 128 certificates can be installed.

When using the no form of the command to remove certificates, a specific certificate can be removed by name. Alternatively, the owner keyword can be used to remove all static certificates belonging to a specific owner.

Example

The following example installs a CA certificate from the command line:

Switchxxxxxx(config)#ca-certificate install name Cisco owner Cisco
Please paste the input certificate now, add a period (.) on a separate line after the input
-----BEGIN CERTIFICATE-----
MIIDNTCCAh2gAwIBAgIBATANBgkqhkiG9w0BAQsFADA8MQswCQYDVQQGEwJVUzEW
MBQGA1UEChMNQ2lzY28gU3lzdGVtczEVMBMGA1UEAxMMQ2lzY28gUlhDLVIyMB4X
DTE0MDcwOTIxNDY1NloXDTM0MDcwOTIxNDY1NlowPDELMAkGA1UEBhMCVVMxFjAU
BgNVBAoTDUNpc2NvIFN5c3RlbXMxFTATBgNVBAMTDENpc2NvIFJYQy1SMjCCASIw
DQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBANtCMXsK05wqTce60mQGZLAIL8wT
6i02PnfuPth2FAGDwUtPL4jLHBJW8uVJJEBLom3pyhPpc/jaqd1g6dddKxwK4Y2L
vHW/c1j86IMqjXLeE9//u58xND+hiOhBx1QQpO+BFe4jpQW6NRKYqWlz7G5aPO+M
fk3zDWEnEWRpoisf2jNOnNYVqRQdEY4+xZ9NHTsATS3NbAGFADRi7Vx0C6dSieI+
CtNsTRG6dMU8x8/IX40VzREyPtIqMSWtGwuz0xk6KayB1ADYuBW8mH5jfufIOLn1
/XSgVz7flasyfJ8iKbW1eoIgpGNyXJGBI39iPWTYZswh+Ok7swZskj0mPzECAwEA
AaNCMEAwDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYE
FJByBGD93fqE7I5aBFj3z/vDcgkWMA0GCSqGSIb3DQEBCwUAA4IBAQCBDfRhZWOb
blcaSjp0A8tREiYjHaDW9oR6Pk3xd5SMYE2axpy45nFjbfXCr9HTBz+mi8SrunUw
P4lzgv+P+EyyT/Kmt6KRrm2z+CPr6JUaexYgsennNi/TRmiqdWRXY4gyrYSsCgJB
jw3A7srAUvZSma6JEiP2E4skx3KVHmliwyBaK04KSkKKwY4b+oQIZVq2cgySm2bB
1q2+SMI5jMk9pRUh0anImbDyZPCARsIQuhUD5MOSYh+GiG7oTurvsf70H1RxuZrQ
/RwhDKseClSVWzBiLtiDW3LOAo5UNjqyQAZgZcS1yhAsGcsPXB7eel783IZDbq7Q
kK4RSUNGApEO
-----END CERTIFICATE-----

copy

To copy a source file to a destination file, use the copy Privileged EXEC mode command.

Syntax

copy

Parameters

The following table displays the file options:

Keyword

Source or Destination

backup-config

Backup configuration file. A configuration file can be downloaded to this file (without giving a file name). This can then be copied to the Running configuration file or the Startup configuration file.

flash://

Copy from the flash file system.

mirror-config

Mirror configuration file. If the Running configuration file and the Startup configuration file have been identical for 24 hours, the Startup configuration file is automatically copied to the Mirror Configuration file by the system. It can then be copied to the Startup configuration file or the Running configuration file if required.

running-config

Currently Running configuration file.

startup-config

Startup configuration file.

tftp://

Copy from a TFTP server. The syntax for this alias is tftp://host/[directory]/filename. The host can be either identified by an IP address or a hostname.

Command Mode

Privileged EXEC mode

User Guidelines

The entire copying process may take several minutes and differs from protocol to protocol and from network to network.

Copying a Configuration File from a Server

  • Use the copy tftp:// startup-config command to copy a configuration file from a network server to the switch’s Startup Configuration file.

  • Use the copy tftp:// running-config command to copy a configuration file from a network server to the switch’s Running Configuration file.

  • Use the copy tftp://backup-config command to copy a configuration file from a network server to the switch’s Backup Configuration file.

Storing a Configuration File on a Server

  • Use the copy running-config tftp:// command to copy the current Running Configuration file to a network server using TFTP.

  • Use the copy startup-config tftp:// command to copy the Startup Configuration file to a network server using TFTP.

  • Use the copy backup-config tftp:// command to copy the Backup Configuration file to a network server using TFTP.

Saving the Running Configuration to the Startup Configuration

  • Use the copy running-config startup-config command to copy the Running Configuration file to the Startup Configuration file.

Backing Up the Running Configuration or Startup Configuration to the Backup Configuration

  • Use the copy running-config backup-config command to copy the Running Configuration file to the Backup Configuration file.

  • Use the copy startup-config backup-config command to copy the Startup Configuration file to the Backup Configuration file.

Restoring the Mirror Configuration File.

  • Use copy mirror-config startup-config to copy the Mirror Configuration file to the Startup Configuration file.

  • Use copy mirror-config running-config to copy the Mirror Configuration file to the Running Configuration file.

Examples

Example 1—The following example copies a system image file (file1) from the TFTP server 172.16.101.101 to the nonactive image file (image1):

switchxxxxxx# copy tftp://172.16.101.101/file1 flash://image-1
Downloading file...Please Wait...
Upgrade firmware success. Do you want to reboot now? (y/n)

Example 2—The following example copies the Mirror Configuration file, saved by the system, to the Startup Configuration file:

switchxxxxxx# copy mirror-config startup-config

delete backup-config

To delete the Backup Configuration from the flash memory, use the delete backup-config Privileged EXEC mode command.

Syntax

delete backup-config

Parameters

N/A

Default Configuration

N/A

Command Mode

Privileged EXEC mode

Example

The following example deletes the Backup Configuration file from the flash memory:

switchxxxxxx# delete backup-config
Delete backup-config [y/n]

delete startup-config

To delete the Startup Configuration from the flash memory, use the delete startup-config Privileged EXEC mode command. The system will start with the default configuration during the next startup.

Syntax

delete startup-config

Parameters

N/A

Default Configuration

N/A

Command Mode

Privileged EXEC mode

Example

The following example deletes the Startup Configuration file from the flash memory:

switchxxxxxx# delete startup-config
Delete startup-config [y/n]

dir

To show information for the files in the flash memory, use the dir Privileged EXEC command.

Syntax

dir

Parameters

N/A

Default Configuration

N/A

Command Mode

Privileged EXEC mode

Example

switchxxxxxx# dir
File Name          Flash Size      File Size      Modified
------------------------ --------------- --------------- ----------------------
 startup-config           1245            1245            2000-01-01 08:05:03
 mirror-config            1245            1245            2000-01-02 10:32:01
 rsa2                     1679            1679            2000-01-01 08:00:37
 dsa2                     668             668             2000-01-01 08:00:48
 ssl_cert                 891             891             2000-01-01 08:01:08
 image-1                  13828096        7125944         2013-12-27 19:36:56
 image-2                  13828096        7141865         2014-01-10 17:44:55
Total size of flash: 32112640 bytes
Free size of flash: 4450720 bytes

ip dhcp tftp-server file

To set the full name of the configuration file located on the TFTP server, use the ip dhcp tftp-server file Global Configuration mode command.

To delete the configuration file setting, use the no form of this command.

Syntax

ip dhcp tftp-server file WORD<1-128>

no ip dhcp tftp-server file

Parameters

WORD<1-128>—Full name of the configuration file located on the TFTP server defined in the ip dhcp tftp-server ip address command.

Default Configuration

No configuration file is specified.

Command Mode

Global Configuration mode

User Guidelines

This setting is only active when the DHCP options that the switch receives from the DHCP server do not include the TFTP server and configuration file information. In this case, the switch automatically downloads this configuration file from the TFTP server defined in the ip dhcp tftp-server ip address command.

Example

The following example specifies the backup configuration file name as autodhcp.cfg:

switchxxxxxx(config)# ip dhcp tftp-server file autodhcp.cfg

ip dhcp tftp-server ip address

To set the IP address or hostname of the TFTP server from which the switch can automatically download the configuration file by using the DHCP options, use the ip dhcp tftp-server ip address Global Configuration mode command.

To delete the TFTP server, use the no form of this command.

Syntax

ip dhcp tftp-server ip address {ipv4-address | hostname | ipv6-address}

no dhcp tftp-server ip address

Parameters

ipv4-address—IPv4 address of the TFTP server.

hostname—Hostname of the TFTP server.

ipv6-address—IPv6 address of the TFTP server.

Default Configuration

No TFTP server is specified.

Command Mode

Global Configuration mode

User Guidelines

This setting is active only when the DHCP options that the switch receives from the DHCP server do not include the TFTP server and configuration file information. In this case, the switch automatically downloads the configuration file defined in the ip dhcp tftp-server file command from this TFTP server.

Example

switchxxxxxx(config)# ip dhcp tftp-server ip address autodhcp

management vlan ipv6 dhcp client information refresh

To set the refresh time and the minimum refresh time for DHCPv6 stateless client, use the management vlan ipv6 dhcp client information refresh Global Configuration mode command.

To use the default refresh time, use the no form of these commands.

Syntax

management vlan ipv6 dhcp client information refresh {infinity | <86400-4294967294> }

no management vlan ipv6 dhcp client information refresh

management vlan ipv6 dhcp client information refresh minimum {infinity | <600-4294967294> }

no management vlan ipv6 dhcp client information refresh minimum

Parameters

infinity—The time never refreshes.

<86400-4294967294>—The refresh time.

<600-4294967294>—The minimum refresh time.

Default Configuration

The default refresh time is 86400 seconds.

The default minimum refresh time is 86400 seconds.

Command Mode

Global Configuration mode

User Guidelines

If the DHCPv6 server has an Information Refresh Time option in reply message, the switch use the refresh time defined by the DHCPv6 server, otherwise, the refresh time defined in this command is used.

However, if the refresh time defined by the DHCPv6 server is smaller than the minimum refresh time defined in this command, the switch uses the minimum refresh time defined in this command.

Example

The following example configures the refresh time and the minimum refresh time for DHCPv6 stateless client:

switchxxxxxx(config)# management vlan ipv6 dhcp client information refresh 115200
switchxxxxxx(config)# management vlan ipv6 dhcp client information refresh minimum 115200

management vlan ipv6 dhcp client stateless

To enable the DHCPv6 stateless client, use the management vlan ipv6 dhcp client stateless Global Configuration mode command. This command will enable the DHCPv6 stateless client and send the information request to the DHCPv6 server.

To disable the DHCPv6 stateless client, use the no form of this command.

Syntax

management vlan ipv6 dhcp client stateless

no management vlan ipv6 dhcp client stateless

Parameters

N/A

Default Configuration

The DHCPv6 stateless client is disabled by default.

Command Mode

Global Configuration mode

Example

The following example enables the DHCPv6 stateless client on the switch:

switchxxxxxx(config)# management vlan ipv6 dhcp client stateless	

renew dhcp force-autoconfig

To force the DHCP Auto Configuration procedure to be imitated, use the renew dhcp force-autoconfig Privileged EXEC mode command.

Syntax

renew dhcp force-autoconfig

Parameters

N/A

Default Configuration

N/A

Command Mode

Privileged EXEC mode

User Guidelines

After executing this command, the DHCP Auto Configuration procedure will start on the next DHCP renew for DHCPv4 and on the next information-request refresh for DHCPv6.

Example

switchxxxxxx# renew dhcp force-autoconfig
After auto config success, the original startup-config will be replaced and system will reload.
Do you want to continue? (y/n)

show backup-config

To show information of the Backup Configuration file, use the show backup-config Privileged EXEC mode command.

Syntax

show backup-config

Parameters

N/A

Command Mode

Privileged EXEC mode

User Guidelines

The Backup Configuration file does not contain all information that can be displayed in the output. Only nondefault settings are displayed.

Example

switchxxxxxx# show backup-config
config-file-header
Switch867001
v1.0.0.16
CLI v1.0
@
!
!
!
!
username "cisco" secret encrypted ZmZmNzVhZTAzYjAyODkzZjlkM2JjZGIyMGYyMzY0NDM=
!
!
!
voice vlan oui-table add 00:E0:BB 3COM
voice vlan oui-table add 00:03:6B Cisco
voice vlan oui-table add 00:E0:75 Veritel
voice vlan oui-table add 00:D0:1E Pingtel
voice vlan oui-table add 00:01:E3 Siemens
voice vlan oui-table add 00:60:B9 NEC/Philips
voice vlan oui-table add 00:0F:E2 H3C
voice vlan oui-table add 00:09:6E Avaya
!
!
!
!
spanning-tree mst configuration
 name "00:E0:4C:86:70:01"
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
interface gi1
!
interface gi2
!
interface gi3
!
interface gi4
!
interface gi5
!
interface gi6
!
interface gi7
!
interface gi8
!
interface gi9
!
interface gi10
!
interface gi11
!
interface gi12
!
interface gi13
!
interface gi14
!
interface gi15
!
interface gi16
!
interface gi17
!
interface gi18
!
interface gi19
!
interface gi20
!
interface gi21
!
interface gi22
!
interface gi23
!
interface gi24
!
interface gi25
!
interface gi26
!
interface gi27
!
interface gi28
!
!
!
switchxxxxxx#

show boot

To show information of the DHCP Auto Configuration feature, use the show boot Privileged EXEC mode command.

Syntax

show boot

Parameters

N/A

Default Configuration

N/A

Command Mode

Privileged EXEC mode

Example

switchxxxxxx(config)# show boot
Auto Config
-----------
Config Download via DHCP: enabled

show bootvar

To show information of the system image file in the flash memory, use the show bootvar Privilege EXEC mode command.

Syntax

show bootvar

Parameters

N/A

Default Configuration

N/A

Command Mode

Privileged EXEC mode

Example

switchxxxxxx# show bootvar
Image  File Name   Version     Date                    Status
-----  ----------  ---------   ---------------------   -----------
1      image-1       1.0.0.14     2014-02-07 09:32:39   Not active
2      image-2       1.0.0.16     2014-02-26 16:02:49   Active*
"*" designates that the image was selected for the next boot

show ip dhcp tftp-server

To show information about the active and user-defined TFTP servers, use the show ip dhcp tftp-server Privileged EXEC mode command.

Syntax

show ip dhcp tftp-server

Parameters

N/A

Default Configuration

N/A

Command Mode

Privileged EXEC mode

Example

The following example shows information of the TFTP servers used for auto configuration through DHCP:

switchxxxxxx# show ip dhcp tftp-server
server address
active
manual
file path on server
active
manual

show running-config

To show the entire contents of the current Running Configuration file or show the contents of the Running Configuration file for specific interfaces, use the show running-config Privileged EXEC mode command.

Syntax

show running-config [interfaces interface-list]

Parameters

interfaces interface-list—(Optional) Specifies an interface ID or a list of interface IDs. The interface can be one of these types: Ethernet port or port channel.

Command Mode

Privileged EXEC mode

User Guidelines

The Running Configuration file does not contain all of the information that can be displayed in the output. Only nondefault settings are displayed.

Examples

Example 1—The following example shows the entire Running Configuration file:

switchxxxxx# show running-config
config-file-header
switchxxxxxx
v1.0.0.16
CLI v1.0
@
!
!
!
hostname "switchxxxxxx"
username "cisco" secret encrypted ZmZmNzVhZTAzYjAyODkzZjlkM2JjZGIyMGYyMzY0NDM=
!
!
!
voice vlan oui-table add 00:E0:BB 3COM
voice vlan oui-table add 00:03:6B Cisco
voice vlan oui-table add 00:E0:75 Veritel
voice vlan oui-table add 00:D0:1E Pingtel
voice vlan oui-table add 00:01:E3 Siemens
voice vlan oui-table add 00:60:B9 NEC/Philips
voice vlan oui-table add 00:0F:E2 H3C
voice vlan oui-table add 00:09:6E Avaya
!
!
!
!
spanning-tree mst configuration
 name "00:E0:4C:86:70:01"
!
!
!
!
!
snmp-server
!
!
!
ip telnet server
ip ssh server
!
!
!
!
!
!
!
!
!
!
interface gi1
!
interface gi2
!
interface gi3
!
interface gi4
!
interface gi5
!
interface gi6
!
interface gi7
!
interface gi8
!
interface gi9
!
interface gi10
!
interface gi11
!
interface gi12
!
interface gi13
!
interface gi14
!
interface gi15
!
interface gi16
!
interface gi17
!
interface gi18
!
interface gi19
!
interface gi20
!
interface gi21
!
interface gi22
!
interface gi23
!
interface gi24
!
interface gi25
!
interface gi26
!
interface gi27
!
interface gi28
!
!
!

Example 2—The following example shows the Running Configuration file for fa2 and fa3:

switchxxxxxx# show running-config interfaces gi1-2
interface gi1
!
interface gi2
!
switchxxxxxx#

show startup-config

To show the contents of the Startup Configuration file, use the show startup-config Privileged EXEC mode command.

Syntax

show startup-config

Parameters

N/A

Command Mode

Privileged EXEC mode

User Guidelines

The Startup Configuration file does not contain all information that can be displayed in the output. Only nondefault settings are displayed.

Example

switchxxxxxx# show startup-config
config-file-header
Switch867001
v1.0.0.16
CLI v1.0
@
!
!
!
!
username "cisco" secret encrypted ZGZlYWYxMDM5MGU1NjBhZWE3NDVjY2JhNTNlMDQ0ZWQ=
!
!
!
voice vlan oui-table add 00:E0:BB 3COM
voice vlan oui-table add 00:03:6B Cisco
voice vlan oui-table add 00:E0:75 Veritel
voice vlan oui-table add 00:D0:1E Pingtel
voice vlan oui-table add 00:01:E3 Siemens
voice vlan oui-table add 00:60:B9 NEC/Philips
voice vlan oui-table add 00:0F:E2 H3C
voice vlan oui-table add 00:09:6E Avaya
!
!
!
!
spanning-tree mst configuration
 name "00:E0:4C:86:70:01"
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
interface gi1
!
interface gi2
!
interface gi3
!
interface gi4
!
interface gi5
!
interface gi6
!
interface gi7
!
interface gi8
!
interface gi9
!
interface gi10
!
interface gi11
!
interface gi12
!
interface gi13
!
interface gi14
!
interface gi15
!
interface gi16
!
interface gi17
!
interface gi18
!
interface gi19
!
interface gi20
!
interface gi21
!
interface gi22
!
interface gi23
!
interface gi24
!
interface gi25
!
interface gi26
!
interface gi27
!
interface gi28
!
!
!

write

To save the current Running Configuration to the Startup Configuration file, use the write Privileged EXEC mode command. And use write erase command to clear all files on flash.

Syntax

write

Parameters

erase-(Optional) clear all files on flash

Default Configuration

N/A

Command Mode

Privileged EXEC mode

Examples

switchxxxxxx# write
Building configuration...
[OK]
switchxxxxxx#