# Config Management

## 1. Function Overview

This product uses the following config information to maintain the value of settings.

Config type | Description | User operations possible
--- | --- | ---
Running config (running-config) | The currently-running setting values. Managed in RAM. | View / Save to startup config
Startup config (startup-config) | Saved setting values. Two config files are maintained in ROM, and one on the SD card. When the system starts up, either the config from ROM that is selected by the startup-config select command or the config from the SD card is loaded. The config files on the SD card are managed in the following folder. SWX3220-30MC : "/swx3220-30mc/startup-config" SWX3220-30TCs : "/swx3220-30tcs/startup-config" | View / Delete / Copy
Default config (default-config) | The default setting values. Managed in ROM. | No operations possible

## 2. Definition of Terms Used

None

## 3. Function Details

### 3.1. Running config

running-config is the settings that are currently operating; since it is maintained in RAM, it is destroyed at reboot.
On this product, commands executed in configuration mode are immediately applied to running-config, and the unit operates according to these settings.
The contents of running-config can be viewed by using the show running-config command.

### 3.2. Startup config

startup-config is settings that are saved in flash ROM or on the SD card, and the contents are preserved through reboot.
When this product is started, the settings of startup-config are applied as the initial settings of running-config.

This product can maintain two startup configs in flash ROM and one startup config on the SD card.
The startup-configs in the unit’s flash ROM are managed with an ID of 0 to 1, and the config on the SD card is managed with the keyword “sd”.

To specify which of the five types of config in the unit’s flash ROM are used, use the startup-config select command.

- By default, sd is used.

- When executing the startup-config select command, the user selects whether to restart. If you don’t restart, no change occurs in the command setting.
  If you choose to restart, the unit restarts with the startup-config of the ID specified by the user’s command.

For easier management, you can use the startup-config description command to give each config a Description (explanatory text).

If you attempt to start up in a state where startup-config does not exist, such as after executing the cold start command, the default-config is automatically applied.

The running-config settings can be saved in startup-config by the copy running-config startup-config command or the write command.
The contents of startup-config can be erased by the erase startup-config command, viewed by the show startup-config command, and copied by the copy startup-config command.

### 3.3. Default config

default-config contains settings saved in internal flash ROM that are needed for this product to operate minimally as a switch. Like startup-config, the contents are preserved even after a restart.
The factory settings are maintained as default-config.
If startup-config does not exist when the system starts, default-config is copied to startup-config, and applied to running-config.
The contents of default-config cannot be viewed.

### 3.4. Deciding the config file at startup

The following describes the flow for deciding the config file used when this product starts up.

1. The startup-config select command setting value is referenced to determine the startup-config that will be used.
   If the startup-config select command has specified sd, and an SD card on which startup-config is saved is not inserted, then startup-config #0 is selected.

2. If the startup-config that is determined exists, the corresponding data is applied as running-config in RAM.
   If the startup-config determined according to the value of the startup-config select command does not exist in ROM, then default-config is applied to RAM.

If startup using the config in the SD card fails, the following message is shown in the console and in SYSLOG.

    Loading config0 because can't read config in SD card.

### 3.5. Controlling the config file via TFTP

If this product’s TFTP server function is enabled, a TFTP client installed on a PC or other remote terminal can be used to perform the following.

1. Acquire the currently running running-config and startup-config

2. Apply a previously prepared settings file as startup-config

In order for the TFTP server to function correctly, an IP address must be specified for the VLAN.
The settings files can be acquired/set from a remote terminal in binary mode. Specify the remote paths in Table 3.1 as the acquisition source/transmission destination of the settings files.
Also, specify the privileged password (administrator password) in the format "/PASSWORD" after the remote path.
However, the config files cannot be acquired or specified if the default privileged passwords (administrative passwords) are still specified. Privileged passwords (administrative passwords) must be changed in advance.
Also, at this time, you will need to change the privileged passwords (administrative passwords) for the settings in startup-config as well as the settings in running-config.
The startup-config settings are applied as running-config after the system is restarted.

Target CONFIG | Target file | Remote path | Get (GET) | Setting (PUT) | Automatic restart
--- | --- | --- | --- | --- | ---
running-config | CONFIG file (.txt) | config | Yes | Yes | -
startup-config # 0 | CONFIG file (.txt) | config0 | Yes | Yes | -
All settings (.zip) | config0-all | Yes | Yes | -
startup-config # 1 | CONFIG file (.txt) | config1 | Yes | Yes | -
All settings (.zip) | config1-all | Yes | Yes | -
startup-config # SD | CONFIG file (.txt) | configsd | Yes | Yes | -
All settings (.zip) | configsd-all | Yes | Yes | -

If you want to restart the system automatically after applying the settings file, specify the following remote path.
The currently running configuration is applicable.

Target CONFIG | Target file | Remote path | Get (GET) | Setting (PUT) | Automatic restart
--- | --- | --- | --- | --- | ---
Currently running startup-config | CONFIG file (.txt) | reconfig | - | Yes | Yes
All settings (.zip) | reconfig-all | - | Yes | Yes

When applying (PUT) a settings file, make sure that the target CONFIG and the target file type are correct.
If an incorrect file is specified, the contents cannot be reflected correctly.
For running-config, you need to add the following to the beginning of the settings file.

    !
    ! Switch Configuration
    !

3.5.1 Example of acquiring and specifying a config file from a client

When acquiring a config file from Windows using TFTP, you can acquire it by, for example, performing the operation as shown below.

- Switch IP address: 192.168.100.240

- Target CONFIG: startup-config # 0

- Privileged password (administrative password) set for config0: yamaha

- Name of the file to be locally saved: config.txt

      C:\Users\Yamaha\Desktop> tftp -i 192.168.100.240 get config0/yamaha config.txt
      Transfer successful: 3951 bytes in 1 second(s), 3951 bytes/s

When specifying a config file from Windows using TFTP, you can specify it by, for example, performing the operation as shown below.

- Switch IP address: 192.168.100.240

- Target CONFIG: startup-config # 0

- Privileged password (administrative password) set for config0: yamaha

- Name of the file to be set: config.txt

      C:\Users\Yamaha\Desktop> tftp -i 192.168.100.240 put config.txt config0/yamaha
      Transfer successful: 3951 bytes in 1 second(s), 3951 bytes/s

## 4. Related Commands

Related commands are indicated below.
For details, refer to the Command Reference.

Operations | Operating commands
--- | ---
Save running config | copy running-config startup-config
Save running config | write
Copy startup config | copy startup-config
Erase startup config | erase startup-config
Show startup config | show startup-config
Select startup config | startup-config select
Set description for startup config | startup-config description

## 5. Examples of Command Execution

### 5.1. Select startup config

Select startup-config #1 and restart the system.

    Yamaha#startup-config description 1 TEST (1)
    Yamaha#startup-config select 1 (2)
    reboot system? (y/n): y (3)

1 | Set the description “TEST” to startup-config #1
2 | Select startup-config #1
3 | Restart the system

### 5.2. Save running config

Save running-config.

    Yamaha#copy running-config startup-config
    Suceeded to write configuration
    Yamaha#

### 5.3. Copy startup config

Copy startup-config #1 to the SD card.

    Yamaha#copy startup-config 1 sd (1)
    Suceeded to copy configuration
    Yamaha#show startup-config sd (2)
    !
    !  Last Modified: Tue Mar 13 17:34:02 JST 2018
    !
    dns-client enable
    !
    interface port1.1
     switchport
     switchport mode access
     no shutdown
    !
    ...

1 | Copy startup-config #1 to the SD card
2 | Show startup-config on the SD card

### 5.4. Erase startup config

Erase startup-config from the SD card.

    Yamaha#erase startup-config sd (1)
    Suceeded to erase configuration
    Yamaha#

1 | Erase startup-config in the SD card

## 6. Points of Caution

None

## 7. Related Documentation

- Use of External Memory

Search result
No more search results.
There are no topics that match your search query.