Knowledge Center Search


 

SRX Getting Started - Commit Configuration

  [KB15721] Show KB Properties

  [KB15721] Hide KB Properties

Categories:
Knowledge Base ID: KB15721
Last Updated: 05 Mar 2014
Version: 4.0

Summary:

This article describes how Junos configurations are saved, as well as how to commit a configuration.

Problem or Goal:
  • Understand how Junos configurations are saved
  • Commit a configuration
  • Verify a configuration without committing it
  • Commit a configuration with a confirmation requirement
  • Commit a configuration at a specified time

Cause:

Solution:

This section contains the following:


Overview

When you edit a configuration, you work in a copy of the current configuration to create a candidate configuration. The changes you make to the candidate configuration are visible in the CLI immediately, so if multiple users are editing the configuration at the same time, all users can see all changes.

To have a candidate configuration take effect, you commit the changes. At this point, the candidate file is checked for proper syntax, activated, and marked as the current, operational software configuration file. If multiple users are editing the configuration, when you commit the candidate configuration, all changes made by all users take effect.

For SRX devices running Junos Release 10.0 or later, the current operational Junos Software configuration is stored in a file named juniper.conf, and the last 5 committed configurations are stored in the files juniper.conf.1 through juniper.conf.5. If you create a rescue configuration, it is stored in a file named rescue.conf. These files are located in the /config directory, which is on the flash drive of the SRX Series device. To list the configuration files, use the file list /config operational mode command.
user@host> file list /config 

/config:
.snap/
juniper.conf.1.gz
juniper.conf.2.gz
juniper.conf.3.gz
juniper.conf.4.gz
juniper.conf.5.gz
juniper.conf.gz
juniper.conf.md5*
license-status.db
rescue.conf.gz
usage.db
Note: The factory default for the maximum number of backup configurations allowed is 5. Increasing this backup configuration number results in increased memory usage on disk and increased commit time. For information about increasing the maximum number of backup configurations, refer to note section in Configuring the Device as a Junos OS Enforcer.

The following image illustrates the various Junos configuration states and configuration mode commands that can be used to load, commit, copy, save, or roll back the configuration:




J-Web Configuration

To commit a configuration:

After you make configuration changes using J-Web, a Commit link appears in the J-Web interface (below the Troubleshoot tab). To commit your configuration changes, click Commit.


CLI Configuration

Committing a Configuration

Use the commit command to commit a configuration.

user@host# commit  

Use the commit and-quit command to commit a configuration and return to operational mode after the commit.

user@host# commit and-quit


Verifying
the Candidate Configuration Without Committing It

To verity the candidate configuration syntax without committing it, use the commit check command. If the syntax is correct, a "configuration check succeeds" message appears. If there are errors in syntax, the errors are listed.

To verify configuration syntax:

user@host# commit check


Committing a Configuration with Confirmation Requirement


When you commit the current candidate configuration, an explicit confirmation for the commit is required for it to become permanent. This is useful if you want to verify that a configuration change works correctly and does not prevent access to the router. If the change prevents access or causes other errors, the router automatically returns to the previous configuration and restores access, after the rollback confirmation timeout passes.

This feature is known as automatic rollback. When using this feature, you have to specify  the amount of time that is required to issue the commit or commit check command. The range is 1 through 65,535 minutes and the default is 10 minutes. If you do not provide confirmation before the time elapses, the configuration is automatically rolled back to the most recently committed configuration. For more information and an example, refer to Activating a Junos Configuration but Requiring Confirmation.


Committing a Configuration at a Specific Time


You can specify that the candidate configuration be committed at a specified time or when the device is rebooted. Use the commit at command with the reboot option or a specified time or date and time. Make sure to put reboot and the time or date and time in quotation marks (" ").
user@host# commit at "reboot"
user@host#
commit at "19:00"
user@host# commit at "2010-02-15 19:00:00"
For more information, refer to Scheduling a Junos Commit Operation.


Rollback a Configuration

To return to the most recently committed configuration and load it into configuration mode, without activating it, use the rollback configuration mode command. For more information, refer to KB15788 - SRX Getting Started - Configuration Rollback.



Technical Documentation

CLI User Guide



Verification

For information about monitoring the commit process, refer to Monitoring the Junos Commit Process.

Use the show configuration operational mode command to review the configuration, if it has been committed:
user@host> show configuration
For more information, refer to KB16579 - SRX Getting Started - Show Configuration.


Purpose:
Implementation

Related Links:

 

 

ASK THE KB

Question or KB ID:


 


 

 
Copyright© 1999-2012 Juniper Networks, Inc. All rights reserved.