Technical Documentation

Entering and Exiting the JUNOS CLI Configuration Mode

You configure JUNOS Software by entering configuration mode and creating a hierarchy of configuration mode statements.

  • To enter configuration mode, use the configure command.

    When you enter configuration mode, the following configuration mode commands are available:

    entering configuration mode 


    possible completions:
      <[Enter]>            Execute this command
      activate             Remove the inactive tag from a statement
      annotate             Annotate the statement with a comment
      commit               Commit current set of changes
      copy                 Copy a statement
      deactivate           Add the inactive tag to a statement
      delete               Delete a data element
      edit                 Edit a sub-element
      exit                 Exit from this level
      help                 Provide help information
      insert               Insert a new ordered data element
      load                 Load configuration from ASCII file
      quit                 Quit from this level
      rename               Rename a statement
      replace              Replace character string in configuration
      rollback             Roll back to previous committed configuration
      run                  Run an operational-mode command
      save                 Save configuration to ASCII file
      set                  Set a parameter
      show                 Show a parameter
      status               Show users currently editing configuration
      top                  Exit to top level of configuration
      up                   Exit one level of configuration
      wildcard             Wildcard operations

    Users must have configure permission to view and use the configure command. When in configuration mode, a user can view and modify only those statements for which they have access privileges set. For more information, see the JUNOS System Basics Configuration Guide.

  • If you enter configuration mode and another user is also in configuration mode, a message shows the user’s name and what part of the configuration the user is viewing or editing:
    user@host> configure 
    Entering configuration mode
    Users currently editing the configuration:
      root terminal d0 (pid 4137) on since 2008-04-09 23:03:07 PDT, idle 7w6d 08:22
    The configuration has been changed but not committed

    Up to 32 users can be in configuration mode simultaneously, and they all can make changes to the configuration at the same time.

  • To exit configuration mode, use the exit configuration-mode configuration mode command from any level, or use the exit command from the top level. For example:
    [edit protocols ospf area interface so-0/0/0]user@host# exit configuration-mode exiting configuration modeuser@host>
    [edit]user@host# exit exiting configuration modeuser@host>

    If you try to exit from configuration mode using the exit command and the configuration contains changes that have not been committed, you see a message and prompt:

    [edit]user@host# exitThe configuration has been changed but not committedExit with uncommitted changes? [yes,no] (yes) <Enter>Exiting configuration modeuser@host>
  • To exit with uncommitted changes without having to respond to a prompt, use the exit configuration-mode command. This command is useful when you are using scripts to perform remote configuration.
    [edit]user@host# exit configuration-modeThe configuration has been changed but not committedExiting configuration modeuser@host>

Published: 2010-04-27