Configure Session
The command configure session creates a configuration session for CLI commands, which can occur later when the session commits. Each configure session is has a unique name. A session can enter, modify, and exit anytime without impacting the currently running system configuration.
When a session is in the commit stage, running-config has copies of the modified configuration of the session, overwriting any other configuration changes made since it creates the session. 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 the changes in a deferred session to the router's configuration by entering a commit command and exiting the mode. Alternatively, 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 use to make 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 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: 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: The user can exit from the session and return to the same session by running the configure session again.
- For 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.
Configure Replace
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 force the operation even if there are errors.
The normal workflow internally uses a configuration session to perform the replace.
Configuration CLI
In the CLI, execute the following configuration steps to create a configuration session.