This section describes some of the main features of the NISH client, such as the interface for managing multiple SR OS nodes, navigation options, help and assistance options, direct access to Linux, SR OS node configuration, and operational state management.
The NISH client provides an MD-CLI interface to multiple SR OS nodes. The NISH client uses the model-driven networking capabilities built into SR OS to identify the software version and obtain the MD-CLI schema for each SR OS node. This allows the NISH MD-CLI to generate the correct CLI tree that can be navigated within each SR OS node context. It also ensures that each node context is specific to its own software version.
The NISH client also allows the operator to issue Linux commands on the local machine, without leaving the MD-CLI shell. This capability provides increased productivity during extended management activities.
When launched, the NISH client provides an extensible MD-CLI interface. After the trademark, legal, and disclaimer information, NISH displays the following:
Navigation in the NISH client MD-CLI interface is similar to navigation in the MD-CLI interface directly attached to a node. The NISH MD-CLI provides a YANG model-aware tree structure generated by SR OS. Users can navigate the tree structure using the tree, back, top, and exit commands, enter a branch by typing the branch name into the CLI, and enter a list by typing the list name and key.
For more information about navigation in MD-CLI, refer to the 7450 ESS, 7750 SR, and 7950 XRS MD-CLI Command Reference Guide.
Context-sensitive help and auto-completion are supported within the NISH MD-CLI.
The Linux man pages provide usage assistance for NISH. For more information, see Linux man pages.
Unlike operating directly in MD-CLI, the NISH MD-CLI provides a hybrid shell that allows users to enter Linux commands directly on the local workstation, without leaving the MD-CLI shell. This provides a flexible working environment for managing multiple nodes.
The following example shows output of a configure system setup, with execution of both Linux and MD-CLI commands:
If a command exists in both the MD-CLI and the Linux shell, the MD-CLI command takes precedence. This is shown in the following output example, which uses the time command:
The NISH MD-CLI provides the ability to see and edit individual router configurations using the transactional configuration modes available in MD-CLI (private, exclusive, global, and read-only).
The following example shows this ability:
The NISH MD-CLI provides the ability to obtain the operational state of the SR OS node, using the info command within the state tree, as shown in the following example:
The NISH client is delivered as a set of RPM packages and is supported on the CentOS 7 Linux distribution. The NISH RPMs are placed into a local directory on the target machine and installed using the YUM package manager built into CentOS 7.
Prerequisites
To install the NISH client, perform the following steps:
When installed on the Linux platform, the NISH client offers the following modes of operation:
Figure 2 shows the node configurations for the modes of operation supported by the NISH client.
In 1:1 direct mode, the NISH client connects directly to a single SR OS node and operates the MD-CLI from a local Linux workstation.
Prerequisites
To start the NISH client in direct mode, perform the following steps:
![]() | Note: When user, target host, and target port are all defined in environment variables or in a NISH rc file, and no other options are needed, the command can be reduced to nish. The reduced command option only works if the arguments for another mode of operation are not defined in environment variables or a NISH rc file. The defined arguments for another mode of operation cause the NISH client to fail to determine the mode of operation and return an error. |
Figure 3 shows the communication for 1:1 direct mode.
One of the prerequisites to start the NISH client in static mode is a connections file. The connections file contains the details of the SR OS nodes that are available for direct connections. The connections file may list multiple SR OS nodes. For more information, see Connections file.
![]() | Note: The presence of a node in the connections file does not guarantee that the referenced node is online and available to receive NISH connections. The referenced node must be configured correctly with gRPC, a user with gRPC access, and the gRPC MD-CLI service. The correct TLS-enabled connectivity is also recommended. For more information, see the 7450 ESS, 7750 SR, and 7950 XRS and VSR documentation. |
Prerequisites
To start the NISH client in static mode, perform the following step:
![]() | Note: If the path to the connections file is missing or incorrect, the NISH application starts without available nodes. The output of the command shows that the connections file is missing. |
The local schema file contains the details of the locally defined NISH MD-CLI schema; see Local schema file. For information about the other options, see Command options.
![]() | Note: When the path to the connections file is defined in an environment variable or a NISH rc file, and no other options are needed, the command can be reduced to nish. The reduced command option only works if the arguments for another mode of operation are not defined in environment variables or in a NISH rc file. The defined arguments for another mode of operation cause the NISH client to fail to determine the mode of operation and return an error. |
In the following example, the locally defined schema file is absent and the connections file is present in the same directory as the nish command:
[root@server ~]# nish -c connections-demo
When the path to the connections file is present and correct and no local schema file is defined, NISH starts with a minimal built-in MD-CLI schema. This schema defines a number of standard commands and some MD-CLI branches. The following output shows an example:
SR OS nodes are accessed by navigating to the connections branch. In the connections branch, each node is shown under the connection list.
To connect to the required node, perform the following step:
The connection list name is a device label. The connection device label is a reserved label and displays all routers that can be managed by NISH regardless of any more granular groupings. For more information about device labels, see Device labels.
When navigating to the SR OS node in the tree, NISH prompts for the username and password of an SR OS user with the appropriate access and permissions.
Navigation to alternative SR OS nodes within the MD-CLI interface is supported using the usual navigation techniques. When entering a new node, NISH prompts for the username and password for that node. The credentials for each node are cached during the established session between the NISH client and the SR OS node. For more information about credentials, see Authentication credentials.
The following example shows a multi-node navigation:
This section describes how to use the NISH client in manager mode.
Prerequisites
To start the NISH client in manager mode, perform the following step:
nish [OPTIONS] [-s local-schema-file] -m address:port
Specify the address and port number of the NISH manager with the --manager or -m flag, in a NISH rc file or in an environment variable; see NISH rc files.
The local schema file contains the details of the locally defined NISH MD-CLI schema; see Local schema file.
For information about the other options, see Command options.
![]() | Note: When the address and port number of the NISH manager are defined in environment variables or a NISH rc file, and no other options are needed, the command can be reduced to nish. The reduced command option only works if the arguments for another mode of operation are not defined in environment variables or in a NISH rc file. The defined arguments for another mode of operation cause the NISH client to fail to determine the mode of operation and return an error. |
In the following example, the local schema file is absent and the NISH manager service is bound to IP address 127.0.0.1 (the localhost) and port number 57400:
[root@server ~]# nish -m 127.0.0.1:57400
When the NISH client starts in manager mode, it makes a gRPC connection to the NISH manager service and obtains the inventory of nodes. The NISH manager uses an ON_CHANGE gRPC streaming method to ensure the inventory of nodes is continually updated.
Navigation and operation of NISH in manager mode is the same as navigation and operation of NISH in static mode. The NISH client makes direct connections to the nodes and the user traverses into them within the NISH MD-CLI; see Using 1:n static mode.
The Linux man pages provide an overview of the options and arguments for the nish command. Table 1 describes some of the options/flags that can be used when starting the NISH client.
Option/Flag | Description | References |
--insecure-credential-cache | Enables caching of SR OS node credentials in static or manager mode | |
--ca-cert -t | Specifies TLS mode | See Security |
--color NISH_COLORS | Specifies the color scheme for the NISH environment | See NISH rc files |
--no-proxy | Disables system-defined proxy settings and ignores the http_proxy and https_proxy environment variables | — |
--disable-auto-completion-authorization | Disables authorization checks for the command auto-completion 1 | — |
Note:
By default, the NISH client prompts for user credentials when connecting to each SR OS node. The user credentials are cached for the duration of the NISH client session with the node.
It is common in SR OS node cluster deployments for a user’s credentials to be the same over all devices. This is either because a centralized provisioning and management system configures the user manually on all devices, or because an external system such as TACACS or RADIUS manages the user.
The NISH client can streamline such environments by caching a single username and password combination and automatically authenticating against each node as the user navigates into them, without further prompting.
To enable this feature, start the NISH client with the --insecure-credential-cache flag.
When the NISH client is started with this feature enabled, it prompts immediately for the username and password combination, and caches this information until the NISH client is closed.
![]() | Note: Both static and manager NISH client modes support caching of credentials. |
Using device labels, an operator can group SR OS nodes within the NISH MD-CLI schema. A device label is a string value chosen by the operator to reference a group of SR OS nodes.
The connection device label is present by default and contains all SR OS nodes.
Groups are not predefined. The operator has the freedom to group nodes in the best way for the organization. The following are examples of SR OS node groupings:
![]() | Note: Device labels can only contain letters and integers. Special characters are not supported. |
The operator defines the device labels in a local schema file. The NISH schema in the NISH MD-CLI uses the device labels in the local schema file to group SR OS nodes; see Local schema file.
In the NISH client static mode, the operator applies the device labels defined in the local schema file to the nodes in the connections file; see Connections file.
In the NISH client manager mode, the operator applies the device labels defined in the local schema file to the nodes, using the SR OS Remote Manager feature. For more information about the configuration of remote management on an SR OS device, refer to the 7450 ESS, 7750 SR, and 7950 XRS MD-CLI Command Reference Guide, section “gRPC MD-CLI”.
When the device labels are defined in the local schema file and applied to the SR OS nodes, the NISH MD-CLI shows the SR OS nodes in the branch that matches the device label, for example:
![]() | Note: A device can have only one user-defined device label and has by default the system-defined connection device label. If the operator applies to an SR OS node a device label that is not defined in the local schema file, the node appears only under the connection device label. Only device labels defined in the local schema file are visible in the NISH MD-CLI. If the operator defines a device label in the local schema file and does not apply it to a node, the device label appears in the NISH MD-CLI without any member nodes. |
A NISH client operating in static mode uses a connections file. The connections file is a text file that contains the details of the SR OS nodes that are available within the NISH MD-CLI.
There are no requirements for the filename.
The following are the connection file requirements:
The connections file defines a registration for each SR OS node. Each registration has the following fields:
The following example shows a connections file with one registration:
![]() | Note: String fields are enclosed in quotation marks. |
Multiple devices are added in serial order within a connections file. The following example shows a connections file with two registrations:
After installation, there is an example connections file in /etc/nish/connections. The connections file can be edited at any time. The NISH client periodically reads the connections file and updates the list of nodes.
![]() | Note: If the connections file is updated while using the NISH client, the operator should disable auto-save. |
When the NISH client starts, it provides an initial MD-CLI tree to the user. This MD-CLI environment is based on a local MD-CLI schema definition. The NISH client provides a default built-in local schema. To enable user extensibility in the MD-CLI environment, the operator can create a locally defined MD-CLI schema file.
The local schema file is a text file that contains the details of the locally defined NISH MD-CLI schema extensibility definitions. It can be used in static and manager mode. There are no requirements for the filename.
The following are the requirements for the local schema file:
![]() | Note: It is not mandatory for the local schemas to be the same for all users of the NISH client in static or manager modes. This allows administrators and users to define customized MD-CLI schemas for their own purposes. |
To use a local schema file, start the NISH client with the --local-schema-file or --s flag followed by the relative or absolute path to the local schema file, or define the path to the local schema file in an environment variable or a NISH rc file. See NISH rc files.
The local schema file defines a structure called schemas. The schemas structure contains one or more schema branches that can be linked hierarchically. The schema branches are either local or remote.
The schema names create hierarchical structures within the MD-CLI and define device labels. The connection and all device labels are reserved and cannot be used; see Device labels.
The following example shows a local schema file with a branch containing two remote schemas. The devices schema defines the devices branch within the NISH MD-CLI. The sub-schemas UP and CP are remote schemas under the devices branch.
![]() | Note: If reserved device labels are used in the local schema file, the NISH client exits with an error, as shown in the following example: ERROR: Specified local-schema-file contains reserved schema name 'connection' |
After the initial installation, there is an example local schema file in /etc/nish/local-schema.
NISH provides the ability to place commonly used attributes into one or more run commands (rc) files. A NISH rc file defines variables used when starting the NISH client on the command line. When a NISH rc file is present, the user does not need to enter the defined variables manually on the command line.
After the NISH client installation, there is an example NISH rc file in /etc/nish/nishrc.
A NISH rc file can be located in the following places in the file system:
A user can also set the variables supported in the NISH rc file as Linux environment variables. The user-defined environment variables take precedence over the local and central NISH rc file.
User-specific command line arguments take precedence over all variables defined in the global file, the local file, or in user-defined environment variables.
Table 2 describes the supported variables in a NISH rc file.
Variable | Description | Notes |
NISH_COLORS | Specifies the color scheme for the NISH environment, using the same syntax rules as the grep command | Options:
|
NISH_CONNECTIONS_FILE | Defines the path to the connections file | See Connections file |
NISH_HOST | Defines the address of the target node | — |
NISH_LOCAL_SCHEMA_FILE | Defines the path to the local schema file | |
NISH_MANAGER | Defines the IP address and port number of the NISH manager service in the format IP:PORT | |
NISH_PORT | Defines the port of the target node | — |
NISH_SERVER_CACHE_PATH | Defines the location of the cached downloaded device schemas | — |
NISH_USER | Defines the username that used to connect with the target node | — |
The NISH client provides the ability to manage multiple nodes from a single MD-CLI shell.
When operating in 1:n manager or 1:n static mode, the NISH client generates a pseudo-node named “all” within the connection device-label (/connections connection “all” in the MD-CLI path). The operator can navigate to this pseudo-node in the same way as to a single node within the NISH client. The pseudo-node addresses supported commands to all nodes that the NISH client knows about.
In 1:n manager or 1:n static mode, the NISH client also generates a pseudo-node named “all” in each device-label context it is aware of. By navigating into the pseudo-node within a specific device-label, the supported commands are addressed to all the nodes with that specific device-label that the NISH client knows about.
The exclusive candidate configuration mode is the only supported candidate configuration mode for NISH client multi-node operation.
To enter the exclusive candidate configuration mode, use the explicit edit-config exclusive command or the implicit configure exclusive command.
When the operator tries to enter the exclusive candidate configuration mode within a multi-node context, the NISH client attempts the following actions:
A warning is displayed for every node for which the NISH client cannot obtain an exclusive lock. The operator can optionally continue the configuration activities with the remaining nodes or exit from configuration mode.
A list of the nodes for which the NISH client has successfully obtained an exclusive candidate configuration lock is stored in memory, and the MD-CLI configuration commands are executed against this set of nodes.
![]() | Note:
|
When the operator is presented with the exclusive configuration mode, the prompt changes. When the operator leaves the exclusive configuration mode, all candidate configurations on all nodes are discarded.
The NISH client provides the ability to provision a template-based configuration on multiple SR OS nodes with a specific device-label grouping. This operation is completed using the MD-CLI load command.
![]() | Note: Using the MD-CLI load command is the only supported method of multi-node configuration from the NISH client. See the 7450 ESS, 7750 SR, 7950 XRS, and VSR MD-CLI Command Reference Guide for more information about the load command. |
When using the load command within NISH for multiple node configuration, the merge and full-replace options are supported. The referenced configuration file supplied to the load command must be accessible from each individual SR OS node within the addressed set of nodes.
Example 1
If the command load merge cf3:/myconfig.cfg is issued, the myconfig.cfg file containing the configuration changes must be accessible in the root directory of cf3: on every node in the addressed set.
Example 2
If the command load merge ftp://user:password@100.0.0.1/myconfig.cfg is issued, every node in the set must be able to successfully connect to the FTP server at 100.0.0.1 and authenticate using the user and password credentials.
Committing configuration changes in a multi-node environment from the NISH client should be an atomic operation. This means that at the end of a commit operation for a specified set of nodes, every node should successfully commit the configuration or all the nodes should return to their configuration state prior to the commit.
The multi-node commit process driven from the NISH client utilizes standard SR OS MD-CLI features to achieve the atomic commit. There are three phases to the multi-node commit operation:
At every stage, each node is processed in turn, to ensure that every node is in the desired state before the next stage.
Figure 4 shows an overview of the multi-node commit process.
The NISH client can manage multiple different devices that have the same device name. This may occur in the following situations:
If the NISH client is managing multiple devices and a device-name conflict exists, the devices will be presented to the operator in the MD-CLI in the following format:
<device-name>-<ip-address>-<tcp-port>
For example, two devices both named “mydevice” with different IP addresses appear as follows:
mydevice-172.16.100.3-57400
mydevice-172.16.200.5-57400
![]() | Note: Any device with the device-name or system name “all” is always presented in the following format: <device-name>-<ip-address>-<tcp-port> |