The command configure session creates a configuration session in which CLI commands can be issued that do not take effect until the session is committed . Each configure session is saved with a unique name. A session can be entered, modified and exited at any time without impacting the currently running system configuration.
When a session is committed, the configuration that was modified during the session is copied into running-config, overwriting any other configuration changes made since the session was created. A session can be aborted or removed, thereby removing the session completely and freeing up memory used by the session. The user must explicitly request that the changes in a deferred session be applied to the configuration of the router by entering a commit command and exiting the mode. Alternately, the user may abandon the changes by entering an abort command. An uncommitted configuration session will be discarded if the switch reboots and will time out after 24 hours.
Configuration sessions are used to make sets of changes, after verifying that there are no CLI errors. Configuration sessions allow the administrator to pre-provision a group of CLI commands in a named session, then execute each configuration session at specified times.
The configure session command allows users to make a series of configuration changes in a temporary location and commit them to running-config at once by issuing the commit command.
- configure session <name of session> and running-config: The user enters a session (versus configure terminal in the case where configuration sessions are not used). If a session name is not specified, a system named session is created. A snapshot of the current running-config is copied into the session’s data structure as the basis of further configuration changes.
- CLI configuration commands: User can run any configuration commands inside the session.
- rollback clean-config: User can run rollback command to revert the sessions configuration to the factory-default configuration (or clean configuration).
- show session-config: User can run show session-config to show the sessions configuration, which will be the future running-config once committed.
- commit: User issues commit to commit the changes, which will replace the current running-config.
- abort: To abort the session and throw away all changes.
- exit: User can exit from the session, and later return to the same session by running configure session <name> again.
- For named session:More than one CLI instance can enter the same session and make changes to the session configuration. Once the session is committed in any of the CLIs, no other CLI can commit or make any other changes in that session.
The command configure replace <URL> replaces the current running-config with the configuration saved in <URL>. By default, configure replace <URL> will replace running-config only if the configuration in <URL> loads without errors. The command configure replace <URL> ignore-errors forces the operation even if there are errors.
The normal workflow internally uses a configuration session to perform the replace.
In the CLI, execute the following configuration steps to create a configuration session.
configure session [
name of session
Create or enter a session. If a name is not specified, it is automatically generated. The user is put in the session configuration mode and the prompt will change to show the first six characters of the session name. Designating the name of a session is optional. When name of session is not specified, a unique name is assigned.
no configure session name of sessionDelete the specified configuration session. Designating the name of a session is required.
Commit the changes made in the session. This command must be issued from within the session configuration mode.
abortAbort the session, which is the same as deleting it. This command must be issued from within the session configuration mode.
Revert configuration in the session to the clean, factory-default configuration. This command must be issued from within the session configuration mode.
service configuration session max completed
Set a limit on the maximum number of committed sessions that are saved.
service configuration session max pending
Set a limit on the maximum number of uncommitted sessions that can be outstanding.