Using the CLI Editor in Configuration Mode


This topic describes some of the basic commands that you must use to enter configuration mode in the command-line interface (CLI) editor, navigate through the configuration hierarchy, get help, and commit or revert the changes that you make during the configuration session.




Edit Your Configuration 

Enter configuration mode.

When you first log in to the device, the device is in operational mode. You must explicitly enter configuration mode. When you do, the CLI prompt changes from user@host> to user@host# and the hierarchy level appears in square brackets.

user@host> configure

Create a statement hierarchy.

You can use the edit command to simultaneously create a hierarchy and move to that new level in the hierarchy. You cannot use the edit command to change the value of identifiers.

edit hierarchy-level value
user@host# edit security zones security-zone myzone
[edit security zones security-zone myzone]

Create a statement hierarchy and set identifier values.

The set command is similar to edit except that your current level in the hierarchy does not change.

set hierarchy-level value
user@host# set security zones security-zone myzone
Navigate the Hierarchy 

Navigate down to an existing hierarchy level.

edit hierarchy-level
user@host# edit security zones
[edit security zones]

Navigate up one level in the hierarchy.

[edit security zones]
user@host# up
[edit security]

Navigate to the top of the hierarchy.

[edit security zones]
user@host# top
Commit or Revert Changes 

Commit your configuration.

user@host# commit
commit complete

Roll back changes from the current session.

Use the rollback command to revert all changes from the current configuration session. When you run the rollback command before exiting your session or committing changes, the software loads the most recently committed configuration onto the device. You must enter the rollback statement at the edit level in the hierarchy.

user@host# rollback
load complete
Exit Configuration Mode 

Commit the configuration and exit configuration mode.

commit and-quit
user@host# commit and-quit

Exit configuration mode without committing your configuration.

You must navigate to the top of the hierarchy using the up or top commands before you can exit configuration mode.

user@host# exit
The configuration has been changed but not committed
Exit with uncommitted changes? [yes,no] (yes)
Get Help 

Display a list of valid options for the current hierarchy level.

[edit ]
user@host# edit security zones ?
Possible completions:
<[Enter]> Execute this command
> functional-zone Functional zone
> security-zone Security zones
| Pipe through a command