Using the CLI to implement configuration changes

The CLI offers these capabilities for implementing configuration changes:

Procedure
  1. Access to the full set of switch configuration features
  2. The option of testing configuration changes before making them permanent

How to use the CLI to view the current configuration files. Use show commands to view the configuration for individual features, such as port status or Spanning Tree Protocol. However, to view either the entire startup-config file or the entire running-config file, use the following commands:

  • show config

    Displays a listing of the current startup-config file.

  • show running–config

    Displays a listing of the current running-config file.

  • write terminal

    Displays a listing of the current running-config file.

  • show default–config

    Displays a listing of a custom default config file.

  • show config status
    Compares the startup-config file to the running-config file and lists one of the following results:
    • If the two configurations are the same, you will see:
      • Running configuration is the same as the startup configuration.

    • If the two configurations are different, you will see:
      • Running configuration has been changed and saved.

NOTE: show config, show running–config, and write terminal commands display the configuration settings that differ from the switch’s factory default configuration.

How to use the CLI to reconfigure switch features. Use this procedure to permanently change the switch configuration (that is, to enter a change in the startup-config file).

  1. Use the appropriate CLI commands to reconfigure the desired switch parameters. This updates the selected parameters in the running-config file.

  2. Use the appropriate show commands to verify that you have correctly made the desired changes.

  3. Observe the switch’s performance with the new parameter settings to verify the effect of your changes.

  4. When you are satisfied that you have the correct parameter settings, use the write memory command to copy the changes to the startup-config file.

The write memory command saves the running configuration file to the startup-config. The saved configuration becomes the boot-up configuration of the switch on the next boot.

When using redundant management, saves the running configuration of the switch to flash on the active management module. The saved configuration becomes the boot-up configuration of the switch the next time it is booted. The saved configuration file is synchronised to the standby management module.

Note: If the active management module and the standby management module are running on different operating systems because the boot set-default command was executed and then the standby module was rebooted, the write memory command displays this warning: "Warning: The next reboot or failover is set to boot from a different software image. These config changes may be incompatible or not used after a reboot or failover."

For example, the default port mode setting is auto. Suppose that your network uses Cat 3 wiring and you want to connect the switch to another autosensing device capable of 100 Mbps operation. Because 100 Mbps over Cat 3 wiring can introduce transmission problems, the recommended port mode is auto-10, which allows the port to negotiate full- or half-duplex, but restricts speed to 10 Mbps. The following command configures port A5 to auto-10 mode in the running-config file, allowing you to observe performance on the link without making the mode change permanent.

switch(config)# interface e a5 speed-duplex auto-10

After you are satisfied that the link is operating properly, you can save the change to the switch’s permanent configuration (the startup-config file) by executing the following command:

switch(config)# write memory

The new mode (auto-10) on port A5 is now saved in the startup-config file, and the startup-config and running-config files are identical. If you subsequently reboot the switch, the auto-10 mode configuration on port A5 will remain because it is included in the startup-config file.

NOTE: Beginning with K.15.01.0031, configuration changes to ports may require up to 10 seconds to take effect, especially on switches with high CPU utilization. After a configuration command, perform an appropriate show or show running-config command to confirm the configuration change. If configuration scripts are used, the script must be modified either to check for successful completion of the previous command before executing the next command, or to sleep for 10 seconds after the configuration command is executed.

How to cancel changes you have made to the running-config file. If you use the CLI to change parameter settings in the running-config file, and then decide that you do not want those changes to remain, you can use either of the following methods to remove them:

  • Manually enter the earlier values you had for the changed settings. (This is recommended if you want to restore a small number of parameter settings to their previous boot-up values.)

  • Update the running-config file to match the startup-config file by rebooting the switch. (This is recommended if you want to restore a larger number of parameter settings to their previous boot-up values.)

If you use the CLI to change a parameter setting, and then execute the boot command without first executing the write memory command to save the change, the switch prompts you to specify whether to save the changes in the current running-config file. For example:

Boot prompt for an unsaved configuration

The above prompt means that one or more parameter settings in the running-config file differ from their counterparts in the startup-config file and you can choose which config file to retain and which to discard.

  • If you want to update the startup-config file to match the running-config file, press [Y] for “yes”. (This means that the changes you entered in the running-config file will be saved in the startup-config file.)

  • If you want to discard the changes you made to the running-config file so that it will match the startup-config file, then select [N] for “no”. (This means that the switch will discard the changes you entered in the running-config file and will update the running-config file to match the startup-config file.)

NOTE: If you use the CLI to make a change to the running-config file, you can either use the write memory command or select the save option allowed during a reboot (see Boot prompt for an unsaved configuration) to save the change to the startup-config file. That is, if you use the CLI to change a parameter setting, but then reboot the switch from either the CLI or the menu interface without first executing the write memory command in the CLI, the current startup-config file will replace the running-config file, and any changes in the running-config file will be lost.
NOTE: Using the Save command in the menu interface does not save a change made to the running config by the CLI unless you have also made a configuration change in the menu interface. Also, the menu interface displays the current running-config values. Thus, where a parameter setting is accessible from both the CLI and the menu interface, if you change the setting in the CLI, the new value will appear in the menu interface display for that parameter. However, as indicated above, unless you also make a configuration change in the menu interface, only the write memory command in the CLI will actually save the change to the startup-config file.

How to reset the startup-config and running-config files to the factory default configuration. Use the erase startup-config command to reboot the switch, which replaces the contents of the current startup-config and running-config files with the factory-default startup configuration.

The erase startup-config command
switch(config)# erase startup-config
Configuration will be deleted and device rebooted, continue [y/n]?

Press [y] to replace the current configuration with the factory default configuration and reboot the switch. Press [n] to retain the current configuration and prevent a reboot.

In a redundant management system, this command erases the startup config file on both the active and the standby management modules as long as redundancy has not been disabled. If the standby management module is not in standby mode or has failed selftest, the startup config file is not erased.