README v4.2.4 2024-10-03
Table of contents
1. General
1.1 Extract the NED package
1.2 Install the NED package
1.2.1 Local install
1.2.2 System install
1.3 Configure the NED in NSO
2. Optional debug and trace setup
3. Dependencies
4. Sample device configuration
5. Built in live-status actions
6. Built in live-status show
7. Limitations
8. How to report NED issues and feature requests
9. How to rebuild a NED
10. Configure the NED to use ssh multi factor authentication
11. NETSIM testing
12. How to properly config 'ip access-list standard/extended' on a Ruckus device
13. The load-native-config feature1. General
This document describes the brocade-ironware NED.
The brocade-ironware NED addresses the following devices:
ServerIron ADX
IronWare MLX
FastIron Ruckus
Brocade FastIron SX800/Foundry 2402/4802
The NED connects to the devices CLI using SSH or TELNET. The configuration is done by sending native CLI commands to the device through the communication channel.
Additional README files bundled with this NED package
Common NED Features
Verified target systems
1.1 Extract the NED package
It is assumed the NED package ncs-<NSO version>-brocade-ironware-<NED version>.signed.bin has already been downloaded from software.cisco.com.
In this instruction the following example settings will be used:
NSO version: 6.0
NED version: 1.0.1
NED package downloaded to: /tmp/ned-package-store
Extract the NED package and verify its signature:
In case the signature can not be verified (for instance if no internet connection), do as below instead:
The result of the extraction shall be a tar.gz file with the same name as the .bin file:
1.2 Install the NED package
There are two alternative ways to install this NED package. Which one to use depends on how NSO itself is setup.
In the instructions below the following example settings will be used:
NSO version: 6.0
NED version: 1.0.1
NED download directory: /tmp/ned-package-store
NSO run time directory: ~/nso-lab-rundir
A prerequisite is to set the environment variable NSO_RUNDIR to point at the NSO run time directory:
1.2.1 Local install
This section describes how to install a NED package on a locally installed NSO (see "NSO Local Install" in the NSO Installation guide).
It is assumed the NED package has been been unpacked to a tar.gz file as described in 1.1.
Untar the tar.gz file. This creates a new sub-directory named:
brocade-ironware-<NED major digit>.<NED minor digit>:Install the NED into NSO, using the ncs-setup tool:
Open a NSO CLI session and load the new NED package like below:
Alternatively the tar.gz file can be installed directly into NSO. Then skip steps 1 and 2 and do like below instead:
Set the environment variable NED_ROOT_DIR to point at the NSO NED package:
1.2.2 System install
This section describes how to install a NED package on a system installed NSO (see "NSO System Install" in the NSO Installation Guide).
It is assumed the NED package has been been unpacked to a tar.gz file as described in 1.1.
Do a NSO backup before installing the new NED package:
Start a NSO CLI session and fetch the NED package:
Install the NED package (add the argument replace-existing if a previous version has been loaded):
Load the NED package
1.3 Configure the NED in NSO
This section describes the steps for configuring a device instance using the newly installed NED package.
Start a NSO CLI session:
Enter configuration mode:
Configure a new authentication group (my-group) to be used for this device:
Configure a new device instance (example: dev-1):
If configured protocol is ssh, do fetch the host keys now:
Finally commit the configuration
Verify configuration, using a sync-from.
If the sync-from was not successful, check the NED configuration again.
2. Optional debug and trace setup
It is often desirable to see details from when and how the NED interacts with the device(Example: troubleshooting)
This can be achieved by configuring NSO to generate a trace file for the NED. A trace file contains information about all interactions with the device. Messages sent and received as well as debug printouts, depending on the log level configured.
NSO creates one separate trace file for each device instance with tracing enabled. Stored in the following location:
$NSO_RUNDIR/logs/ned-brocade-ironware-cli-1.0-<device name>.trace
Do as follows to enable tracing in one specific device instance in NSO:
Start a NSO CLI session:
Enter configuration mode:
Enable trace raw:
Alternatively, tracing can be enabled globally affecting all configured device instances:
Configure the log level for printouts to the trace file:
Alternatively the log level can be set globally affecting all configured device instances using this NED package.
The log level 'info' is used by default and the 'debug' level is the most verbose.
IMPORTANT: Tracing shall be used with caution. This feature does increase the number of IPC messages sent between the NED and NSO. In some cases this can affect the performance in NSO. Hence, tracing should normally be disabled in production systems.
An alternative method for generating printouts from the NED is to enable the Java logging mechanism. This makes the NED print log messages to common NSO Java log file.
$NSO_RUNDIR/logs/ncs-java-vm.log
Do as follows to enable Java logging in the NED
Start a NSO CLI session:
Enter configuration mode:
Enable Java logging with level all from the NED package:
Configure the NED to log to the Java logger
Alternatively Java logging can be enabled globally affecting all configured device instances using this NED package.
IMPORTANT: Java logging does not use any IPC messages sent to NSO. Consequently, NSO performance is not affected. However, all log printouts from all log enabled devices are saved in one single file. This means that the usability is limited. Typically single device use cases etc.
SSHJ DEBUG LOGGING For issues related to the ssh connection it is often useful to enable full logging in the SSHJ ssh client. This will make SSHJ print additional log entries in $NSO_RUNDIR/logs/ncs-java-vm.log:
3. Dependencies
This NED has the following host environment dependencies:
Java 1.8 (NSO version < 6.2)
Java 17 (NSO version >= 6.2)
Gnu Sed
Dependencies for NED recompile:
Apache Ant
Bash
Gnu Sort
Gnu awk
Grep
Python3 (with packages: re, sys, getopt, subprocess, argparse, os, glob)
4. Sample device configuration
Configuration for the ServerIron ADX device:
Note:
for the 'snmp-server community' entry, the related value(test1) will be encrypted by the device. So, in order to have a synchronization between the NED and the device, the NED will decrypt the value, based on a mapping table stored on the NED side.
Configuration for the IronWare MLX device:
Configuration for the FastIron RUCKUS device:
Example 1: create a banner
Note:
for the 'snmp-server community', the values are also encrypted by the device, but only for the second format('test2'). In this case, there is no mapping table available (compared to the ADX device), and the related encrypted values are stored into Operational DB(ODB). This is transparent for the user.
Example setting a banner:
Important notes:
the old banner is first deleted, otherwise the new text is appended to the old text of the banner
new lines are given by the user with "\r\n"
if a space is present at the beginning of a new line, the device will trim that space. Hence, please don't start a new row with spaces, to avoid compare-config diffs.
the device will use a delimiter character, for separating the banner's text. Its default value is "{". The user must not use this value when setting the text. This delimiter is also configurable under ned-settings:
admin@ncs(config-device-dev-1)# ned-settings brocade-ironware banner-delimeter-fastiron. Please don't forget to usedisconnect()andconnect()to enable the ned-setting. For instance, if the delimiter is changed to "z", at the first occurence of letter "z" the text of the banner is considered finishedthe last line of the banner must not end with "\r\n".
Example 2: create snmp-server hosts
On the device, entries above appear like:
Note:
At sync-from, NED will check what are the CDB related data for "community" and "port" and will build the entire snmp-server host entries, similar as when they were created. This way, the compare-config diffs are avoided. For those snmp-server host entries that are already present on the device, there is no deletion operation supported, since the device requires both community and port parameters to be provided at deletion. For the version "v3", entries appear completely on the device. The NED knows if an entry on the device is incomplete, by looking at the five dots
......
5. Built in live-status actions
The NED includes support for operational show commands and the following action can be used:
devices device live-status exec show <any>.
Example for the MLX device:
6. Built in live-status show
Examples of running live-status commands for the MLX device:
The time for which values are stored in the memory is called ttl(time to live) and this is configurable under ned-settings:
50 represents the value of 50 seconds.
7. Limitations
7.1 ipv6 access-list
When configuring a permit or deny statement, a 'sequence' number will be assigned automatically by the device. The default value is 10, and then 20, 30 and so on. In order to avoid compare-config diffs between the NED and the target device, the user must provide explicitly the 'sequence' number when a permit or deny statement is set.
Example: Make sure to provide 'sequence' number like below:
instead of:
7.2 web-management https
On the Ruckus device, when 'https' is set, the value is not visible (this is a default value). If the user will set again the same value, the device returns a warning: "HTTPS already enabled".
In the ncs_cli, similar to the device, the 'https' is not visible. To be sure the 'https' value is set, the user can run the following command:
show full | include https | details.
If the output is: "ruckus:web-management https", it means the 'https' is already set. Trying to set it again will explicitly write the value
into CDB and will send the command to the device.
The user can disable the 'https' by running the following command:
no ruckus:web-management https.
8. How to report NED issues and feature requests
Issues like bugs and errors shall always be reported to the Cisco NSO NED team through the Cisco Support channel:
The following information is required for the Cisco NSO NED team to be able to investigate an issue:
Do as follows to gather the necessary information needed for your device, here named 'dev-1':
Enable full debug logging in the NED
Configure the NSO to generate a raw trace file from the NED
If the NED already had trace enabled, clear it in order to submit only relevant information
Do as follows for NSO 6.4 or newer:
Do as follows for older NSO versions:
Run a compare-config to populate the trace with initial device config
Reproduce the found issue using ncs_cli or your NSO service. Write down each necessary step in a reproduction report.
In addition to this, it helps if you can show how it should work by manually logging into the device using SSH/TELNET and type the relevant commands showing a successful operation.
Gather the reproduction report and a copy of the raw trace file containing data recorded when the issue happened.
Contact the Cisco support and request to open a case. Provide the gathered files together with access details for a device that can be used by the Cisco NSO NED when investigating the issue.
Requests for new features and extensions of the NED are handled by the Cisco NSO NED team when applicable. Such requests shall also go through the Cisco support channel.
The following information is required for feature requests and extensions:
Set the config on the real device including all existing dependent config and run sync-from to show it in the trace.
Run sync-from # devices device dev-1 sync-from
Attach the raw trace to the ticket
List the config you want implemented in the same syntax as shown on the device
SSH/TELNET access to a device that can be used by the Cisco NSO NED team for testing and verification of the new feature. This usually means that both read and write permissions are required. Pseudo access via tools like Webex, Zoom etc is not acceptable. However, it is ok with access through VPNs, jump servers etc as long as we can connect to the NED via SSH/TELNET.
9. How to rebuild a NED
To rebuild the NED do as follows:
When the NED has been successfully rebuilt, it is necessary to reload the package into NSO.
10. Configure the NED to use ssh multi factor authentication
This NED supports multi factor authentication (MFA) using the ssh authentication method 'keyboard-interactive'.
Some additional steps are required to enable the MFA support:
Verify that your NSO version supports MFA. This is configurable as additional settings in the authentication group used by the device instance.
Enter a NSO CLI and enter the following and do tab completion:
If 'mfa' is displayed in the output like above, NSO has MFA support enabled. In case MFA is not supported it is necessary to upgrade NSO before proceeding.
Implement the authenticator executable. The MFA feature relies on an external executable to take care of the client part of the multi factor authentication. The NED will automatically call this executable for each challenge presented by the ssh server and expects to get a proper response in return.
The executable can be a simple shell script or a program implemented in any programming language.
The required behaviour is like this:
read one line from stdin The line passed from the NED will be a semi colon separated string containing the following info:
The elements for device name, user, password and opaque corresponds to what has been configured in NSO. The ssh server name, instruction and prompt are given by the ssh server during the authentication step.
Each individual element in the semi colon separated list is Base64 encoded.
Extract the challenge based on the contents above.
Print a response matching the challenge to stdout and exit with code 0
In case a matching response can not be given do exit with code 2
Below is a simple example of an MFA authenticator implemented in Python3:
Configure the authentication group used by the device instance to enable MFA. There are two configurables available:
executable The path to the external multi factor authentication executable (mandatory).
opaque Opaque data that will passed as a cookie element to the executable (optional).
Try connecting to the device.
10.1 Trouble shooting
In case of connection problems the following steps can help for debugging:
Enable the NED trace in debug level:
Try connect again
Inspect the generated trace file.
Verify that the ssh client is using the external authenticator executable:
Verify that the executable is called with the challenges presented by the ssh server:
Check for any errors reported by the NED when calling the executable
11. NETSIM testing
NETSIM is configured to emulate the ADX device by default. To enable the MLX behaviour set the following env. variable
before building netsim:
export NETSIM_BROCADE_DEV_TYPE=MLX
To enable the RUCKUS behavior, set the env. variable like this:
export NETSIM_BROCADE_DEV_TYPE=RUCKUS
To enable the FastIron SX behavior, set the env. variable like this:
export NETSIM_BROCADE_DEV_TYPE=FSX
12. How to properly config 'ip access-list standard/extended' on a Ruckus device
Important notes:
both 'ip access-list standard' and 'ip access-list extended' list are configurable in a similar manner. Below you can find more details and examples referring to the 'extended' case
rule 'sequence number' must always be provided by the user to avoid compare-config diffs
on ruckus device, rules sequence numbers are ordered in ascending order
in ncs_cli, the last created rule is added at the end of the list, no matter what the sequence number has, if not chosen otherwise by the user
to add a new rule with a smaller sequence number, the user must use the
insertcommand and place the rule in the right position withafterorbeforeexisting sequence numbersif a new rule is not created after/before the correct existing rule sequnce number, the user can use the
movecommand orsync-fromcommand to avoid out-of-sync issuesto change an existing rule, the rule must be deleted first and then created withe new values. Otherwise the device returns an error: "Error:ACL filter add failed! (Duplicate filter found. ErrorCode:2|2|1021)".
Below, you can see an example on how to create an ip access-list extended:
One important thing to mention here is that the 'sequence number' must be provisioned by the user all the time. Even if the device accepts rules without mentioning the sequence number, a sequence number will be added automatically by the device itself. Hence, to avoid further compare-config diffs, the sequence number must be provided by the user from the beginning.
If the user continues to add more rules to the 'acle50' access-list, then he must pay attention to the sequece number. The device will display the rules in ascending order according to the sequence number. On the other hand, in ncs_cli the last created rule is added at the end of the list, no matter what is the sequence number, if not chosen otherwise by the user. For example, if the sequence number of the new rule is greater than all the sequence numbers of the existing rules, then the rule is simple created, as below:
As you can see below, the rule is added last:
Create a new rule with sequence number smaller than the existing sequence numbers rules
Let's suppose the user wants to create a new rule with sequence number 10, which must come after existing 'sequence 7 deny ospf any any log', to respect the ascending order.
To be able to do that, the user must use the insert command and move the rule with before or after keywords.
First, let's create the remark associated to the new rule and then the rule itself:
This is how the access-list looks at the moment:
Now, let's create the rule with sequence number 10:
Using insert will help us move the new created rule on the right position. Now, our new list looks like below:
What to do if a rule is not correctly created using insert
If the user creates a new rule with a sequence number smaller than the sequence numbers of the existing rules, the new rule is added last. In our list above, let's create a new rule entry:
As you can see, this is added last. Because the device orders rules in ascending order, we get compare-config diffs.
To avoid this, the user has 2 options:
use
sync-fromcommand to be in sync again and have the right order, i.e. sequence 20 after sequence 10use the
movecommand to bring the sequence 20 rule in the right position (after sequence 10)
Example for use-case 2:
There is no new command to be sent to the device. Still, a connect to the device and a computation of the transaction ID are performed here.
Now, looking at the ncs_cli, the list will have the rules in ascending order, similar to the device order:
How to update an existing rule sequence number
If a sequence number is needed to be changed, then the existing sequence number must be deleted first, otherwise the device returns the following error: "Error:ACL filter add failed! (Duplicate filter found. ErrorCode:2|2|1021)". Let's suppose we want to change the rule with sequence 10.
Please check the example below:
This is our current list, before commit, where sequence 10 has been deleted:
Current list after changed the rule with sequence 10:
Below, you can see the changes and how they will sent to the device with `commit dry-run outformat native' command:
After changing the rule with sequence 10, we can see the changed rule ocuppies the right position:
13. The load-native-config feature
The brocade-ironware NED supports the load-native-config feature. The user can check if a specific configuration is supported or not by the NED.
Since the NED covers different YANG modules, the NED usually chooses the right YANG module when a connect operation is performed.
Since the load-native-config feature should be used without a real connection towards a device, a ned-setting has been added
to by-pass the connect and creates a dummy connection.
In order to use that, the user must set the following ned-setting:
Once the version of the device is set and the dummy connection is established, then the load-native-config command can be called.
Please note that when the NED must connect to the real device, the ned-setting above must be set on empty string(""), which is the default value.
The user can choose to load the configuration by providing a configuration string or to load the configuration from a file. An important thing to take into account is that the configuration must be provided in the native format of the device. The current devices contain an '\r\n' at the end of each line and each configuration contains, at the beginning, the string 'Current configuration:'. Therefore, these must be provided by the user when the 'load-native-config' command is called.
Examples:
providing a string with device's native configuration
providing the configuration from a file
In the 'file-config.txt' file, the configuration can be copied directly from the target device, i.e. get the output after running the 'show running-config' command.
Last updated
Was this helpful?

