There are two modes in the MD-CLI:
operational — a user can run all commands to monitor or troubleshoot the router, but the router configuration cannot be changed
configuration — a user can run all commands to monitor or troubleshoot the router. In private, exclusive, or global configuration mode, the router configuration can be changed. In read-only configuration mode, the user can only view the router configuration.
The first line of the user prompt indicates the active configuration mode. For example:
[pr:configure] — indicates a user in private configuration mode (implicit configuration workflow)
(ex) [configure] — indicates a user in exclusive configuration mode (explicit configuration workflow)
At login, an MD-CLI session always starts in operational mode. To configure the router, the user must enter a configuration mode using the explicit or implicit configuration workflow.
The configuration workflow (implicit or explicit) determines if the user is restricted to the configure branch or if the user can navigate freely while in configuration mode. Configuration workflows are detailed in Implicit and Explicit Configuration Workflows.
The configuration mode (private, exclusive, global, or read-only) determines the interaction with other simultaneous configuration sessions. Candidate configuration modes are detailed in Candidate Configuration Modes.
The MD-CLI transactional configuration method is a two-step process in which configuration changes are made in a candidate configuration. When the configuration is committed, the changes are copied to the running configuration and become active.
Figure 1 shows the flow of configuration changes from the candidate configuration to the running configuration.
Other non-router configuration operations, such as changing the MD-CLI session environment are active immediately.
The MD-CLI configuration method differs from the classic CLI in the following ways:
In the classic CLI, changes to the router configuration are immediately activated in the running configuration. A strict configuration order must be maintained or the configuration fails.
In the MD-CLI, the transactional configuration method allows multiple configuration changes to be made in any order in the candidate configuration. The system applies the correct ordering when the configuration is activated with the commit command.
The MD-CLI supports two configuration workflows:
Implicit configuration workflow
Navigation is restricted to the configure branch and its descendants.
Operational commands require an absolute path and error when incomplete.
configure {private | exclusive | global | read-only} enters configuration mode and navigates in the configure branch. There is no default configuration mode.
exit all leaves configuration mode and navigates to the operational root.
Explicit configuration workflow
Navigation is unrestricted while in configuration mode.
Operational commands while in the configure branch require an absolute path and navigate when incomplete.
edit-config {private | exclusive | global | read-only} enters configuration mode without navigating. There is no default configuration mode.
quit-config leaves configuration mode without navigating. The quit-config command is not available in the configure branch.
The following table compares the implicit and explicit configuration workflows.
Implicit Configuration Workflow |
Explicit Configuration Workflow |
|
---|---|---|
Use |
User focused on configuration tasks in the configure branch |
Power user mode with unrestricted navigation capabilities |
Flexibility |
Run operational commands or configuration commands from the configure branch |
Run operational commands or configuration commands anywhere |
configure |
Enters configuration mode1 and navigates to the configure branch |
Navigates to the configure branch (after edit-config command) |
edit-config |
— |
Enters configuration mode1 |
exit all or CTRL-z or / |
Leaves configuration mode and navigates to the operational root |
Navigates to the operational root |
quit-config |
— |
Leaves configuration mode |
Commands that result in an action or display output |
Execute the command |
Execute the command |
Commands that navigate out of the configure branch |
Not allowed |
Navigate |
info and configuration commands in the configure branch |
Allowed |
Allowed |
info and configuration commands out of the configure branch |
Not allowed |
Allowed |
Notes:
Requires specifying the configuration mode (private | exclusive | global | read-only)
In the implicit configuration workflow, navigation while in configuration mode is restricted to the configure branch and its descendants.
The configure{private | exclusive | global | read-only} command places the user session in the specified configuration mode and navigates to the top of the configuration tree (/configure). The first line of the session prompt indicates the configuration mode prepended to the context and separated with a colon.
[/]
A:admin@node-2# configure exclusive
INFO: CLI #2060: Entering exclusive configuration mode
INFO: CLI #2061: Uncommitted changes are discarded on configuration mode exit
[ex:/configure]
A:admin@node-2#
When the MD-CLI session is in operational mode, the configure command only accepts a configuration mode parameter and cannot be followed by a path to navigate nor by a configuration element to edit the router configuration.
[/]
A:admin@node-2# configure exclusive router
^^^^^^
MINOR: CLI #2069: Operation not allowed - currently in operational mode
[/]
A:admin@node-2#
The following navigation commands leave configuration mode if they cause navigation outside the configuration branch.
back, or back with a number greater than the present working context depth
exit, or exit all
CTRL-z
/
}
[ex:/configure router "Base"]
A:admin@node-2# exit all
INFO: CLI #2064: Exiting exclusive configuration mode
[/]
A:admin@node-2#
Commands that do not navigate outside the configure branch or that result in an action or display output are allowed.
[ex:/configure]
A:admin@node-2# /show uptime
System Up Time : 3 days, 00:27:49.35 (hr:min:sec)
[ex:/configure]
A:admin@node-2#
[ex:configure]
A:admin@node-2# /environment more false
[ex:/configure]
A:admin@node-2#
Commands that navigate out of a configure branch are not allowed.
[ex:/configure]
A:admin@node-2# /show router
MINOR: CLI #2069: Operation not allowed - cannot navigate out of configuration region
[ex:/configure]
A:admin@node-2#
[ex:/configure]
A:admin@node-2# /tools dump
MINOR: CLI #2069: Operation not allowed - cannot navigate out of configuration region
[ex:/configure]
A:admin@node-2#
In the explicit configuration workflow, navigation while in configuration mode is unrestricted. Operational and configuration commands can be executed from any context.
The edit-config {private | exclusive | global | read-only} command places the user session in the specified configuration mode. The present working context is not changed. The first line of the session prompt indicates the configuration mode between round brackets.
[/show router]
A:admin@node-2# edit-config exclusive
INFO: CLI #2060: Entering exclusive configuration mode
INFO: CLI #2061: Uncommitted changes are discarded on configuration mode exit
(ex)[/show router]
A:admin@node-2#
When the MD-CLI session is in configuration mode, the configure command can be followed by a path to navigate or by a configuration element to edit the router configuration.
(ex)[/]
A:admin@node-2# show router
(ex)[/show router]
A:admin@node-2# /configure system time zone standard name utc
*(ex)[/show router]
A:admin@node-2# /configure router
*(ex)[/configure router "Base"]
A:admin@node-2#
Commands that result in an action or display output can be executed in the configure branch. Navigation outside the configure branch is allowed and does not exit the configuration mode.
(ex)[/configure router "Base"]
A:admin@node-2# /show uptime
System Up Time : 8 days, 23:16:45.01 (hr:min:sec)
(ex)[/configure router "Base"]
A:admin@node-2# /tools
(ex)[/tools]
A:admin@node-2#
Configuration commands, such as info and commit, can be executed outside the configure branch.
(ex)[/tools]
A:admin@node-2# info
configure {
log {
{
---snip---
(ex)[/tools]
A:admin@node-2# commit
(ex)[/tools]
A:admin@node-2#
The quit-config command exits configuration mode and places the session in operational mode. The quit-config command must be executed from the operational root. The present working context does not change.
(ex)[/tools]
A:admin@node-2# exit all
(ex)[/]
A:admin@node-2# quit-config
INFO: CLI #2064: Exiting exclusive configuration mode
An MD-CLI configuration session can transition from an implicit to an explicit configuration workflow using the edit-config command while in configuration mode.
[/]
A:admin@node-2# configure exclusive
INFO: CLI #2060: Entering exclusive configuration mode
INFO: CLI #2061: Uncommitted changes are discarded on configuration mode exit
[ex:/configure]
A:admin@node-2# /show
MINOR: CLI #2069: Operation not allowed - cannot navigate out of configuration region
[ex:/configure]
A:admin@node-2# edit-config exclusive
(ex)[/configure]
A:admin@node-2# /show
(ex)[/show]
A:admin@node-2#
Transitioning from an explicit to an implicit configuration workflow is not supported.