Configuration Sessions Overview
The configure session command creates a configuration session for CLI commands and ends it after issuing the commit command. Each configure session has a unique name. You can enter, modify, and exit the session anytime without impacting the currently running system configuration.
While in the commit stage of a session, the running-config command creates copies of the modified configuration of the session, overwriting any other configuration changes made since creating the session. A session can be aborted or removed, which removes the session completely and frees up memory used by the session. You must explicitly request the changes in a deferred session to the switch configuration by entering a commit command and exiting the mode. Alternatively, abandon the changes by entering an abort command. The switch discards an uncommitted configuration session if the switch reboots and the session times out after 24 hours.
Configuration sessions implement the changes after verifying that no configuration errors occur. Configuration sessions allow the administrator to pre-provision a group of CLI commands in a named session and execute each configuration session at specified times.
Configuration Session
- configure session <name of session> and running-config: The user enters a session (versus configure terminal where configuration sessions are not used). It creates a system-named session if a session name is not specified, and it copies a snapshot of the current running-config into the session’s data structure as the basis of further configuration changes.
- CLI configuration commands - The user can run any commands inside the session.
- rollback clean-config - The user can run the rollback command to revert the session configuration to the factory-default configuration (or clean configuration).
- show session-config - The user can run show session-config to show the session configuration, which will be the future running-config after committing.
- commit - Issuesthe commit command to commit the changes and replace the current running-config.
- abort - Abort the session and discard all changes.
- exit - exit from the session and return to the same session by running the configure session again.
- For a named session, more than one CLI instance can enter the same session and change the session configuration. After the session commits in any of the CLIs, no other CLI can commit or make any other changes in that session.
Replacing the Configuration
The command configure replace URL replaces the current running-config with the configuration saved in a URL. By default, the configuration in the configure replace URL replaces running-config only if the configuration in the URL loads without errors. The command configure replace URL ignore-errors force the operation even if there are errors.
The normal workflow uses a configuration session to perform the configure replace.
Configuration CLI
In the CLI, execute the following configuration steps to create a configuration session.