The MD-CLI tree contains the following elements from the Nokia YANG models:
container — an element that contains other elements. In the following example, tcp-keepalive and gnmi are containers.
tcp-keepalive {
admin-state disable
idle-time 600
interval 15
retries 4
}
gnmi {
admin-state enable
auto-config-save false
}
list — a sequence of list entries. In the preceding example, the entire set of interfaces is a list.
group "group-1" {
connect-retry 600
keepalive 33
}
group "group-2" {
description "Text description for group-2"
local-preference 8
}
list entry — an element similar to a container with multiple instances where each list entry is identified by the values of its keys (for example, group ‟group-2”)
router "Base" {
bgp {
group "group-1" {
connect-retry 600
keepalive 33
}
group "group-2" {
description "Text description for group-2"
local-preference 8
}
}
}
key — a unique identifier for a list entry (for example, ‟group-1” and ‟group-2”)
router "Base" {
bgp {
group "group-1" {
connect-retry 600
keepalive 33
}
group "group-2" {
description "Text description for group-2"
local-preference 8
}
}
}
leaf — an element that does not contain any other elements and has a data type (for example, string or integer). A leaf can also be defined with no data type where the leaf takes no parameter value (that is, an empty leaf). The bold elements in the following example are leafs.
tcp-keepalive {
admin-state disable
idle-time 600
interval 15
retries 4
}
gnmi {
admin-state enable
auto-config-save false
}
leaf-list — an element that contains a sequence of values of a particular data type (for example, ‟policy” is a leaf-list in the following example)
policy ["policy-a" "policy-b" "policy-c"]
leaf-list entry — one of the values of a leaf-list. For example, ‟policy-a”, ‟policy-b”, and ‟policy-c” are leaf-list entries in the following example.
policy ["policy-a" "policy-b" "policy-c"]
The following terms are also used:
keyword — an element with a name defined by SR OS; for example, enumerated values, leaf names, and container names)
variable parameter — an element with a name defined by the user; for example, descriptions, names, integer or string leaf values)
immutable element — an element that can only be configured in the transaction in which the parent element is created. It cannot be modified while the parent element exists.
choice element — an element which is part of a set of mutually exclusive elements. Setting a choice element clears all configuration from the other choice elements.
In the following example, admin-state (leaf name), enable (enumerated value), and connect-retry (leaf name) are keywords, and ‟800” is a variable parameter.
*(ex)[/configure router "Base" bgp]
A:admin@node-2# info
admin-state enable
connect-retry 800
Managing the router configuration using the MD-CLI involves accessing and configuring the appropriate elements (containers, lists, leafs, and leaf-lists).
The MD-CLI tree shows the commands and parameters (also known as elements) that are available in a hierarchical output. In the following tree detail command output, the bold elements are containers (or container lists) which contain leafs (or leaf-lists).
*[ex:/configure system]
A:admin@node-2# tree detail
+-- alarms
| +-- admin-state <keyword>
| +-- apply-groups <reference>
| +-- apply-groups-exclude <reference>
| +-- max-cleared <number>
+-- allow-boot-license-violations <boolean>
+-- apply-groups <reference>
+-- apply-groups-exclude <reference>
+-- boot-bad-exec <string>
+-- boot-good-exec <string>
+-- central-frequency-clock
| +-- apply-groups <reference>
| +-- apply-groups-exclude <reference>
| +-- bits
| | +-- input
| | | +-- admin-state <keyword>
| | +-- interface-type <keyword>
| | +-- output
| | | +-- admin-state <keyword>
| | | +-- line-length <keyword>
| | | +-- ql-minimum <keyword>
| | | +-- source <keyword>
| | | +-- squelch <boolean>
| | +-- ql-override <keyword>
| | +-- ssm-bit <number>
| +-- ptp
| | +-- admin-state <keyword>
| | +-- ql-override <keyword>
| +-- ql-minimum <keyword>
| +-- ql-selection <boolean>
| +-- ref-order
| | +-- fifth <keyword>
| | +-- first <keyword>
| | +-- fourth <keyword>
| | +-- second <keyword>
| | +-- third <keyword>
---snip---
The MD-CLI command prompt displays on two lines. The first line contains the following information:
baseline status indicator
This indicator displays an exclamation mark (!) to indicate an out-of-date baseline when in a configuration mode.
uncommitted changes indicator
This indicator displays an asterisk (*) to indicate uncommitted configuration changes when in a configuration mode.
configuration mode reference
When in a configuration mode, a configuration mode reference is displayed:
in round brackets for an explicit configuration workflow
prepended to the context, separated by a colon for an implicit configuration workflow
The configuration mode reference can be one of the following:
ex — exclusive mode
gl — global mode
pr — private mode
ro — read-only mode
context
The present working context is displayed in square brackets ([]) when in operational or configuration mode.
For an explicit configuration workflow, the format of the first line is as follows:
<baseline status indicator > <uncommitted changes indicator> (<configuration mode>) [context]
Examples:
(ro)[/]
(ex)[/configure router "Base" bgp]
For an implicit configuration workflow, the format of the first line is as follows:
<baseline status indicator > <uncommitted changes indicator> [<configuration mode>:context]
Examples:
[ro:/configure]
*[ex:/configure]
The second line contains the following information:
CPM
The active CPM slot can be A or B on 7450 ESS and 7750 SR routers, and A,B,C, or D on 7950 XRS routers.
user
The user is the name of the current user for this session.
name
The name is the system name, as configured with the configure system name command. The system name can change dynamically during the session if it is configured to a different name.
The format of the second line is as follows:
CPM:user@name#
The following examples display the two-line prompt in different modes.
prompt in operational mode
[/]
A:admin@node-2#
prompt in the operational root, with exclusive configuration mode
(ex)[/]
A:admin@node-2#
prompt in operational mode show router bgp
[/show router "Base" bgp]
A:admin@node-2#
prompt in exclusive configuration mode configure router bgp
(ex)[/configure router "Base" bgp]
A:admin@node-2#
prompt in exclusive configuration mode configure router bgp with uncommitted changes
*(ex)[/configure router "Base" bgp]
A:admin@node-2#
implicit configuration workflow prompt for a session in private configuration mode, with present working context of configure router bgp with uncommitted changes in the private candidate datastore, and the baseline datastore out-of-date
!*[pr:/configure router "Base" bgp]
A:admin@node-2#
The environment configuration for the MD-CLI is available in both the classic CLI and in the MD-CLI, but the configuration applies only to MD-CLI sessions.
In the MD-CLI, environment variables are found under the context configure system management-interface cli md-cli:
[gl:/configure system management-interface cli md-cli environment]
A:admin@node-2# ?
command-completion + Enter the command-completion context
console + Enter the console context
message-severity- + Enter the message-severity-level context
level
more - Prompt to continue or stop when output text fills page
progress-indicator + Enter the progress-indicator context
prompt + Enter the prompt context
time-display - Time zone displayed before the prompt
time-format - Time format to display date and time
In the classic CLI, the same variables are found in the same context as follows:
A:node-2>config>system>management-interface>cli>md>env# ?
command-comple* + Configure keystrokes to trigger command completion
console + Configure console parameters
message-severi* + Configure messages severity
[no] more - Configure paging of the output text
progress-indic* + Settings for progress indicator during command
execution
prompt + Configure content of displayed prompt
time-display - Specify whether timestamp should be displayed in UTC or
local time
time-format - Time format to display date and time
Changes made to the environment configuration apply only to new sessions and do not affect current sessions.
See the 7450 ESS, 7750 SR, 7950 XRS, and VSR MD-CLI Command Reference Guide for information about the environment commands in the MD-CLI.
The environment can be customized for all sessions in the configuration under the configure system management-interface cli md-cli environment context, or per session using the environment command. When a new MD-CLI session is started, the per-session environment configuration is copied from the global environment configuration. Changes made to the global environment configuration after the session begins apply only to new sessions and do not affect current sessions. Changes made to the environment parameters for a session apply only for that session.
The per-session environment is accessed by entering environment at the operational root or with /environment from any other mode or context. Changes made in the per-session environment are immediate.
The info command displays the difference between the per-session environment and the configured global environment parameters. Therefore, for a new MD-CLI session, the info command has no output, as the per-session environment is the same as the global environment. The info detail command displays the current values in the global environment for all parameters.
As the default setting of the environment configuration, the uncommitted changes indicator is displayed as part of the command prompt. This setting can be modified per session or it can be changed for all MD-CLI sessions by changing the environment configuration.
The uncommitted-changes-indicator command under the environment prompt context suppresses or displays the change indicator for an MD-CLI session. Environment changes are applied immediately and are lost when the session disconnects.
*[/environment prompt]
A:admin@node-2# uncommitted-changes-indicator false
[/environment prompt]
A:admin@node-2#
[/environment prompt]
A:admin@node-2# uncommitted-changes-indicator true
*[/environment prompt]
A:admin@node-2#
By default, a blank line precedes the command prompt. This setting can be modified for each MD-CLI session.
The newline command under the environment prompt context suppresses or displays a new line before the prompt.
[/]
A:admin@node-2# environment prompt
[/environment prompt]
A:admin@node-2# newline false
[/environment prompt]
A:admin@node-2# newline true
[/environment prompt]
A:admin@node-2#
By default, the context is displayed in the command prompt. This setting can be modified for each MD-CLI session.
The context command under the environment prompt context suppresses or displays the current context.
[/environment prompt]
A:admin@node-2# context false
[]
A:admin@node-2# context true
[/environment prompt]
A:admin@node-2#
By default, the timestamp is not displayed before the command prompt. This setting can be modified for each MD-CLI session.
The timestamp command under the environment prompt context suppresses or displays the timestamp.
[/environment prompt]
A:admin@node-2# timestamp true
Tue, 16 Feb 2021 16:37:26 UTC
[/environment prompt]
A:admin@node-2# timestamp false
[/environment prompt]
A:admin@node-2#
The environment time-display command configures the time zone display to UTC or local time (as configured in configure system time).
[/environment]
A:admin@node-2# time-display ?
time-display <keyword>
<keyword> - (local|utc)
Default - local
Time zone displayed before the prompt
The environment time-format command specifies the format for the time display.
[/environment]
A:admin@node-2# time-format ?
time-format <keyword>
<keyword> - (iso-8601|rfc-1123|rfc-3339)
Default - rfc-3339
Time format to display date and time
The following shows the time in the format as defined by ISO 8601:
[/state cpm "a" hardware-data]
A:admin@node-2# software-last-boot-time
software-last-boot-time "2020-09-01 23:27:17 UTC"
The following shows the time in the format as defined by RFC 1123:
[/state cpm "a" hardware-data]
A:admin@node-2# software-last-boot-time
software-last-boot-time "Tue, 01 Sep 2020 23:27:17 UTC"
The following shows the time in the format as defined by RFC 3339:
[/state cpm "a" hardware-data]
A:admin@node-2# software-last-boot-time
software-last-boot-time 2020-09-01T23:27:17.0+00:00
The progress indicator appears on the line immediately following the command and disappears when the MD-CLI command completes or when output is available to display. The indicator is a display of dynamically changing dots.
(ex)[/configure]
A:admin@node-2# compare
... # progress indicator displays here as dots
The delay interval can be configured with the delay command or the indicator can be disabled with the admin-state disable command under the environment progress-indicator context. For example, the user can disable the progress indicator for logged sessions.
[/environment progress-indicator]
A:admin@node-2# ?
admin-state - Administrative state of the progress indicator
delay - Delay before progress indicator is displayed
type - Progress indicator output style
The environment more command enables pagination when configured to true and disables pagination when configured to false. With pagination enabled, the display output can be paused and continued, based on the ‟Press Q to quit, Enter to print next line or any other key to print next page” message at the bottom of the screen.
[/]
A:admin@node-2# environment more true
[/]
A:admin@node-2# show system security management
===============================================================================
Server Global
===============================================================================
Telnet:
Administrative State : Enabled
Operational State : Up
Telnet6:
Administrative State : Disabled
Operational State : Down
FTP:
Administrative State : Disabled
Operational State : Down
SSH:
Administrative State : Enabled
Operational State : Up
NETCONF:
Administrative State : Disabled
Operational State : Down
GRPC:
Administrative State : Disabled
Operational State : Down
Press Q to quit, Enter to print next line or any other key to print next page.
The pagination setting can be overridden by using | no-more for a single command. As with pagination disabled, the output is displayed completely without any prompts to continue.
[/]
A:admin@node-2# show system security management | no-more
The default size for a console window is 24 lines long by 80 characters wide. The environment console command can be used to change these settings.
(ex)[/environment]
A:admin@node-2# console ?
console
length - Number of lines displayed on the screen
width - Number of columns displayed on the screen
The INFO: CLI messages are displayed by default. The environment message-security-level command suppresses the INFO messages by changing the setting to warning.
[/environment message-severity-level]
A:admin@node-2# cli ?
cli <keyword>
<keyword> - (warning|info)
Default - info
Message severity threshold for CLI messages
Following are examples of INFO: CLI messages that are suppressed when the setting is changed to warning.
INFO: CLI #2051: Switching to the classic CLI engine
INFO: CLI #2052: Switching to the MD-CLI engine
INFO: CLI #2054: Entering global configuration mode
INFO: CLI #2056: Exiting global configuration mode
INFO: CLI #2055: Uncommitted changes are present in the candidate configuration
INFO: CLI #2057: Uncommitted changes are kept in the candidate configuration
The environment datastore is subject to AAA command authorization. A user can be prevented from modifying the global environment settings or the per-session environment settings, or both.
In the following configuration output, entry 113 blocks user ‟tstuser” from modifying the global environment settings. In addition, entry 114 prevents the user from changing the per-session environment settings.
(ro)[/configure system security aaa local-profiles profile "tstuser"]
A:admin@node-2# info
default-action permit-all
entry 113 {
action deny
match "configure system management-interface cli md-cli environment"
}
entry 114 {
action deny
match "environment"
}
(ex)[/configure system management-interface cli md-cli environment]
A:tstuser@node-2# prompt timestamp
MINOR: MGMT_CORE #2020: Permission denied
(ex)[configure system management-interface cli md-cli environment]
A:tstuser@node-2# /environment
MINOR: MGMT_CORE #2020: Permission denied
(ex)[/configure system management-interface cli md-cli environment]
A:tstuser@node-2#
A short help description is displayed immediately when the question mark (?) is entered (without needing to press Enter). The following displays help from the operational root level.
[/]
A:admin@node-2# ?
admin + Enter the administrative context for system operations
bof + Enter the bof context
clear + Clear statistics or reset operational state
configure + Enter the configuration context
environment + Enter the environment configuration context
file + Perform file operations
li + Enter the lawful intercept context
password - Change the local user password
show + Show operational information
state + Show state information
tools + Enter the tools context for troubleshooting and
debugging
Global commands:
back - Move back one or more levels
delete - Delete an element
edit-config - Enter a candidate configuration mode
enable - Enable administrative mode
exec - Execute commands from a file
exit - Return to the previous context or to operational root
history - Show the command history
logout - Exit the CLI session
oam - Perform OAM tests
ping - Ping an IP address or DNS name
pwc - Show the present working context
ssh - SSH to an IP address or DNS name
telnet - Telnet to an IP address or DNS name
top - Move to the top level of the context
traceroute - Show the route taken to an IP address or DNS name
tree - Show the command tree under the present working context
Configuration commands:
info - Show the information under the present working context
The ? help is context-sensitive. The following ? help output lists additional commands available in exclusive configuration mode.
(ex)[/]
A:admin@node-2# ?
admin + Enter the administrative context for system operations
clear + Clear statistics or reset operational state
configure + Enter the configuration context
environment + Enter the environment configuration context
file + Perform file operations
password - Change the local user password
show + Show operational information
state + Show state information
tools + Enter the tools context for troubleshooting and
debugging
Global commands:
back - Move back one or more levels
delete - Delete an element
edit-config - Enter a candidate configuration mode
enable - Enable administrative mode
exec - Execute commands from a file
exit - Return to the previous context or to operational root
history - Show the command history
insert - Insert an element into a user-ordered list
logout - Exit the CLI session
oam - Perform OAM tests
ping - Ping an IP address or DNS name
pwc - Show the present working context
quit-config - Exit the candidate configuration mode
ssh - SSH to an IP address or DNS name
telnet - Telnet to an IP address or DNS name
top - Move to the top level of the context
traceroute - Show the route taken to an IP address or DNS name
tree - Show the command tree under the present working context
Configuration commands:
commit - Commit the candidate configuration
compare - Compare changes between datastores
copy - Copy a configuration element to another
discard - Discard changes in the candidate datastore
info - Show the information under the present working context
rename - Rename a list element
update - Update the candidate baseline
validate - Validate changes in the candidate datastore
The help results may depend on the cursor position. The following example shows the router command syntax, followed by available commands after entering the router context.
[ex:/configure]
A:admin@node-2# router?
router [[router-name] <string>]
[router-name] - Administrative router name
aggregates + Enter the aggregates context
allow-icmp-redirect - Allow ICMP redirects on the management interface
allow-icmp6-redirect - Allow IPv6 ICMP redirects on the management interface
apply-groups - Apply a configuration group at this level
apply-groups-exclude - Exclude a configuration group at this level
autonomous-system - AS number advertised to peers for this router
bfd + Enter the bfd context
bgp + Enable the bgp context
bier + Enable the bier context
class-forwarding - Allow class-based forwarding over IGP shortcuts
confederation + Enter the confederation context
description - Text description
dhcp-server + Enter the dhcp-server context
dns + Enter the dns context
ecmp - Maximum equal-cost routes for routing table instance
---snip---
In the following ? output, similar information is shown, with more details provided for configuring the router command, including the allowable string length and default value for the command.
[ex:/configure]
A:admin@node-2# router ?
router [[router-name] <string>]
[[router-name] <string>]
<string> - <1..64 characters>
Default - "Base"
Administrative router name
aggregates + Enter the aggregates context
allow-icmp-redirect - Allow ICMP redirects on the management interface
allow-icmp6-redirect - Allow IPv6 ICMP redirects on the management interface
apply-groups - Apply a configuration group at this level
apply-groups-exclude - Exclude a configuration group at this level
autonomous-system - AS number advertised to peers for this router
bfd + Enter the bfd context
bgp + Enable the bgp context
bier + Enable the bier context
class-forwarding - Allow class-based forwarding over IGP shortcuts
confederation + Enter the confederation context
description - Text description
dhcp-server + Enter the dhcp-server context
dns + Enter the dns context
ecmp - Maximum equal-cost routes for routing table instance
---snip---
Symbol |
Description |
---|---|
+ |
Indicates a container or list |
- |
Indicates a leaf, a leaf-list, a list or container with no leafs, or a global command (if in the operational root) |
^ |
Indicates a mandatory element (an element that must be configured before the configuration is considered valid) |
: |
Indicates the first element of a group of choice elements that are mutually exclusive |
In the following help display example, the containers are eth-cfm, domain, and association. The leafs are apply-groups, apply-groups-exclude, dns, format, level, mac, md-index, and name, while level is also a mandatory element.
[ex:/configure]
A:admin@node-2# eth-cfm ?
eth-cfm
apply-groups - Apply a configuration group at this level
apply-groups-exclude - Exclude a configuration group at this level
domain + Enter the domain list instance
[ex:/configure eth-cfm]
A:admin@node-2# domain ?
[md-admin-name] <string>
<string> - <1..64 characters>
Unique domain name
[ex:/configure eth-cfm]
A:admin@node-2# domain dom-name ?
domain
Immutable fields - level, dns, mac, name, format, md-index
apply-groups - Apply a configuration group at this level
apply-groups-exclude - Exclude a configuration group at this level
association + Enter the association list instance
level ^ Maintenance Domain Level (MD Level)
md-index - The index of the Maintenance Domain (MD)
Mandatory choice: md-name
dns :- Domain name like text string derived from a DNS name
format :- Maintenance domain name not to be provided
mac :- Maintenance domain MAC name
name :- Maintenance domain name as an ASCII string
When online help is entered for a leaf or leaf-list, a short description of the element is displayed after the element type. The valid input values for the element are also listed, as shown in the following examples.
The description string for the VPRN service can have a length of 1 to 80 characters:
*[ex:/configure service vprn "5"]
A:admin@node-2# description ?
description <string>
<string> - <1..80 characters>
Text description
The ? help for the autonomous-system parameter lists the valid number range, followed by a short description of the parameter:
*[ex:/configure service vprn "5"]
A:admin@node-2# autonomous-system ?
autonomous-system <number>
<number> - <1..4294967295>
AS number advertised to peers for this router
A parameter value may have a unit type associated with it, as shown in the following example of the ingress-buffer-allocation parameter:
*[ex:/configure qos sap-ingress "sap-pname" policer 6]
A:admin@node-2# mbs ?
mbs (<number> | <keyword>)
<number> - <0..16777216> - bytes
<keyword> - auto - bytes
Default - auto
High priority violate threshold of PIR leaky bucket
This example shows a parameter that is a reference to another parameter. The owner command refers to the script policy name that is configured through the configure system script-control script-policy context. The name is a string of 1 to 32 characters.
*[ex:/configure log event-handling handler "h-name" entry 5]
A:admin@node-2# script-policy owner ?
owner <reference>
<reference> - <1..32 - configure system script-control script-
characters> policy <owner>
Script policy owner
An immutable element can only be configured in the transaction in which the parent element is created. It cannot be modified while the parent element exists. Any modification to an immutable element in model-driven interfaces causes SR OS to automatically delete the parent element and recreate it with the new value for the immutable element.
Immutable elements are identified in the online help, as seen in the following examples:
[ex:/configure eth-cfm]
A:admin@node-2# domain dom-name ?
domain
Immutable fields - level, dns, mac, name, format, md-index
apply-groups - Apply a configuration group at this level
apply-groups-exclude - Exclude a configuration group at this level
association + Enter the association list instance
level ^ Maintenance Domain Level (MD Level)
md-index - The index of the Maintenance Domain (MD)
Mandatory choice: md-name
dns :- Domain name like text string derived from a DNS name
format :- Maintenance domain name not to be provided
mac :- Maintenance domain MAC name
name :- Maintenance domain name as an ASCII string
(ex)[/configure eth-cfm]
A:admin@node-2# domain dom-name level ?
level <number>
<number> - <0..7>
'level' is: mandatory, immutable
Maintenance Domain Level (MD Level)
Warning: Modifying this element recreates
'configure eth-cfm domain "dom-name"' automatically for the new value to
take effect.
Immutable elements also exist in the classic CLI. They are parameters that are on the command line with the create keyword. For example, in the following classic CLI command, all the parameters shown on the command line are immutable. These parameters cannot be changed without deleting and recreating the service.
[/]
A:admin@node-2# //
INFO: CLI #2051: Switching to the classic CLI engine
A:node-2# configure service ies ?
- ies <service-id> [customer <customer-id>] [create] [vpn <vpn-id>] [name
<name>]
- no ies <service-id>
Elements that are part of a choice are listed in a separate section in the online help. Mandatory choices are listed first. Each choice contains a set of mutually exclusive elements or groups of elements. The first element of a group is indicated with a colon (:).
The following example shows a set of two mutually exclusive choice elements for an ingress queue rate. If configuring one of the choice elements, either the cir and fir values can be configured or the police value.
*[ex:/configure qos sap-ingress "ing-1" queue 1 rate]
A:admin@node-2# ?
pir - Administrative PIR
Choice: rate-cir-fir-or-police
cir :- Administrative CIR
fir - Administrative FIR
police :- Drop the traffic feeding into queue above the PIR rate
The following help display is an example of optional indicators.
The square brackets ([]) around slot-number indicate that the slot-number keyword is optional when entering the command.
[ex:/configure]
A:admin@node-2# card ?
[slot-number] <number>
<number> - <1..20>
IOM slot within a chassis
The card context can be entered as:
[ex:/configure]
A:admin@node-2# card slot-number 5
or
[ex:/configure]
A:admin@node-2# card 5
Angle brackets (<>) indicate a variable name and the vertical bar (|) indicates a choice. For the sub-group command, a number in the range of 1 to 8 can be entered, or one of the keywords auto-iom or auto-mda.
*(ex)[/configure lag 8 port 1/1/1]
A:admin@node-2# sub-group ?
sub-group (<number> | <keyword>)
<number> - <1..8>
<keyword> - (auto-iom|auto-mda)
Default - 1
'sub-group' is: immutable
Subgroup of the port in the LAG
Warning: Modifying this element recreates 'configure lag 8 port 1/1/1'
automatically for the new value to take effect.
Command |
Description |
---|---|
admin |
Enter the administrative context for system operations |
clear |
Clear statistics or reset operational state |
configure |
Enter the configuration context |
environment |
Enter the environment configuration context |
li |
Enter the lawful intercept configuration context |
show |
Show operational information |
state |
Show state information |
tools |
Enter the tools context for troubleshooting and debugging |
The global commands are available from various levels of the MD-CLI hierarchy.
Command |
Description |
---|---|
back |
Move back one or more levels |
delete |
Delete an element |
edit-config |
Enter a candidate configuration mode |
enable |
Enable administrative mode |
exec |
Execute commands from a file |
exit |
Return to the previous context or to operational root |
history |
Show the command history |
insert |
Insert an element into a user-ordered list |
logout |
Exit the CLI session |
oam |
Perform OAM tests. See Using the oam Commands. |
ping |
Ping an IP address or DNS name. See Using the ping Command. |
pwc |
Show the present working context. See pwc under Navigating the MD-CLI Hierarchy Levels. |
quit-config |
Exit the candidate configuration mode |
ssh |
SSH to an IP address or DNS name. See Using the ssh Command. |
telnet |
Telnet to an IP address or DNS name. See Using the telnet Command. |
top |
Move to the top level of the context |
traceroute |
Show the route taken to an IP address or DNS name. See Using the traceroute Command. |
tree |
Show the command tree under the present working context |
Configuration commands are availabe within a configuration mode. However, some commands are not visible within specific configuration modes, For example, the commit command is not available in read-only configuration mode.
Command |
Description |
---|---|
commit |
Commit the candidate configuration |
compare |
Compare changes between datastores |
discard |
Discard changes in the candidate datastore |
info |
Show the information under the present working context |
load |
Load contents from a local or remote file |
rollback |
Rollback to a previous configuration |
update |
Update the candidate baseline |
validate |
Validate changes in the candidate datastore |
The following oam commands are available in the MD-CLI.
The following commands issue Ethernet in the First Mile (EFM) OAM loopback tests on the specified port.
oam efm local-loopback {start | stop} port-id {ethernet-satellite-client-port | connector-port | port | pxc-sub-port}
oam efm remote-loopback {start | stop} port-id {ethernet-satellite-client-port | connector-port | port | pxc-sub-port}
EFM Parameter |
Description |
---|---|
local-loopback {start | stop} port-id {ethernet-satellite-client-port | connector-port | port | pxc-sub-port} |
Start or stop the local loopback test on the specified port |
remote-loopback {start | stop} port-id {ethernet-satellite-client-port | connector-port | port | pxc-sub-port} |
Start or stop the remote loopback test on the specified port |
The following command issues an Ethernet Connectivity Fault Management (ETH-CFM) test. The implementation supports a single ETH-TST PDU to check unidirectional reachability launched from a source Maintenance Association End Point (MEP) and terminated on the remote MEP with no response PDU toward the source.
oam eth-cfm eth-test [destination]{mac-address | number} mep-id number md-admin-name reference ma-admin-name reference [data-length number] [priority number]
The following command issues a linktrace test.
oam eth-cfm linktrace [destination]{mac-address | number} mep-id number md-admin-name reference ma-admin-name reference [ttl number]
The following command issues a loopback test.
oam eth-cfm loopback [destination]{mac-address | multicast | number} mep-id number md-admin-name reference ma-admin-name reference [interval number] [lbm-padding number] [priority number] [send-count number] [size number] [timeout number]
The following command issues an Ethernet CFM one-way delay test.
oam eth-cfm one-way-delay-test [destination]{mac-address | number} mep-id number md-admin-name reference ma-admin-name reference [priority number]
The following command issues an Ethernet CFM two-way delay test.
oam eth-cfm two-way-delay-test [destination]{mac-address | number} mep-id number md-admin-name reference ma-admin-name reference [priority number]
The following command issues an Ethernet CFM two-way SLM test in SAA.
oam eth-cfm two-way-slm-test [destination]{mac-address | number} mep-id number md-admin-name reference ma-admin-name reference [interval number][priority number] [send-count number] [size number] [timeout number]
ETH-CFM Parameter |
Description |
---|---|
[destination] mac-address | number |
Unicast destination MAC address or the remote MEP ID of the peer within the association. For an ETH-CFM loopback test, the MAC address can be a multicast MAC address. |
multicast |
Build the class 1 destination multicast address based on the level of the local MEP. The last nibble of the multicast address must match the level of the local MEP or the command fails and the test is not instantiated. |
mep-id number |
Local MEP ID |
md-admin-name reference |
Referenced domain name |
ma-admin-name reference |
Referenced association name |
data-length number |
Size of the padding to be added to the frame |
interval number |
Time between probes within the test run |
lbm-padding number |
Size of the data portion of the data TLV which does not allow for an optional octet string. MSDU is not processed with this option. The lbm-padding and size options are mutually exclusive. |
priority number |
Priority of the frame, which can be manipulated by QoS policies |
send-count number |
Number of messages to send |
size number |
Size of the data portion of the data TLV allowing for an optional octet string to be specified. The size and lbm-padding options are mutually exclusive. |
timeout number |
Time that the router waits for a message reply after sending a message request. Upon expiration of the timeout, the router assumes that the message response is not received. Any response received after the timeout is silently discarded. |
ttl number |
Time to Live for a returned linktrace |
The following command issues an on-demand OAM Performance Monitoring (OAM-PM) test.
oam oam-pm action {start | stop} session reference test-type {dm | dmm | lmm | slm | twamp-light}
OAM-PM Parameter |
Description |
---|---|
action {start | stop} |
Start or stop an OAM-PM test |
session reference |
Referenced OAM-PM session name |
test-type {dm | dmm | lmm | slm | twamp-light } |
Test type
|
Use the ping command in the MD-CLI to verify the reachability of a host. The syntax is as follows:
ping [destination] {ip-address | string } [bypass-routing] [count number] [do-not-fragment] [fc keyword] [interface string] [interval {number | decimal-number}] [next-hop-address {ipv4-address | ipv6-address}] [output-format keyword] [pattern {keyword | number}] [router-instance string] [size number] [source-address {ipv4-address | ipv6-address}] [subscriber string] [timeout number] [tos number] [ttl number]
Example command output:
[/]
A:admin@node-2# ping 10.251.72.68
PING 10.251.72.68 56 data bytes
64 bytes from 10.251.72.68: icmp_seq=1 ttl=64 time=1.79ms.
64 bytes from 10.251.72.68: icmp_seq=2 ttl=64 time=1.07ms.
64 bytes from 10.251.72.68: icmp_seq=3 ttl=64 time=1.19ms.
64 bytes from 10.251.72.68: icmp_seq=4 ttl=64 time=1.26ms.
64 bytes from 10.251.72.68: icmp_seq=5 ttl=64 time=1.16ms.
---- 10.251.72.68 PING Statistics ----
5 packets transmitted, 5 packets received, 0.00% packet loss
round-trip min = 1.07ms, avg = 1.29ms, max = 1.79ms, stddev = 0.254ms
[/]
A:admin@node-2# ping 10.251.72.68 output-format summary
PING 10.251.72.68 56 data bytes !!!!!
---- 10.251.72.68 PING Statistics ----
5 packets transmitted, 5 packets received, 0.00% packet loss
round-trip min = 0.842ms, avg = 1.02ms, max = 1.34ms, stddev = 0.172ms
ping Parameter |
Description |
---|---|
[destination] {ip-address | string} |
IP address or DNS name of the remote host to ping, where the IP address can be one of:
|
bypass-routing |
Bypass the routing table when sending the ping request to a host on a directly-attached network; return an error if the host is not on a directly-attached network The following routing options are part of a choice: bypass-routing, interface, next-hop-address, and subscriber. |
count number |
Number of ping requests to send to the remote host |
do-not-fragment |
Do not fragment the request frame, which is particularly useful in combination with the size parameter for maximum MTU determination (does not apply to ICMPv6) |
fc keyword |
Forwarding class options for the transmitted ICMP Echo Request packet:
|
interface string |
Interface name The following routing options are part of a choice: bypass-routing, interface, next-hop-address, and subscriber. |
interval {number | decimal-number} |
Time between consecutive ping requests |
next-hop-address {ipv4-address | ipv6-address} |
Disregard the routing table and send the packet to the specified next hop address, which must be on an adjacent router attached to a common subnet The following routing options are part of a choice: bypass-routing, interface, next-hop-address, and subscriber. |
output-format keyword |
Keyword options are:
|
pattern {keyword | number} |
16-bit pattern string to include in the packet (expressed as a decimal integer) or a system-generated sequential pattern (using the keyword sequential) |
router-instance string |
Router or VPRN service name |
size number |
Size of request packets, including the ICMP header data (8 bytes) and the ICMP payload of the ICMP Echo Request packets |
source-address {ipv4-address | ipv6-address} |
Source IP address used in the ICMP Echo Request packets |
subscriber string |
Subscriber ID used when sending ICMP Echo Request packets The following routing options are part of a choice: bypass-routing, interface, next-hop-address, and subscriber. |
timeout number |
Time to wait for reply packet. The timer is started when the last ICMP Echo Request is sent. |
tos number |
Type-of-Service (ToS) bits in the IP header of the ICMP Echo Request packets |
ttl number |
Time To Live (TTL) value included in the ICMP Echo Request packets |
Use the ssh command in the MD-CLI to establish a secure shell (SSH) connection to a host. The syntax is as follows:
ssh [destination] {ip-address | string} [login-name string][router-instance string] [version number] [key-re-exchange [mbytes {number | infinite}] [minutes {number | infinite}]]
Example command output:
[/]
A:admin@node-2# ssh 192.168.236.94
admin@192.168.236.94's password: *****
[/]
A:admin@node-3# logout
Connection to 192.168.236.94 closed.
[/]
A:admin@node-2#
ssh Parameter |
Description |
---|---|
[destination] {ip-address | string} |
IP address or DNS name of the remote host to ping, where the IP address can be one of:
|
login-name string |
Login username |
router-instance string |
Router or VPRN service name |
version keyword |
SSH protocol version to be supported by the SSH server
|
key-re-exchange mbytes {number | infinite} |
Number of megabytes on an SSH session, after which the SSH client initiates the key re-exchange |
key-re-exchange minutes {number | infinite} |
Time interval after which the SSH client initiates the key re-exchange |
Use the telnet command in the MD-CLI to establish an insecure connection to a host via the Telnet protocol. The syntax is as follows:
telnet [destination] {ip-address | string} [port number] [router-instance string]
Example command output:
[/]
A:admin@node-2# telnet 192.168.236.94
Trying 192.168.236.94 ...
Login: admin
Password: *****
[/]
A:admin@node-3# logout
Connection closed by foreign host.
[/]
A:admin@node-2#
telnet Parameter |
Description |
---|---|
[destination] {ip-address | string} |
IP address or DNS name of the remote host to ping, where the IP address can be one of:
|
port number |
Remote host TCP port number |
router-instance string |
Router or VPRN service name |
Use the traceroute command in the MD-CLI to display the route that packets take to a specified host.
traceroute [destination] {ipv4-address | ipv6-address | string } [detail] [numeric] [router-instance string] [source-address [ipv4-address | ipv6-address] [tos number] [ttl number] [wait number]
Example command output:
[/]
A:admin@node-2# traceroute 10.251.72.68
traceroute to 10.251.72.68, 30 hops max, 40 byte packets
1 10.251.72.1 (10.251.72.1) 1.64 ms 1.71 ms 1.49 ms
2 10.251.72.68 (10.251.72.68) 1.21 ms 1.23 ms 1.12 ms
traceroute Parameter |
Description |
---|---|
[destination] {ip-address | string} |
Destination IP address or DNS name, where the IP address can be one of:
|
detail |
Display the MPLS label stack information (if available) |
numeric |
Avoid looking up DNS names when displaying results |
router-instance string |
Router or VPRN service name |
source-address {ipv4-address | ipv6-address} |
Source address of the probe packets; return an error If the IP address is not one of the device’s interfaces |
tos number |
ToS bits in the IP header of the probe packets |
ttl number |
TTL value included in the traceroute request |
wait number |
Time to wait for a response to a probe |
The following commands can be used to navigate the MD-CLI hierarchy (context) levels:
pwc
The pwc command displays the present working context with all keyword and variable parameters. The syntax is as follows:
pwc [[path-type] {model-path | xpath| cli-path}] [previous]
(ex)[/]
A:admin@node-2# configure
(ex)[/configure]
A:admin@node-2# card 1
(ex)[/configure card 1]
A:admin@node-2# mda 2
*(ex)[/configure card 1 mda 2]
A:admin@node-2# network
*(ex)[/configure card 1 mda 2 network]
A:admin@node-2# pwc
Present Working Context:
configure
card 1
mda 2
network
pwc previous
The pwc previous command displays the previous working context.
*(ex)[/configure card 1 mda 2 network]
A:admin@node-2# pwc previous
Previous Working Context:
configure
card 1
mda 2
pwc path-type
model-path: a YANG-modeled path format that can be used with RESTCONF-based management systems
xpath: a format that can be used with streaming telemetry
cli-path: a single-line version of the MD-CLI command line interface path format; useful for cutting and pasting the path into an MD-CLI command which supports the CLI path as an unnamed parameter input.
*(ex)[/configure card 1 mda 2 network]
A:admin@node-2# pwc model-path
Present Working Context:
/nokia-conf:configure/card=1/mda=2/network
*(ex)[/configure card 1 mda 2 network]
A:admin@node-2# pwc xpath
Present Working Context:
/configure/card[slot-number=1]/mda[mda-slot=2]/network
[ex:/configure router "Base" bgp group "mesh"]
A:admin@node-2# pwc cli-path
Present Working Context:
/configure router "Base" bgp group "mesh"
back
The back command can be used to go back one or more levels. If no parameter value is specified for the number of levels to go back, the default is one level. Using back at the top of the current command tree moves the context to the operational root level. If the number of levels specified is greater than the current depth, the context moves to the operational root. A closing brace (}) can also be used to go back one level.
*(ex)[/configure card 1 mda 2 network]
A:admin@node-2# back
*(ex)[/configure card 1 mda 2]
A:admin@node-2# back 2
*(ex)[/configure]
A:admin@node-2# back 5
*(ex)[/]
A:admin@node-2#
top
The top command moves the context to the top of the current command tree without exiting the mode. Use the top command instead of issuing the back command multiple times to move the context to the top of the command tree.
*(ex)[/]
A:admin@node-2# configure
*(ex)[/configure]
A:admin@node-2# card 1
*(ex)[/configure card 1]
A:admin@node-2# mda 2
*(ex)[/configure card 1 mda 2]
A:admin@node-2# network
*(ex)[/configure card 1 mda 2 network]
A:admin@node-2# top
*(ex)[/configure]
A:admin@node-2#
exit
The exit command moves the context to the previous context in the current command tree. If the previous context was up one level, the exit command functions similarly to the back command. Using exit all moves the context to the operational root. A slash (/) or Ctrl-z can also be used instead of exit all. Using exit at the operational root has no effect. To log out of the system, the logout command must be used.
*(ex)[/]
A:admin@node-2#
*(ex)[/]
A:admin@node-2# configure card 1 mda 2
*(ex)[/configure card 1 mda 2]
A:admin@node-2# atm
*(ex)[/configure card 1 mda 2 network]
A:admin@node-2# exit all
*(ex)[/]
A:admin@node-2# configure card 1 mda 2 network
*(ex)[/configure card 1 mda 2 network]
A:admin@node-2# /
*(ex)[/]
A:admin@node-2#
The tree command displays the command tree under the present working context, excluding the present working context element. Hierarchy is indicated with a pipe (|), and a "+-- " separator precedes each element. The tree output is in alphabetical order of elements.
[ex:/configure system security aaa remote-servers]
A:admin@node-2# tree
+-- apply-groups
+-- apply-groups-exclude
+-- ldap
| +-- admin-state
| +-- apply-groups
| +-- apply-groups-exclude
| +-- public-key-authentication
| +-- server
| | +-- address
| | | +-- apply-groups
| | | +-- apply-groups-exclude
| | | +-- port
| | +-- admin-state
| | +-- apply-groups
| | +-- apply-groups-exclude
| | +-- bind-authentication
| | | +-- password
| | | +-- root-dn
| | +-- search
| | | +-- base-dn
| | +-- server-name
| | +-- tls-profile
| +-- server-retry
| +-- server-timeout
| +-- use-default-template
+-- radius
| +-- access-algorithm
| +-- accounting
| +-- accounting-port
| +-- admin-state
| +-- apply-groups
| +-- apply-groups-exclude
| +-- authorization
| +-- interactive-authentication
| +-- port
| +-- server
| | +-- address
| | +-- apply-groups
| | +-- apply-groups-exclude
| | +-- secret
| +-- server-retry
| +-- server-timeout
| +-- use-default-template
+-- tacplus
+-- accounting
| +-- record-type
+-- admin-control
| +-- tacplus-map-to-priv-lvl
+-- admin-state
+-- apply-groups
+-- apply-groups-exclude
+-- authorization
| +-- use-priv-lvl
+-- interactive-authentication
+-- priv-lvl-map
| +-- apply-groups
| +-- apply-groups-exclude
| +-- priv-lvl
| +-- apply-groups
| +-- apply-groups-exclude
| +-- user-profile-name
+-- server
| +-- address
| +-- apply-groups
| +-- apply-groups-exclude
| +-- port
| +-- secret
+-- server-timeout
+-- use-default-template
[/]
A:admin@node-2# tree
+-- admin
| +-- clear
| | +-- security
| | +-- lockout
| | | +-- all
| | | +-- user
| | +-- password-history
| | +-- all
| | +-- user
| +-- disconnect
| | +-- address
| | +-- session-id
| | +-- session-type
| | +-- username
| +-- nat
| | +-- save-deterministic-script
| +-- reboot
| | +-- now
| +-- redundancy
| | +-- force-switchover
| | | +-- now
| | +-- synchronize
| | +-- boot-environment
| | +-- configuration
| +-- save
| | +-- bof
| | +-- configure
| | +-- li
| +-- set
---snip---
The flat option displays the command hierarchy under the present working context on one line, excluding the present working context element.
[/]
A:admin@node-2# tree flat
admin
admin clear
admin clear security
admin clear security lockout
admin clear security lockout all
admin clear security lockout user
admin clear security password-history
admin clear security password-history all
admin clear security password-history user
admin disconnect
admin disconnect address
admin disconnect session-id
admin disconnect session-type
admin disconnect username
admin nat
admin nat save-deterministic-script
admin reboot
admin reboot now
admin redundancy
admin redundancy force-switchover
admin redundancy force-switchover now
admin redundancy synchronize
admin redundancy synchronize boot-environment
admin redundancy synchronize configuration
admin save
---snip---
The detail option displays all key and field values in the output on every line.
[/]
A:admin@node-2# tree detail
+-- admin
| +-- clear
| | +-- security
| | +-- lockout
| | | +-- all
| | | +-- user <string>
| | +-- password-history
| | +-- all
| | +-- user <string>
| +-- disconnect
| | +-- address <ipv4-address | ipv6-address>
| | +-- session-id <number>
| | +-- session-type <keyword>
| | +-- username <string>
| +-- nat
| | +-- save-deterministic-script
| +-- reboot
| | +-- <keyword>
| | +-- now
The flat and detail options can be combined in any order.
[/]
A:admin@node-2# tree flat detail
admin
admin clear
admin clear security
admin clear security lockout
admin clear security lockout all
admin clear security lockout user <string>
admin clear security password-history
admin clear security password-history all
admin clear security password-history user <string>
admin disconnect
admin disconnect address <ipv4-address | ipv6-address>
admin disconnect session-id <number>
admin disconnect session-type <keyword>
admin disconnect username <string>
admin nat
admin nat save-deterministic-script
admin reboot
admin reboot <keyword>
admin reboot now
admin redundancy
admin redundancy force-switchover
admin redundancy force-switchover now
---snip---
Command |
Description |
---|---|
/ (Slash) |
Return to the operational root (equivalent to exit all) if used without parameters. Navigate into context or set the value and remain in current context if used at the beginning of a line (equivalent to exit all, and then the command) |
} (Closing brace) |
Go back one level |
CTRL-z |
Return to operational root. If using CTRL-z after a command, return to the operational root after executing the command (equivalent to pressing ENTER after the command and exit all after the command has executed). |
CTRL-c |
Stop the current command |
CTRL-d |
Delete the current character |
CTRL-w |
Delete the word up to the cursor |
CTRL-h |
Delete the current character and move the cursor left |
CTRL-u |
Delete text up to the cursor and preserve the character under the cursor |
CTRL-k |
Delete the text after the cursor, without preserving the character under the cursor |
CTRL-a (or Home) |
Move to the beginning of the line |
CTRL-e (or End) |
Move to the end of the line |
CTRL-p (or up arrow key) |
Display prior command from history |
CTRL-n (or down arrow key) |
Display next command from history |
CTRL-b (or left arrow key) |
Move the cursor one space to the left |
CTRL-f (or right arrow key) |
Move the cursor one space to the right |
CTRL-i |
Enter a tab |
CTRL-j |
Enter a new line |
CTRL-m |
Enter a carriage return |
CTRL-l |
Clear the screen |
ESC+b |
Move back one word, or to the beginning of the current word if the cursor is not at the start of the word |
Variables, keywords, global commands, and configuration commands and units are separated by a blank line in the output, in the following order:
values or units (mutually exclusive)
keywords
global commands
configuration commands
[ex:/configure log]
A:admin@node-2# Press Tab
accounting-policy app-route-notifications apply-groups
apply-groups-exclude event-damping event-handling
event-trigger file filter
log-events log-id route-preference
services-all-events snmp-trap-group syslog
throttle-rate
back delete dev-examples
edit-config enable exec
exit history insert
logout oam ping
pwc ssh telnet
top traceroute tree
commit compare copy
discard info rename
update validate
[ex:/configure log]
A:admin@node-2# event-damping Press Tab
<event-damping>
false
true
accounting-policy app-route-notifications apply-groups
apply-groups-exclude event-handling event-trigger
file filter log-events
log-id route-preference services-all-events
snmp-trap-group syslog throttle-rate
delete insert
The ? help displays similar information but only displays global or configuration commands at the operational root or at the root of a command context. For example, the global and configuration commands are displayed at the environment root context.
[/environment]
A:admin@node-2# ?
command-completion + Enter the command-completion context
console + Enter the console context
message-severity- + Enter the message-severity-level context
level
more - Prompt to continue or stop when output text fills page
progress-indicator + Enter the progress-indicator context
prompt + Enter the prompt context
time-display - Time zone displayed before the prompt
time-format - Time format to display date and time
Global commands:
back - Move back one or more levels
delete - Delete an element
dev-examples - Enter the dev-examples context for operations
edit-config - Enter a candidate configuration mode
enable - Enable administrative mode
exec - Execute commands from a file
exit - Return to the previous context or to operational root
history - Show the command history
logout - Exit the CLI session
oam - Perform OAM tests
ping - Ping an IP address or DNS name
pwc - Show the present working context
ssh - SSH to an IP address or DNS name
telnet - Telnet to an IP address or DNS name
top - Move to the top level of the context
traceroute - Show the route taken to an IP address or DNS name
tree - Show the command tree under the present working context
Configuration commands:
info - Show the information under the present working context
The global and configuration commands are not displayed in the environment prompt context, for example, although these commands are still available in the context:
[/environment prompt]
A:admin@node-2# ?
context - Show the current command context in the prompt
newline - Add a new line before every prompt line
timestamp - Show the timestamp before the first prompt line
uncommitted-changes- - Show an asterisk (*) when uncommitted changes exist
indicator
[/environment prompt]
A:admin@node-2# info detail
context true
newline true
timestamp false
uncommitted-changes-indicator true
When a command that is part of a choice of commands is entered at the MD-CLI command prompt, the other mutually exclusive commands are no longer available to be entered on the same prompt line. Other commands that are not associated with the particular choice commands are still available.
In the following example, if either the cir or fir command is entered, the police command is not available. The pir command is available regardless of which choice command is entered.
*[ex:/configure qos sap-ingress "ing-1" queue 1 rate]
A:admin@node-2# ?
pir - Administrative PIR
Choice: rate-cir-fir-or-police
cir :- Administrative CIR
fir - Administrative FIR
police :- Drop the traffic feeding into queue above the PIR rate
*[ex:/configure qos sap-ingress "ing-1" queue 1 rate]
A:admin@node-2# cir max Press Tab
fir pir
delete
Similarly, if the police command is entered, the cir and fir commands are unavailable on the same command prompt line.
*[ex:/configure qos sap-ingress "ing-1" queue 1 rate]
A:admin@node-2# police ?
police - This element has no values
Drop the traffic feeding into queue above the PIR rate
pir - Administrative PIR
*[ex:/configure qos sap-ingress "ing-1" queue 1 rate]
A:admin@node-2# police Press Tab
pir
delete
The MD-CLI supports both command abbreviation and command completion. When typing a command, TAB, Spacebar, or ENTER invokes auto-completion. If the text entered is enough to match a specific command, auto-completion completes the command. If the text entered is not sufficient to identify a specific command, pressing Tab or Spacebar displays options in alphabetical order matching the text entered.
The environment command-completion command controls what keystrokes can trigger command completion. Each keystroke is independently controlled with its own Boolean value.
(ex)[/environment command-completion]
A:admin@node-2# info detail
enter true
space true
tab true
configure por+Spacebar displays auto-completion results
configure port+Spacebar inserts a space and suppresses auto-completion results
configure por+Tab displays auto-completion results
configure port+Tab displays auto-completion results
Variable parameter completion works only with the Tab key. All configured variables from the candidate and running configuration datastores are displayed. Line wrapping may occur for variables with long names. Parameters are displayed in alphabetical or numerical order. The variable parameter name is always displayed as the first line. In the following example, "interface-name" is the variable parameter name and "int-1" and "system" are configured names.
*(ex)[/configure router "Base"]
A:admin@node-2# interface Press Tab
<interface-name>
"int-1"
"system"
*(ex)[/configure router "Base"]
A:admin@node-2# interface
Some list elements have a default keyword defined, such as the router command, where the default keyword is "Base". When the command completion parameters (enter, space, and tab) are at their default settings (true), and the initial input matches an element in the list and a unique command keyword, the matching keyword is completed instead of the variable.
For example, the router command has a default keyword defined as "Base". If router "bf" is created using the command configure router "bf" (with quotation marks), and there is an existing bfd command context, the variable completion is as follows.
The following displays for router+Spacebar+Tab:
*[ex:/configure]
A:admin@node-2# router Press Tab
<router-name>
"Base"
"bf"
"management"
aggregates allow-icmp-redirect allow-icmp6-redirect
apply-groups apply-groups-exclude autonomous-system
bfd bgp bier
---snip---
The following displays for router bf+Tab:
*[ex:/configure]
A:admin@node-2# router bf+Press Tab
"bf"
bfd
Entering router bf+Enter completes to router bfd and enters the router "Base" bfd context:
*[ex:/configure]
A:admin@node-2# router bfd Press Enter
*[ex:/configure router "Base" bfd]
A:admin@node-2#
Similarly, router bf+Spacebar completes to router bfd and enters the router "Base" bfd context when Enter is pressed:
*[ex:/configure]
A:admin@node-2# router bfd Press Space Press Enter
*[ex:/configure router "Base" bfd]
A:admin@node-2#
To enter the context for router "bf", use quotation marks to specify the variable:
[ex:/configure]
A:admin@node-2# router "bf"
*[ex:/configure router "bf"]
A:admin@node-2#
If the command completion for enter is set to false, router bf+Enter allows the match to router "bf". Similarly, when the command completion for space is false, router bf+Spacebar also matches to router "bf" instead of the bfd context
*(ex)[/environment command-completion]
A:admin@node-2# info detail
enter true
space true
tab true
*(ex)[/environment command-completion]
A:admin@node-2# enter false
*(ex)[/environment command-completion]
A:admin@node-2# space false
*(ex)[/environment command-completion]
A:admin@node-2#
*(ex)[/]
A:admin@node-2# configure
*(ex)[/configure]
A:admin@node-2# router bf Press Enter
*(ex)[/configure router "bf"]
A:admin@node-2# back
*(ex)[/configure]
A:admin@node-2# router bf Press Spacebar+Enter
*(ex)[/configure router "bf"]
A:admin@node-2#
For keyword-based leaf-lists, command completion displays all possible values, not only those that are configured. When deleting values in a leaf-list, only the values that are currently configured are displayed. In the following example, when defining the forwarding traffic classes, all keyword values are listed. When deleting the forwarding traffic classes, only the configured classes are displayed.
*[ex:/configure policy-options policy-statement "ss" entry 3 from]
A:admin@node-2# family
family <value>
family [<value>...] - 1..20 system-ordered values separated by spaces
enclosed by brackets
<value> - <keyword>
<keyword> - (ipv4|vpn-ipv4|ipv6|mcast-ipv4|vpn-ipv6|l2-vpn|mvpn-ipv4|mdt-
safi|ms-pw|flow-ipv4|route-target|mcast-vpn-ipv4|mvpn-ipv6|
flow-ipv6|evpn|mcast-ipv6|label-ipv4|label-ipv6|bgp-ls|mcast-
vpn-ipv6|sr-policy-ipv4|sr-policy-ipv6)
Address family as the match condition
Note: 'configure policy-options policy-statement "ss"' and all other
elements in this context support single-model management only.
*[ex:/configure policy-options policy-statement "ss" entry 3 from]
A:admin@node-2# family [ipv4 mcast-ipv4 mcast-vpn-ipv4 label-ipv4]
*[ex:/configure policy-options policy-statement "ss" entry 3 from]
A:admin@node-2# info
family [ipv4 mcast-ipv4 mcast-vpn-ipv4 label-ipv4]
*[ex:/configure policy-options policy-statement "ss" entry 3 from]
A:admin@node-2# delete family Press Tab
<family>
ipv4
mcast-ipv4
mcast-vpn-ipv4
label-ipv4
*
The explicit use of the keyword true for a Boolean element is optional. If neither true or false is entered, the keyword true is assumed.
(ex)[/environment]
A:admin@node-2# more ?
more <boolean>
<boolean> - ([true]|false)
Default - true
Prompt to continue or stop when output text fills page
When Tab is used for command completion with Boolean elements, the values of false and true are displayed, along with the names of possible elements that can follow. In the following example of the environment more command, the commands command-completion, console, message-severity-level, and so on, can be defined following the more command.
(ex)[/environment]
A:admin@node-2# more Press Tab
<more>
false
true
command-completion console message-severity-level
progress-indicator prompt time-display
time-format
delete
A single idle timeout applies to all CLI engines in a CLI session (classic and MD-CLI). The idle timeout can be modified to a value between 1 and 1440 minutes.
The following points apply.
The idle timeout only affects new CLI sessions. Existing and current sessions retain the previous idle timeout.
The idle timeout can be disabled by setting the value to none.
The "Idle time" column in the show users display is reset after an action in either CLI engine.
[/]
A:admin@node-2# show users
===============================================================================
User Type Login time Idle time
Session ID (Router instance)
From
===============================================================================
Console -- 0d 21:44:02 --
6 (--)
--
admin SSHv2 16FEB2021 20:42:15 0d 00:00:04 --
12 (management)
192.168.144.97
admin SSHv2 16FEB2021 19:49:45 0d 00:00:00 --
#11 (management)
192.168.144.97
-------------------------------------------------------------------------------
Number of users: 2
'#' indicates the current active session
===============================================================================
A warning message is displayed when a session reaches one-half the value of the idle timeout, and another message is displayed when the idle timeout expires and the user is logged out.
The idle timeout configured in the classic CLI affects all new sessions as well as the current session. However, the current session is only affected if the classic CLI engine is active when the idle timeout expires. Configuration changes via the MD-CLI or any other interface, including SNMP, only affect new sessions that begin after the change.
Output modifiers provide support for post-processing of CLI output. Output modifiers are specified using a vertical bar (|) character. The following points apply when using output modifiers.
Output modifiers can be appended to any CLI command in any command context.
Output modifiers work across soft line breaks (visual lines) that are wrapped because of the terminal width; for example, using match or count. They do not work across hard line breaks (logical lines).
Modifiers can be combined in any order. No hard limit exists for the number of combinations. Output is processed linearly and there is little impact on the system performance except to the operator session that entered the modifier combination.
The following options are supported for use with the pipe (|) match command:
ignore-case — specifies to ignore case in pattern match
invert-match — specifies to invert the pattern match selection
max-count — specifies the maximum number of displayed matches
post-lines — specifies the number of lines to display following the matched line
pre-lines — specifies the number of lines to display preceding the matched line
The default pattern matchng is a string match. If the required pattern to match includes a space, the pattern must be delimited by quotation marks (").The following example matches on the pattern autonomous-system in the tree detail under the configure router "Base" context, and starts the display with ten lines preceding the pattern match.
[ex:/configure router "Base"]
A:admin@node-2# tree detail | match autonomous-system pre-lines 10
| | +-- local-preference <number>
| | +-- policy <reference>
| | +-- summary-only <boolean>
| | +-- tunnel-group <number>
| +-- apply-groups <reference>
| +-- apply-groups-exclude <reference>
+-- allow-icmp-redirect <boolean>
+-- allow-icmp6-redirect <boolean>
+-- apply-groups <reference>
+-- apply-groups-exclude <reference>
+-- autonomous-system <number>
---snip---
Regular expressions (REs) used by the MD-CLI engine are delimited by apostrophes (‛); for example, ‛.*’. REs cannot be delimited by quotation marks ("); for example, ".*" because this indicates a string match.
MD-CLI REs are based on a subset of The Open Group Base Specifications Issue 7 and IEEE Std 1003.1-2008, 2016 Edition REs, as defined in chapter 9. MD-CLI REs only support Extended Regular Expression (ERE) notation as defined in section 9.4. Basic Regular Expression (BRE) notation as defined in section 9.3 is not supported.
In ERE notation, a backslash (\) before a special character is treated as a literal character. Backslashes are not supported before ( ) or { }, as they are in BREs to indicate a bracket expression or marked expression.
Special character |
Description |
---|---|
. |
Matches any single character |
* |
Matches the preceding expression zero or more times |
? |
Matches the preceding expression zero or one time |
+ |
Matches the preceding expression one or more times |
[ ] |
Matches a single character within the brackets |
[^] |
Matches a single character not within the brackets |
^ |
Matches the starting position |
$ |
Matches the ending position |
( ) |
Defines a marked subexpression |
{m,n} |
Matches the preceding expression at least m and not more than n times |
{m} |
Matches the preceding expression exactly m times |
{m, } |
Matches the preceding expression at least m times |
{ ,n} |
Matches the preceding expression not more than n times |
| |
Matches either expression preceding or following the | |
\ |
Treats the following character as a match criterion |
- |
Separates the start and end of a range |
The following examples show the use of a bracket expression as a matching list expression.
The first output does not use any match expressions and therefore shows the entire output.
[/]
A:admin@node-2# show port
===============================================================================
Ports on Slot 1
===============================================================================
Port Admin Link Port Cfg Oper LAG/ Port Port Port C/QS/S/XFP/
Id State State MTU MTU Bndl Mode Encp Type MDIMDX
-------------------------------------------------------------------------------
1/1/1 Down No Ghost 8704 8704 - netw null xcme
1/1/2 Up No Ghost 1514 1514 - accs null xcme
1/1/3 Up No Ghost 1514 1514 - accs null xcme
1/1/4 Up No Ghost 1514 1514 - accs null xcme
1/1/5 Up No Ghost 1514 1514 - accs null xcme
1/1/6 Down No Ghost 8704 8704 - netw null xcme
1/1/7 Down No Ghost 8704 8704 - netw null xcme
1/1/8 Down No Ghost 8704 8704 - netw null xcme
1/1/9 Down No Ghost 8704 8704 - netw null xcme
1/1/10 Down No Ghost 8704 8704 - netw null xcme
1/1/11 Down No Ghost 8704 8704 - netw null xcme
1/1/12 Down No Ghost 8704 8704 - netw null xcme
1/2/1 Up No Ghost 8704 8704 - netw null xcme
1/2/2 Up No Ghost 1514 1514 - accs null xcme
1/2/3 Up No Ghost 1514 1514 - accs null xcme
1/2/4 Down No Ghost 8704 8704 - netw null xcme
Press Q to quit, Enter to print next line or any other key to print next page.
In this matching list expression, a match is any single character in the bracket expression, which in this case is 1, 3, or 5.
[/]
A:admin@node-2# show port | match '1/1/[135]'
1/1/1 Down No Ghost 8704 8704 - netw null xcme
1/1/3 Up No Ghost 1514 1514 - accs null xcme
1/1/5 Up No Ghost 1514 1514 - accs null xcme
1/1/10 Down No Ghost 8704 8704 - netw null xcme
1/1/11 Down No Ghost 8704 8704 - netw null xcme
1/1/12 Down No Ghost 8704 8704 - netw null xcme
In this non-matching list expression, a match is any single character not in the bracket expression, that is, not 1, 2, or 4.
[/]
A:admin@node-2# show port | match '1/1/[^124]'
1/1/3 Up No Ghost 1514 1514 - accs null xcme
1/1/5 Up No Ghost 1514 1514 - accs null xcme
1/1/6 Down No Ghost 8704 8704 - netw null xcme
1/1/7 Down No Ghost 8704 8704 - netw null xcme
1/1/8 Down No Ghost 8704 8704 - netw null xcme
1/1/9 Down No Ghost 8704 8704 - netw null xcme
The range operator (-) can be used in a matching or non-matching list expression.
[/]
A:admin@node-2# show port | match '1/1/[3-7]'
1/1/3 Up No Ghost 1514 1514 - accs null xcme
1/1/4 Up No Ghost 1514 1514 - accs null xcme
1/1/5 Up No Ghost 1514 1514 - accs null xcme
1/1/6 Down No Ghost 8704 8704 - netw null xcme
1/1/7 Down No Ghost 8704 8704 - netw null xcme
[/]
A:admin@node-2# show port | match '1/1/[^3-7]'
1/1/1 Down No Ghost 8704 8704 - netw null xcme
1/1/2 Up No Ghost 1514 1514 - accs null xcme
1/1/8 Down No Ghost 8704 8704 - netw null xcme
1/1/9 Down No Ghost 8704 8704 - netw null xcme
1/1/10 Down No Ghost 8704 8704 - netw null xcme
1/1/11 Down No Ghost 8704 8704 - netw null xcme
1/1/12 Down No Ghost 8704 8704 - netw null xcme
The alternation operator (|) can be used with or without a bracket expression to match against two or more alternative expressions.
[/]
A:admin@node-2# show port | match '1/1/[2-5|7-9]'
1/1/2 Up No Ghost 1514 1514 - accs null xcme
1/1/3 Up No Ghost 1514 1514 - accs null xcme
1/1/4 Up No Ghost 1514 1514 - accs null xcme
1/1/5 Up No Ghost 1514 1514 - accs null xcme
1/1/7 Down No Ghost 8704 8704 - netw null xcme
1/1/8 Down No Ghost 8704 8704 - netw null xcme
1/1/9 Down No Ghost 8704 8704 - netw null xcme
Without a bracket expression, an exact match is attempted against two or more alternative expressions.
*[ex:/configure card 1]
A:admin@node-2# info | match '10g|100g'
mda-type imm4-10gb-xp-xfp
mda-type cx2-100g-cfp
MD-CLI REs match on the output format of an element, as is shown in the configuration. For example, if the value of an element is shown in hexadecimal in info output, a decimal RE does not match the value.
MD-CLI REs are not implicitly anchored. The ^ or $ anchoring special characters can be used, as in the following example.
*(ex)[/configure router "Base" bgp]
A:admin@node-2# info
group "external" {
}
group "internal" {
}
neighbor 192.168.10.1 {
group "external"
keepalive 30
peer-as 100
}
neighbor 192.168.10.2 {
group "external"
peer-as 100
family {
ipv4 true
}
}
This example uses the ^ anchor character to match on "group" preceded by four spaces at the beginning of the line.
*(ex)[/configure router "Base" bgp]
A:admin@node-2# info | match '^ group' pre-lines 1
group "external" {
}
group "internal" {
This example uses the ^ anchor character to match on "group" preceded by eight spaces at the beginning of the line.
*(ex)[/configure router "Base" bgp]
A:admin@node-2# info | match '^ group' pre-lines 1
neighbor 192.168.10.1 {
group "external"
neighbor 192.168.10.2 {
group "external"
*(ex)[/configure router "Base" bgp]
A:admin@node-2#
In the following configuration example using the compare command, the | match option filters out those commands to be deleted (configuration statements beginning with the minus sign (-)) and those to be added (configuration statements beginning with the plus sign (+)).
*(gl)[/configure log accounting-policy 5]
A:admin@node-2# /compare
+ admin-state enable
- collection-interval 105
+ collection-interval 75
- include-system-info true
+ include-system-info false
*(gl)[/configure log accounting-policy 5]
A:admin@node-2# /compare | match '^-'
- collection-interval 105
- include-system-info true
The backslash (\) is used to match the literal "+" character that denotes additions to the configuration seen in the compare command.
*(gl)[/configure log accounting-policy 5]
A:admin@node-2# /compare | match '^\+'
+ admin-state enable
+ collection-interval 75
+ include-system-info false
A character class expression is expressed as a character class name enclosed within bracket colon ("[:" and ":]") delimiters.
Character Class |
Characters Matched1 |
Description |
---|---|---|
[:alnum:] |
‛ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz 0123456789’ |
Alphanumeric characters |
[:alpha:] |
‛ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz’ |
Alphabetic characters |
[:blank:] |
‛ \t’ |
Space and Tab |
[:cntrl:] |
‛\007\b\t\n\v\f\r\1\2\3\4\5\6\16\17\20 \21\22\23\24\25\26\27\30 \31\32\33\34\35\36\37\177’ |
Control characters |
[:digit:] |
‛0123456789’ |
Digits |
[:graph:] |
‛ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz 0123456789 !\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~’ |
Visible characters |
[:lower:] |
‛abcdefghijklmnopqrstuvwxyz’ |
Lowercase letters |
[:print:] |
‛ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz 0123456789!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~ ’ |
Visible characters and the Space character |
[:punct:] |
‛!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~’ |
Punctuation characters |
[:space:] |
‛\t\n\v\f\r ‛ |
Whitespace (blank) characters |
[:upper:] |
‛ABCDEFGHIJKLMNOPQRSTUVWXYZ’ |
Uppercase letters |
[:xdigit:] |
‛0123456789ABCDEFabcdef’ |
Hexadecimal digits |
Note:
Characters matching the character class are delimited by apostrophes (‛).
Character class expressions must be enclosed within brackets. The expression ‛[[:digit:]]’ is treated as an RE containing the character class ‟digit”, while ‛[:digit:]’ is treated as an RE matching ‟:”, ‟d”, ‟i”, ‟g”, or ‟t”.
Collating symbols and equivalence classes are not supported in MD-CLI REs.
The | count option displays the line count of the output.
[ex:/configure router "Base"]
A:admin@node-2# tree flat detail | match seamless-bfd
bfd seamless-bfd
bfd seamless-bfd peer <unicast-ipv4-address | global-unicast-ipv6-address>
bfd seamless-bfd peer <unicast-ipv4-address | global-unicast-ipv6-address> apply-groups <reference>
bfd seamless-bfd peer <unicast-ipv4-address | global-unicast-ipv6-address> apply-groups-exclude <reference>
bfd seamless-bfd peer <unicast-ipv4-address | global-unicast-ipv6-address> discriminator <number>
[ex:/configure router "Base"]
A:admin@node-2# tree flat detail | match seamless-bfd | count
Count: 5 lines
The | no-more option displays the output with pagination disabled for the command. This option is similar to the environment more false setting that applies to all commands, where the entire output text is printed without page interruptions.
The > option can be used to redirect output to a local or remote file. The > redirect must be specified at the end of a command and cannot be combined with other redirects.
[ex:/configure router "Base"]
A:admin@node-2# info detail | match leak-export > ?
[url] <string>
<string> - <1..199 characters>
Location to save the output
Configuring a container navigates into the context. In the following example, the first container is log, and the next is log-events. All containers are marked with a "+".
[ex:/configure log]
A:admin@node-2# ?
accounting-policy + Enter the accounting-policy list instance
app-route- + Enter the app-route-notifications context
notifications
apply-groups - Apply a configuration group at this level
apply-groups-exclude - Exclude a configuration group at this level
event-damping - Allow event damping algorithm to suppress QoS or
filter change events
event-handling + Enter the event-handling context
event-trigger + Enter the event-trigger context
file + Enter the file list instance
filter + Enter the filter list instance
log-events + Enter the log-events context
log-id + Enter the log-id list instance
route-preference + Enter the route-preference context
services-all-events + Enter the services-all-events context
snmp-trap-group + Enter the snmp-trap-group list instance
syslog + Enter the syslog list instance
throttle-rate + Enter the throttle-rate context
[ex:/configure log]
A:admin@node-2# log-events
[ex:/configure log log-events]
A:admin@node-2#
Alternatively, the same context can be entered on one line:
(ex)[/]
A:admin@node-2# configure log log-events
(ex)[/configure log log-events]
A:admin@node-2#
Container lists are also marked with a "+" and the context is entered by specifying the key for the list.
[ex:/configure log]
A:admin@node-2# ?
accounting-policy + Enter the accounting-policy list instance
app-route- + Enter the app-route-notifications context
notifications
apply-groups - Apply a configuration group at this level
apply-groups-exclude - Exclude a configuration group at this level
event-damping - Allow event damping algorithm to suppress QoS or
filter change events
event-handling + Enter the event-handling context
event-trigger + Enter the event-trigger context
file + Enter the file list instance
filter + Enter the filter list instance
log-events + Enter the log-events context
log-id + Enter the log-id list instance
route-preference + Enter the route-preference context
services-all-events + Enter the services-all-events context
snmp-trap-group + Enter the snmp-trap-group list instance
syslog + Enter the syslog list instance
throttle-rate + Enter the throttle-rate context
[ex:/configure log]
A:admin@node-2# log-id ?
[id] <number>
<number> - <1..101>
Event stream log ID
[ex:/configure log]
A:admin@node-2# log-id 99
[ex:/configure log log-id 99]
A:admin@node-2#
Configuring a leaf element maintains the present working context if there is no explicit opening brace. Entering an explicit opening brace navigates into the specified context.
*[ex:/configure card 1 mda 2]
A:admin@node-2# atm mode ?
mode <keyword>
<keyword> - (max8k-vc|max16k-vc)
Mode of operation
*[ex:/configure card 1 mda 2]
A:admin@node-2# atm mode max8k-vc
*[ex:/configure card 1 mda 2]
A:admin@node-2# atm { mode max8k-vc
*[ex:/configure card 1 mda 2 atm]
A:admin@node-2#
Configuring a container navigates into the context.
[ex:/configure router "Base"]
A:admin@node-2# ?
aggregates + Enter the aggregates context
allow-icmp-redirect - Allow ICMP redirects on the management interface
allow-icmp6-redirect - Allow IPv6 ICMP redirects on the management interface
apply-groups - Apply a configuration group at this level
apply-groups-exclude - Exclude a configuration group at this level
autonomous-system - AS number advertised to peers for this router
bfd + Enter the bfd context
bgp + Enable the bgp context
---snip---
[ex:/configure router "Base"]
A:admin@node-2# bgp
[ex:/configure router "Base" bgp]
A:admin@node-2# ?
add-paths + Enable the add-paths context
admin-state - Administrative state of the BGP instance
advertise-external + Enter the advertise-external context
advertise-inactive - Advertise inactive BGP routes to peers
---snip---
[ex:/configure router "Base" bgp]
A:admin@node-2# add-paths
*[ex:/configure router "Base" bgp add-paths]
A:admin@node-2#
Configuring an empty container or a list where the only children are keys does not navigate into the context. These elements are displayed with aggregated braces with a space ({ }) on the same line. It is possible to enter the element name with an opening brace; however, no options are available in this context.
For example, configuring the list element sdp-include with a key of ‟ref_group_name” does not change the existing context.
*(ex)[/configure service pw-template "tt"]
A:admin@node-2# sdp-include ref_group_name
*(ex)[/configure service pw-template "tt"]
A:admin@node-2# info
sdp-include "ref_group_name" { }
*(ex)[/configure service pw-template "tt"]
A:admin@node-2#
The back and top commands are used to navigate contexts, but it is also possible to use closing braces (}) to navigate.
The behavior of an explicit closing brace depends on the contents of the current command line. If the command line contains an explicit opening brace, the closing brace exits to the parent context of the opening brace.
In the following example with an opening brace on the command line, the closing brace exits VPRN 1, and then enters the context of VPRN 2.
(ex)[/]
A:admin@node-2# configure service vprn 1 { interface "intf1" description "vprn-if" } vprn 2
*(ex)[/configure service vprn "2"]
A:admin@node-2#
In the following example without an opening brace on the command line, the first closing brace exits interface "int1", and the second closing brace exits VPRN 1 and enters the VPRN 2 context.
*(ex)[/configure service]
A:admin@node-2# vprn 1 interface "int1" description "vprn-if" } } vprn 2
*(ex)[/configure service vprn "2"]
A:admin@node-2#
The exec command executes commands from a file as if the user typed or pasted the input into the MD-CLI. The syntax can be seen as follows:
[ex:/configure]
A:admin@node-2# exec ?
[url] <string>
<string> - <0..255 characters>
Location of the file to be executed
[ex:/configure]
A:admin@node-2# exec my-url-fn ?
exec
echo - Display the commands as they are being executed
The exec command:
errors if it detects an interactive input
terminates in the CLI engine in which it completes execution as follows:
if there are no commands that switch CLI engines, the CLI engine is always the one in which exec started
if there are commands that switch CLI engines, exec ends in the last CLI engine that was entered
//exec returns to the engine in which it was started
terminates execution and displays an error message if an error occurs, leaving the session in the same context as when the error occurred
The system executes the file as follows:
disables pagination while the command is running
disables command completion while the command is running
suppresses the commands in the file from the command history
When using commands that switch between CLI engines within an executable file, the following commands are recommended:
use /!classic-cli to switch explicitly to the classic CLI engine and /!md-cli to switch explicitly to the MD-CLI engine, instead of // to toggle between engines
use exit all to get to a known starting point: the operational root of the classic CLI or the MD-CLI engine
include edit-config if the script needs to change the candidate configuration in the MD-CLI engine. Use quit-config after changes are committed in the script.
An executable with edit-config may fail if other users have locked the configuration.
Issuing the quit-config command with changes in the candidate configuration while the session is in exclusive configuration mode fails the executable because of the ‟discard changes” prompt.
The info command shows configuration or state information from the present context. The command can only be executed in a configuration mode for a configuration region or for the state branch. By default, all configured parameters in the candidate configuration datastore are displayed for a configuration region. For a state region, all elements that have a value are displayed. The syntax for the info command is as follows:
[ex:/configure]
A:admin@node-2# info ?
info [[from] <keyword>] [[cli-path] <path>]
[[from] <keyword>]
<keyword> - (candidate|running|baseline|intended)
Source datastore
[cli-path] <path>
<path> - <absolute or relative from pwc>
Absolute or relative path from present working context
converted - Include converted third party model configuration from
the running datastore
detail - Include default and unconfigured values
full-context - Show the full context on each line
inheritance - Include configuration inherited from configuration
groups
model - Model for which to limit converted output to values
units - Include unit types for applicable elements
Choice: output-format
flat :- Show the context from the pwc on each line
json :- Show the output in indented JSON format
xml :- Show the output in indented XML format
Option |
Description |
---|---|
[from] (candidate | running | baseline | intended) |
Specify the source datastore (default is from candidate if no other options are specified). This option is not supported for state elements. |
[cli-path] string |
Specify the absolute or relative path from the present working context |
converted |
Include converted configuration values from third party models. This option should only be used in the configure region when third party models are used. The output with this option is the same as info when used in other configuration regions. This option is not supported for state elements. |
detail |
Include default and unconfigured values |
full-context |
Show the full context on each line |
inheritance |
Include configuration inherited from configuration groups. This option should only be used in the configure region. The output with this option is the same as info when used in other configuration regions. This option is not supported for state elements. |
model |
Model which limits the converted output. This option is only supported with the converted option. |
units |
Include unit types for applicable elements |
flat |
Show the context on each line starting from the present working context |
json |
Show the output in indented JSON format |
xml |
Show the output in indented XML format |
Execute the command from the configuration root to stay at the root context without navigating.
[from] candidate and converted
[from] intended and converted
[from] intended and detail
[from] intended and inheritance
full-context and flat
model and detail
model and inheritance
units and json
units and xml
The order of the configuration output is as follows:
keys are displayed on the same line as the command element
apply-groups is displayed, if applicable
apply-groups-exclude is displayed, if applicable
admin-state is displayed, if applicable
description is displayed, if applicable
other top-level elements are displayed in alphabetical order
The following displays configured information for configure router bgp
*[ex:/configure router "Base" bgp]
A:admin@node-2# info
connect-retry 90
local-preference 250
add-paths {
ipv4 {
receive true
}
}
The following output displays the same information in JSON format:
[ex:/configure router "Base" bgp]
A:admin@node-2# info json
{
"nokia-conf:connect-retry": 90,
"nokia-conf:local-preference": 250,
"nokia-conf:add-paths": {
"ipv4": {
"receive": true
}
}
}
The following output displays the same information in XML format:
[ex:/configure router "Base" bgp]
A:admin@node-2# info xml
<connect-retry xmlns="urn:nokia.com:sros:ns:yang:sr:conf">90</connect-retry>
<local-preference xmlns="urn:nokia.com:sros:ns:yang:sr:conf">250</local-preference>
<add-paths xmlns="urn:nokia.com:sros:ns:yang:sr:conf">
<ipv4>
<receive>true</receive>
</ipv4>
</add-paths>
The configuration output can display all elements that are configured, even if an element is set to the system default state or value. The detail option displays all data for the context, including default configurations. The double hash (##) indicates an unconfigured element or a dynamic default.
*[ex:/configure router "Base" bgp]
A:admin@node-2# info detail
## apply-groups
admin-state enable
## description
connect-retry 90
keepalive 30
damping false
local-preference 250
loop-detect ignore-loop
loop-detect-threshold 0
selective-label-ipv4-install false
min-route-advertisement 30
aggregator-id-zero false
preference 170
block-prefix-sid false
## multihop
## med-out
## authentication-key
client-reflect true
vpn-apply-export false
vpn-apply-import false
asn-4-byte true
When using the info command with both the detail and xml options, the double hash (##) elements (indicating unconfigured elements or dynamic defaults) are enclosed within XML comments.
*[ex:/configure router "Base" bgp]
A:admin@node-2# info detail xml
<!-- ## apply-groups -->
<!-- ## apply-groups-exclude -->
<admin-state xmlns="urn:nokia.com:sros:ns:yang:sr:conf">enable</admin-state>
<!-- ## description -->
<connect-retry xmlns="urn:nokia.com:sros:ns:yang:sr:conf">90</connect-retry>
<keepalive xmlns="urn:nokia.com:sros:ns:yang:sr:conf">30</keepalive>
<damping xmlns="urn:nokia.com:sros:ns:yang:sr:conf">false</damping>
<local-preference xmlns="urn:nokia.com:sros:ns:yang:sr:conf">250</local-preference>
---snip---
When using the info command with both detail and json options, the output does not include unconfigured elements. Unconfigured elements in the MD-CLI are denoted with ## and there is no standard method of displaying comments within the JSON format.
[ex:/configure router "Base" bgp]
A:admin@node-2# info detail json
{
"nokia-conf:admin-state": "enable",
"nokia-conf:connect-retry": 90,
"nokia-conf:keepalive": 30,
"nokia-conf:damping": false,
"nokia-conf:local-preference": 250,
"nokia-conf:loop-detect": "ignore-loop",
"nokia-conf:loop-detect-threshold": 0,
"nokia-conf:selective-label-ipv4-install": false,
"nokia-conf:min-route-advertisement": 30,
"nokia-conf:aggregator-id-zero": false,
"nokia-conf:preference": 170,
"nokia-conf:block-prefix-sid": false,
"nokia-conf:client-reflect": true,
"nokia-conf:vpn-apply-export": false,
"nokia-conf:vpn-apply-import": false,
"nokia-conf:asn-4-byte": true,
"nokia-conf:path-mtu-discovery": false,
"nokia-conf:enforce-first-as": false,
"nokia-conf:initial-send-delay-zero": false,
"nokia-conf:inter-as-vpn": false,
"nokia-conf:purge-timer": 10,
"nokia-conf:route-table-install": true,
---snip---
The flat option displays the context of every element in the present working context on a single line. Braces ensure that the context stays in the present working context for copy and paste purposes.
*[ex:/configure router "Base" bgp]
A:admin@node-2# info flat detail
## apply-groups
admin-state enable
## description
connect-retry 90
keepalive 30
damping false
local-preference 250
---snip---
## route-target-list
## outbound-route-filtering
## monitor
rib-management { }
rib-management { ipv4 }
rib-management { ipv4 route-table-import }
## rib-management ipv4 route-table-import apply-groups
## rib-management ipv4 route-table-import policy-name
---snip---
rib-management { label-ipv4 }
rib-management { label-ipv4 route-table-import }
## rib-management label-ipv4 route-table-import apply-groups
## rib-management label-ipv4 route-table-import policy-name
---snip---
segment-routing { }
## segment-routing apply-groups
segment-routing { admin-state disable }
## segment-routing prefix-sid-range
---snip---
The full-context option displays the full context of every element from the present working context on a single line.
[ex:/configure router "Base" bgp]
A:admin@node-2# info full-context
/configure router "Base" bgp connect-retry 90
/configure router "Base" bgp local-preference 250
/configure router "Base" bgp add-paths { }
/configure router "Base" bgp add-paths { ipv4 }
/configure router "Base" bgp add-paths { ipv4 receive true }
[ex:/configure router "Base" bgp]
A:admin@node-2# info full-context detail
## /configure router "Base" bgp apply-groups
/configure router "Base" bgp admin-state enable
## /configure router "Base" bgp description
/configure router "Base" bgp connect-retry 90
/configure router "Base" bgp keepalive 30
/configure router "Base" bgp damping false
/configure router "Base" bgp local-preference 250
/configure router "Base" bgp loop-detect ignore-loop
/configure router "Base" bgp loop-detect-threshold 0
/configure router "Base" bgp selective-label-ipv4-install false
/configure router "Base" bgp min-route-advertisement 30
/configure router "Base" bgp aggregator-id-zero false
/configure router "Base" bgp preference 170
/configure router "Base" bgp block-prefix-sid false
## /configure router "Base" bgp multihop
## /configure router "Base" bgp med-out
## /configure router "Base" bgp authentication-key
/configure router "Base" bgp client-reflect true
---snip---
/configure router "Base" bgp add-paths { }
/configure router "Base" bgp add-paths { ipv4 }
## /configure router "Base" bgp add-paths ipv4 send
/configure router "Base" bgp add-paths { ipv4 receive true }
/configure router "Base" bgp add-paths { ipv6 }
---snip---
When the full-context option is used in conjunction with the json or xml option, the output is modified to display the configuration back to the YANG model aware root of the configuration tree.
[ex:/configure router "Base" bgp]
A:admin@node-2# info full-context json
{
"nokia-conf:configure": {
"router": [
{
"router-name": "Base",
"bgp": {
"connect-retry": 90,
"local-preference": 250,
"add-paths": {
"ipv4": {
"receive": true
}
}
}
}
]
}
}
[ex:/configure router "Base" bgp]
A:admin@node-2# info full-context xml
<configure xmlns="urn:nokia.com:sros:ns:yang:sr:conf">
<router>
<router-name>Base</router-name>
<bgp>
<connect-retry>90</connect-retry>
<local-preference>250</local-preference>
<add-paths>
<ipv4>
<receive>true</receive>
</ipv4>
</add-paths>
</bgp>
</router>
</configure>
The info command always displays all keys of the list on the same line. The first key of a list is unnamed in the MD-CLI, however, there are exceptions where the key is named and must be entered. (See the online help for the correct syntax of the command, or the 7450 ESS, 7750 SR, 7950 XRS, and VSR MD-CLI Command Reference Guide). All other keys are named. For example, the collector list has two keys, ip-address and port. The name of the first key, ip-address, does not appear in the info display. The name of the second key and any subsequent keys are always displayed.
*(ex)[/configure cflowd]
A:admin@node-2# info
collector 10.10.20.30 port 7 {
}
collector 10.10.30.40 port 8 {
}
The CLI show commands can be used in the MD-CLI as well as in the classic CLI, in the following ways:
use /show or show (while in the operational root []) in the MD-CLI engine
use show in the classic CLI engine
(ex)[/]
A:admin@node-2# show port port-id 1/1/1 description
===============================================================================
Port Descriptions on Slot 1
===============================================================================
Port Id Description
-------------------------------------------------------------------------------
1/1/1 10-Gig Ethernet
===============================================================================
(ex)[/]
A:admin@node-2# configure router
(ex)[/configure router "Base"]
A:admin@node-2# show port port-id 1/1/1 description
^^^^
MINOR: MGMT_CORE #2201: Unknown element - 'show'
(ex)[/configure router "Base"]
A:admin@node-2# /show port port-id 1/1/1 description
===============================================================================
Port Descriptions on Slot 1
===============================================================================
Port Id Description
-------------------------------------------------------------------------------
1/1/1 10-Gig Ethernet
===============================================================================
Output modifiers (match, count, and no-more) can also be used with the show command. See Using Output Modifiers in the MD-CLI.
Classic CLI commands that are accessible in the MD-CLI show outputs of the same information and provide the same functionality in the MD-CLI as they do in the classic CLI. No additional outputs or enhancements are included in the MD-CLI.
The following classic CLI show commands are not available in the MD-CLI:
show alias
show bof (use the MD-CLI admin show configuration command or the info command in the bof configuration region instead)
show config (use the MD-CLI admin show configuration command or the info command in the configure configuration region instead)
show debug
show system candidate
show system rollback
As described in Section Navigating the MD-CLI Hierarchy Levels, the pwc command displays the present working context. Navigating around the MD-CLI hierarchy changes the present working context. The MD-CLI path format, also known as cli-path, is displayed in the MD-CLI user prompt; for example:
[ex:/configure card 1 mda 1]
A:admin@node-2# pwc
Present Working Context:
configure
card 1
mda 1
For the following commands, an absolute or relative MD-CLI path can be specified to provide path qualified attributes:
admin show configuration (see Displaying Configuration with admin Commands)
compare (see Using the compare Outputs to Copy and Paste)
copy (see Using the copy Command)
discard (see Discarding Configuration Changes)
info (see Using the info Command)
rename (see Using the rename Command)
tree (see Using the tree Command)
Absolute Path
An absolute CLI path is specified using the forward slash (/) as the MD-CLI tree structure from the root.
The following absolute CLI path references a section of the MD-CLI tree under the indicated context:
/configure card 1 mda 1
The following CLI path references a specific leaf in the tree:
/state system oper-name
Relative Path
A relative CLI path specifies the MD-CLI tree structure from the present working context. In the following example, the two info commands display the same information. The first command usage is an absolute path reference and the next usage is a relative path from the present working context (pwc).
[ex:/configure router "Base" bgp]
A:admin@node-2# pwc
Present Working Context:
configure
router "Base"
bgp
[ex:/configure router "Base" bgp]
A:admin@node-2# info /configure router "Base" bgp group "grp1"
[ex:/configure router "Base" bgp]
A:admin@node-2# info group "grp1"
The CLI path is accepted as an unnamed last parameter of the command. The information is displayed for the specified path.
[ex:/configure]
A:admin@node-2# info ?
info [[from] <keyword>] [[cli-path] <path>]
[[from] <keyword>]
<keyword> - (candidate|running|baseline|intended)
Source datastore
[cli-path] <path>
<path> - <absolute or relative from pwc>
Absolute or relative path from present working context
converted - Include converted third party model configuration from
the running datastore
detail - Include default and unconfigured values
full-context - Show the full context on each line
inheritance - Include configuration inherited from configuration
groups
model - Model for which to limit converted output to values
units - Include unit types for applicable elements
Choice: output-format
flat :- Show the context from the pwc on each line
json :- Show the output in indented JSON format
xml :- Show the output in indented XML format
[ex:/configure]
A:admin@node-2# info candidate detail units /configure system
## apply-groups
## apply-groups-exclude
## contact
name "node-2"
## location
icmp-vse false
selective-fib false
## coordinates
## clli-code
ospf-dynamic-hostnames false
---snip---
A configuration lock from either implicit or explicit configuration mode is required to display paths for a configuration region.
The state branch does not have a lock and can always be specified.
[ex:/configure]
A:admin@node-2# info detail /state system
oper-name "node-2"
base-mac-address aa:bb:cc:00:00:00
platform "7750 SR-12"
chassis-topology standalone
crypto-module-version "SRCM 3.1"
## fabric-speed
temperature-status ok
fp-generation-fp2 false
fp-generation-fp3 false
fp-generation-fp4 false
system-profile none
active-cpm-slot "A"
The following example shows the use of the info command with a state path from operational mode.
[/]
A:admin@node-2# info /state system
oper-name "node-2"
base-mac-address aa:bb:cc:00:00:00
platform "7750 SR-12"
chassis-topology standalone
crypto-module-version "SRCM 3.1"
temperature-status ok
fp-generation-fp2 false
fp-generation-fp3 false
fp-generation-fp4 false
system-profile none
active-cpm-slot "A"
In the next example, to use the info command from a state path to a configuration region, a configuration lock must be established.
[/state system]
A:admin@node-2# info /configure system
^^^^^^^^^
MINOR: MGMT_CORE #2203: Invalid element - currently not allowed
[/state system]
A:admin@node-2# edit-config read-only
INFO: CLI #2066: Entering read-only configuration mode
(ro)[/state system]
A:admin@node-2# info /configure system
name "node-2"
management-interface {
configuration-mode mixed
snmp {
admin-state disable
}
---snip---
The following are examples of the supported commands with a CLI path parameter.
(ex)[/state router "Base" bgp]
A:admin@node-2# info /state router bgp statistics routes-per-family ipv4
remote-routes 45
remote-active-routes 6
backup-routes 0
*(ex)[/state router "Base" bgp]
A:admin@node-2# compare /configure system
- name "test1"
+ name "test"
(ex)[/configure router "Base" bgp]
A:admin@node-2# discard /configure system
(ex)[/configure router "Base"]
A:admin@node-2# tree bgp group "mesh" add-paths ipv4
+-- receive
+-- send
[/]
A:admin@node-2# admin show configuration /configure router isis interface "system"
passive true
(ex)[/configure policy-options]
A:admin@node-2# copy policy-statement "mytest" to /configure policy-options policy-statement "my_new_policy"
(ex)[/configure router "Base" bgp]
A:admin@node-2# rename /configure policy-options policy-statement "mytest" to "another_new_policy"
The admin show commands are available in the operational mode of the MD-CLI, or they can be executed with /admin from a command context. These commands show the same configuration about as the info command but are not subject to command authorization and do not require configuration access.
See the 7450 ESS, 7750 SR, and 7950 XRS MD-CLI Command Reference Guide for information about the admin commands in the MD-CLI.
The following examples show the admin show configuration output of the running configuration in the default configuration region (configure). Other configuration regions can also be specified, including bof and li.
[/]
A:admin@node-2# admin show configuration
# TiMOS-B-20.7.B1-24 both/x86_64 Nokia 7750 SR Copyright (c) 2000-2020 Nokia.
# All rights reserved. All use subject to applicable license agreements.
# Built on Fri Aug 28 18:12:17 PDT 2020 by builder in /builds/c/207B/B1-24/panos/main/sros
# Configuration format version 20.7 revision 0
# Generated TUE SEP 15 19:17:31 2020 UTC
configure {
card 1 {
card-type iom4-e
mda 1 {
mda-type me10-10gb-sfp+
}
mda 2 {
mda-type me10-10gb-sfp+
}
fp 1 {
}
}
log {
filter 1001 {
entry 10 {
description "Collect only events of major severity or higher"
action forward
match {
severity {
gte major
}
}
}
}
log-id 99 {
description "Default System Log"
source {
main true
}
destination {
memory {
max-entries 500
}
}
}
log-id 100 {
description "Default Serious Errors Log"
filter 1001
source {
main true
}
destination {
memory {
max-entries 500
}
}
}
}
port 1/1/1 {
admin-state enable
---snip---
[/]
A:admin@node-2# admin show configuration full-context
# TiMOS-B-20.7.B1-24 both/x86_64 Nokia 7750 SR Copyright (c) 2000-2020 Nokia.
# All rights reserved. All use subject to applicable license agreements.
# Built on Fri Aug 28 18:12:17 PDT 2020 by builder in /builds/c/207B/B1-24/panos/main/sros
# Configuration format version 20.7 revision 0
# Generated TUE SEP 15 19:20:50 2020 UTC
/configure { }
/configure { card 1 }
/configure { card 1 card-type iom4-e }
/configure { card 1 mda 1 }
/configure { card 1 mda 1 mda-type me10-10gb-sfp+ }
/configure { card 1 mda 2 }
/configure { card 1 mda 2 mda-type me10-10gb-sfp+ }
/configure { card 1 fp 1 }
/configure { log }
/configure { log filter 1001 }
/configure { log filter 1001 entry 10 }
/configure { log filter 1001 entry 10 description "Collect only events of major severity or higher" }
/configure { log filter 1001 entry 10 action forward }
/configure { log filter 1001 entry 10 match }
/configure { log filter 1001 entry 10 match severity }
/configure { log filter 1001 entry 10 match severity gte major }
/configure { log log-id 99 }
/configure { log log-id 99 description "Default System Log" }
/configure { log log-id 99 source }
/configure { log log-id 99 source main true }
/configure { log log-id 99 destination }
/configure { log log-id 99 destination memory }
/configure { log log-id 99 destination memory max-entries 500 }
/configure { log log-id 100 }
/configure { log log-id 100 description "Default Serious Errors Log" }
/configure { log log-id 100 filter 1001 }
/configure { log log-id 100 source }
/configure { log log-id 100 source main true }
/configure { log log-id 100 destination }
/configure { log log-id 100 destination memory }
/configure { log log-id 100 destination memory max-entries 500 }
/configure { port 1/1/1 }
---snip---
[/]
A:admin@node-2# admin show configuration json
{
"nokia-conf:configure": {
"card": [
{
"slot-number": 1,
"card-type": "iom4-e",
"mda": [
{
"mda-slot": 1,
"mda-type": "me10-10gb-sfp+"
},
{
"mda-slot": 2,
"mda-type": "me10-10gb-sfp+"
}
],
"fp": [
{
"fp-number": 1
}
]
}
],
"log": {
"filter": [
{
"filter-id": 1001,
"entry": [
{
"entry-id": 10,
"description": "Collect only events of major severity or higher",
"action": "forward",
"match": {
"severity": {
"gte": "major"
}
}
}
]
}
],
"log-id": [
{
"id": 99,
"description": "Default System Log",
"source": {
"main": true
},
"destination": {
"memory": {
"max-entries": 500
}
}
},
{
"id": 100,
"description": "Default Serious Errors Log",
"filter": 1001,
"source": {
"main": true
},
"destination": {
"memory": {
"max-entries": 500
}
}
}
]
},
"port": [
{
"port-id": "1/1/1",
"admin-state": "enable"
},
---snip---
[/]
A:admin@node-2# admin show configuration xml
<?xml version="1.0" encoding="UTF-8"?>
<configure xmlns="urn:nokia.com:sros:ns:yang:sr:conf">
<card>
<slot-number>1</slot-number>
<card-type>imm48-sfp+2-qsfp28</card-type>
<mda>
<mda-slot>1</mda-slot>
</mda>
</card>
<card>
<slot-number>2</slot-number>
<card-type>imm36-100g-qsfp28</card-type>
<mda>
<mda-slot>1</mda-slot>
</mda>
</card>
<log>
<filter>
<filter-id>1001</filter-id>
<entry>
<entry-id>10</entry-id>
<description>"Collect only events of major severity or higher"</description>
---snip---