Using the NISH client in 1:n static mode

Review the following requirements before using the NISH client in 1:n static mode.

To use the NISH client in 1:n static mode, perform the following steps:

  1. Execute the nish command from the command line, providing the relative or absolute path to the connections file:

    nish [OPTIONS] [-s local-schema-file] -c connection-file

    You can specify the absolute or relative path to the connections file with the -c flag or --connection-file, in a NISH rc file or in an environment variable; see NISH rc files. In this case, the nish command can be entered without this argument. Arguments defined in the NISH rc file or using the environment variable must be supported in the current mode of operation. If an argument for another mode of operation is defined, the NISH client fails and returns an error.

    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.

    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:

    Starting nish application...
    Reading local schema...
    [==============================================================================]
    []
    root@#
     connections           + Configuration of all devices.
     environment           + Enter the environment configuration context
     Global commands:
     back                  - Move back one or more levels
     delete                - Delete an element from the candidate datastore
     exec                  - Execute commands from a file
     exit                  - Return to the previous working context or to →
    the operational root
     history               - Show the most recently entered commands
     logout                - Exit the CLI session
     pwc                   - Show the present working context
     top                   - Move to the top level of the context
     tree                  - Show the command tree under the present working context
    
  2. Navigate to the connections branch to access the SR OS node (where each node is shown under the connection list) by entering the connection command followed by the name of the node.

    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.

  3. Enter your SR OS username and password with the appropriate access and permissions.
    [connections]
    root@# connection <tab>
     test1
     test2
    
    [connections]
    root@# connection test1
    Login: admin
    admin's password: password
    
    Connecting to 172.16.123.1 port 57400
    !!! Creating unsecure connection !!!
    
    Reading MD-CLI service capabilities...
    WARNING: Unknown capability
    Reading MD-CLI service event context...
    [==============================================================================]
    
    Reading MD-CLI service schemas...
    [==============================================================================]
    
    [connections connection "test1"]
    A:admin@test1#
    

    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.

    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 user name 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. See Authentication credentials for more information about credentials.

  4. Use the usual MD-CLI navigation techniques to navigate to alternative SR OS nodes within the MD-CLI interface.

    The following example shows a multi-node navigation.

    Starting nish application...
    Reading local schema...
    [==============================================================================]
    []
    root@# connections connection ?
    
     test1
     test2
    
    []
    root@# connections connection test1
    Login: admin
    admin's password: password
    Connecting to 172.16.123.1 port 57400
    !!! Creating unsecure connection !!!
    
    Reading MD-CLI service capabilities...
    Reading MD-CLI service event context...
    [==============================================================================]
    Reading MD-CLI service schemas...
    [==============================================================================]
    
    [connections connection "test1"]
    A:admin@test1# back
    []
    root@# connections connection test2
    
    Login: admin
    admin's password: password
    Connecting to 172.16.123.2 port 57400
    !!! Creating unsecure connection !!!
    
    Reading MD-CLI service capabilities...
    Reading MD-CLI service event context...
    [==============================================================================]
    Reading MD-CLI service schemas...
    [==============================================================================]
    
    [connections connection "test2"]
    A:admin@test2# back
    
    []
    root@# connections connection test1
    
    [connections connection "test1"]
    A:admin@test1#