Configuration Files Overview
A configuration file stores the complete configuration of a device. The active (running) configuration is the operational file of the device. The candidate configuration is the working copy storing configuration updates.
Understanding Configuration Files
A configuration file stores the complete configuration of a network device. The current configuration of a device is called the active configuration. You can alter this current configuration and you can also return to a previous configuration or to a rescue configuration.
Juniper Networks Junos OS saves the 50 most recently committed configuration files on a device so that you can return to a previous configuration. The configuration files are named:
juniper.conf.gz—The current active configuration.
juniper.conf.1.gz to juniper.conf.49.gz—Rollback configurations.
To make changes to the configuration file, you must use configuration mode in the CLI. When making changes to a configuration file, you are viewing and changing the candidate configuration file. The candidate configuration allows you to make configuration changes without causing operational changes to the active configuration or causing potential damage to your current network operations. Once you commit the changes made to the candidate configuration, the system updates the active configuration.
Configuration File Terms
Table 1: Configuration File Terms
Current committed configuration of a device.
Working copy of the configuration that allows users to make configurational changes without causing any operational changes until this copy is committed.
Group of configuration statements that can be inherited by the rest of the configuration.
commit a configuration
Check configuration for proper syntax, activate and mark as the current configuration file running on the device.
Junos OS configuration consists of a hierarchy of statements. There are two types of statements: Container statements, which contain other statements, and leaf statements, which do not contain other statements. All the container and leaf statements together form the configuration hierarchy.
Default configuration contains the initial values set for each configuration parameter when a device is shipped.
Well-known configuration that recovers a device from a configuration that denies management access. You set a current committed configuration to be the rescue configuration through the CLI.
roll back a configuration
Return to a previously committed configuration.
Understanding How the Junos OS Configuration Is Stored
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 the users take effect.
In addition to saving the current configuration, the CLI saves the current operational version and the previous 49 versions of committed configurations. The most recently committed configuration is version 0, which is the current operational version and the default configuration that the system returns to if you roll back to a previous configuration. The oldest saved configuration is version 49.
By default, Junos OS saves the current configuration
and three previous versions of the committed configuration on the
CompactFlash card. The currently operational Junos OS configuration
is stored in the file juniper.conf.gz, and the last three
committed configurations are stored in the files juniper.conf.1.gz, juniper.conf.2.gz, and conf.3.gz. These four
files are stored on the device’s CompactFlash card in the directory
The remaining 46 previous versions of committed
configurations, the files
juniper.conf.49, are stored
in the directory
the hard disk.