Date created: Thursday, July 11, 2024 2:22:04 PM. Last modified: Thursday, July 11, 2024 2:28:33 PM
Configuration Session
By default, configuration commands are applied in real time as they are entered into the EOS CLI.
Configuration Sessions allows the user to enter configuration, view a diff before applying it, and to apply it with a rollback timer.
This example shows how config diffs can be generated:
# Start a configuration session test1#configure session s1 # When you start a config session, EOS by default copies the running config into the config session. This means a config session does not start with a blank config. As a result, there is no diff between the session config and running config: test1(config-s-s1)#show session-config diffs test1(config-s-s1)# test1(config-s-s1)#copy running-config session-config test1(config-s-s1)#show session-config diffs test1(config-s-s1)# # Changing a config line creates a diff test1(config-s-s1)#hostname foo test1(config-s-s1)#show session-config diffs --- system:/running-config +++ session:/s1-session-config ! -hostname test1 +hostname foo # This is fine if applying a partial config during a config session. # If applying a full config, it can be helpful to start a config session and set it's state to a blank config. # Then apply the full config and ask for a diff test1#configure session s1 test1(config-s-s1)#rollback clean-config test1(config-s-s1)#show session-config diffs # shows entire device config will be removed # # apply full config test1(config-s-s1)#show session-config diffs # only changes are shown
This example shows how a commit timer can be used:
# Commit timers can be used for automatic rollback of the config changes test1#configure session s1 test1(config-s-s1)#hostname foo test1(config-s-s1)#commit timer ? hh:mm:ss timeout test1(config-s-s1)#commit timer 00:01:00 foo# foo#show configuration sessions Maximum number of completed sessions: 1 Maximum number of pending sessions: 5 Merge on commit is disabled Name State User Terminal ----- ------------------------ ---------- -------- s1 pendingCommitTimer # The config changes will auto-rollack after 1 minute. # If this needs to happen sooner the config session can be aborted foo#configure session s1 abort foo# 2023 Jul 5 12:12:43 UTC 10.7.13.4 ConfigAgent: 418: %SYS-5-CONFIG_SESSION_COMMIT_TIMER_CANCELED: The commit timer on session s1 has been canceled. The system configuration will be rolled back. 2023 Jul 5 12:12:46 UTC 10.7.13.4 ConfigAgent: 419: %SYS-5-CONFIG_REPLACE_SUCCESS: User root replaced running configuration with file:/tmp/commitTimerCheckPointConfig.txt successfully on UnknownTty (UnknownIpAddr) foo# test1# # "commit" will commit the changes and end the rollback time test1#configure session s1 test1(config-s-s1)#hostname foo test1(config-s-s1)#commit timer 00:01:00 foo# foo#configure session s1 commit foo#
Previous page: BGP Commands
Next page: EOS Defaults