Welcome to the CLI configuration module. By the end of this module, you should be able to describe the Junos CLI configuration. The Junos CLI is a text-based command shell. In configuration mode, you can configure all properties of the Junos OS, including interfaces, protocols, and user access, as well as several system hardware properties. You use set commands in configuration mode to modify the device's candidate configuration. Use the configuration mode delete command to remove statements that you previously added to the configuration with a set command. This command deletes the statement and all its subordinate statements and identifiers. Deleting a statement or an identifier effectively unconfigures the functionality associated with that statement or identifier. Returning that functionality to its default condition. Consider using the wildcard delete function when deleting individual statements is too arduous and deleting an entire configuration sub-hierarchy lacks the granularity that you need. This example is the sample syntax for a wildcard delete. In addition to deleting configuration statements, you should also consider the use of the deactivate command to cause the specified portion of the configuration hierarchy to be ignored while still retaining the original configuration. Issue an activate command to place the configuration back into effect. Using the configuration commands such as rename, replace, insert, and copy can increase efficiency. Regardless of the method and commands you use to update your configuration file, you must issue the commit command to activate changes. This example shows the deactivate, activate, annotate, and commit commands in their output. Use the configuration mode, show command, to display the candidate configuration. This command displays the configuration at the current hierarchy level or at the specified level below the current location. The show command has the show statement path. When displaying the configuration, the CLI indents each subordinate hierarchy level, inserts curly brackets to indicate the beginning and end of each hierarchy level, and places a semicolon at the end of each statement that is at the lowest level of the hierarchy. The display format is the same format you use when creating an ASCII configuration file and it is also the same format that the CLI uses when saving a configuration to an ASCII file. In cases where an empty statement leads to an invalid configuration because it is incomplete or meaningless, the show command does not display any of the statement path. You can display the individual set commands used to create the existing configuration file using the show pipe display set command. An example of this command and its resulting output is shown. Using show pipe compare displays the differences between the candidate configuration and the active configuration, also known as rollback 0. Configuration comparison is patch-like and context-sensitive. Thus, instead of showing the entire configuration, the display shows only the actual changes. Using the operational mode, the show configuration pipe compare rollback command, enables you to view differences between the active configuration and rollback configurations. Junos OS can store up to 49 additional rollback configurations in addition to rollback 0, which is the active configuration. Similarly, the show configuration pipe compare command enables you to compare the active configuration to an arbitrary file. You can also use the show pipe compare rollback and show pipe compare filename commands in configuration mode to compare the candidate configuration with rollback configurations and arbitrary files. You can use the show system rollback compare operational mode command to compare two arbitrary rollback configurations, referencing them by numbers. The operational mode file compare files command enables you to view differences between any two text files, including log files. The output of this command is in the same patch like format as the show pipe compare command. Remember, Junos OS devices do not automatically apply your configuration changes. You must use the commit command to activate your candidate configuration. You can typically perform the commit operation from any hierarchy level. The exception is when users enter configuration mode using the configure private option that requires the commit command to be issued at the top of the configuration hierarchy. On devices with redundant routing engines, you can perform a commit synchronize operation, which activates and synchronizes the configuration on both routing engines. Alternatively, you can configure the system to automatically perform the synchronize operation when a standard commit is issued through the set system commits synchronized command. When you commit a candidate configuration, the software activates the entire configuration in its current form. Use the commit check command to validate the syntax of a candidate configuration without actually placing it into effect. The commit check cannot catch logical errors in your configuration. What happens when you are configuring a device remotely and make a mistake that leaves that device inaccessible. You can avoid this scenario by using the commit confirmed command. When you issue a commit confirmed command, the system starts a timer during which it expects to see another commit operation performed. If a second commit does not occur within the timeout value specified, the system automatically performs a configuration rollback operation. You can also schedule a commit that occurs at a specific time using the commit at command. This command is useful for synchronizing commits with multiple routers. These routers must have their time synchronized to the same source, likely through Network Time Protocol or NTP. For the commit operations to execute at the same time. To view and clear pending commits, use the show system commit and clear system commit commands. You can also add information about a commit event to your systems commit log using the commit comment command. You can add the and quit option to a commit command to activate your changes and exit configuration mode in a single-step. The Junos OS software saves the last 50 committed versions of the configuration. To overwrite the candidate configuration with one of these previously committed versions, use the rollback command. By default, the system returns to the most recently committed configuration, the active configuration. To return to a version prior to the configuration most recently committed, include the version number in the rollback command. The n argument can be a number in the range 0 through 49. The most recently saved configuration is version 0, which is the active configuration. The oldest committed configuration the software automatically saves is version 49. The factory default configuration on some of the smaller Junos OS devices restricts the number of rollback files stored by the system. This default setting can be changed to increase the number of rollback files as shown in the example. The rollback command modifies only the candidate configuration. To activate the changes loaded through the rollback operation, issue the commit command. The configure command causes a candidate configuration to be created and populated with the contents of the active configuration. You can then modify the candidate configuration with your changes. To have a candidate configuration take effect, you must commit the changes. At this time, Junos OS checks the candidate configuration for proper syntax and it installs as the active configuration. If the syntax is not correct, an error message indicates the location of the error and the software does not activate any part of the configuration, you must correct the errors before recommitting the configuration. You can easily recover previous configurations with a rollback command. Junos OS maintains a configuration history by storing previously active configurations. The software saves a maximum of 50 configurations. This number includes the current active configuration, which is also known as rollback 0, and up to 49 previously active configurations. If you perform a rollback operation, keep in mind that the related configuration does not become active until you issue a commit command. When you issue a commit command and there are 50 rollback configurations, the software purges the last rollback configuration. You can save the candidate configuration from your current configuration session to an ASCII file using the save command. Saving a candidate configuration saves the configuration in its current form, including any uncommitted changes. Note that you are saving only the configuration statements at the current hierarchy level and below. To save the entire candidate configuration, you must be at the top level of the configuration hierarchy. If you do not specify a path, Junos OS saves the configuration to the user's working directory. You can specify a file name and path in many ways. You can use the configuration mode, load command, to load a complete or a partial configuration from a local file, from a file on a remote machine, or from a terminal emulation program's capture buffer. The load command supports several arguments that determine the specifics of the operation. The following list provides details for some of the arguments to the load command. The factory default argument replaces the full current configuration with the factory default configuration. The merge argument combines the current configuration with the configuration you load. The override argument completely overrides the current configuration with the configuration you load. You must perform override operations at the top of the configuration hierarchy. The patch argument adds or deletes variables from the configuration based on the contents of a specified patch file. The patch file used in this operation uses the contextual diff format. The file generated from a show pipe, compare pipe save operation creates such a file. The replace argument looks for a replace tag in the configuration you load. The software replaces existing statements of the same name with those in the loaded configuration stanzas. The set argument enables users to load set commands from the terminal or from a saved file that consists of set configuration statements. The update argument updates the existing configuration with the configuration you load. When the update option is used, Junos OS attempts to notify only those processes affected by the configuration changes. When the override option is used, Junos OS makes no such attempt. You can use the update option from any hierarchy, but you can use the override option only from the top-level hierarchy. The terminal option uses the text you type or paste at the terminal as input to the configuration. Type Control D to end the terminal input. This option is usually used in conjunction with a terminal emulation program's copy and paste functionality to copy and paste configuration data from one system to another. The relative option is normally used during a load merge or load replace operation. The relative option negates the requirement that the data you load contains a full path to the related configuration hierarchy and tells the device to add the data you load relative to the current configuration hierarchy. In all cases, after the load operation is complete, you must issue a commit to activate the changes made to the configuration. The run command enables you to execute operational mode commands while in configuration mode. It is similar to the do command on equipment from other vendors, but much more flexible. This extremely handy time saver works for all operational mode commands, and the software supports it at all configuration hierarchies. In the example, the configuration for the devices ge-0/0/12 interface is defined. After assigning the IP address, the change is committed, and the run command is used to execute a quick ping test.