Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

Navigation

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.

Task

Command/Statement

Example

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.

configure
user@host> configure
[edit]user@host#

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
[edit]user@host# edit security zones security-zone myzone
[edit security zones security-zone myzone]user@host#

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
[edit]user@host# set security zones security-zone myzone
[edit]user@host#
Navigate the Hierarchy

Navigate down to an existing hierarchy level.

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

Navigate up one level in the hierarchy.

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

Navigate to the top of the hierarchy.

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

Commit your configuration.

commit
[edit]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.

rollback
[edit]user@host# rollback
load complete
Exit Configuration Mode

Commit the configuration and exit configuration mode.

commit and-quit
[edit]user@host# commit and-quit
user@host>

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.

exit
[edit]user@host# exit
The configuration has been changed but not committedExit 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 [edit]

Published: 2013-02-21

Published: 2013-02-21