Setting up NSO Environment
- Activate NSO environment variables:
source /home/NSO/nso-5.3/ncsrc
- Navigate to the NSO directory:
cd /home/NSO/ncs-run/
- Launching NSO:
ncs
Now, let's proceed with setting up a minimal NSO installation.
For development purposes, the tool commonly used is netsim
, which allows network simulation. In this initial setup, we'll create a basic environment with two IOS devices:
ncs-netsim --dir ~/src/netsim create-network cisco-ios-cli-3.8 2 ios
This command creates simulated IOS devices within the specified directory.
Next, we'll initialize an NSO instance:
ncs-setup --dest ~/src --netsim-dir ~/src/netsim
cd ~/src
This sets up a development instance within the current directory. You can use the ls
command to view the files created.
ls
The ncs-netsim
script generates simulated IOS devices, while the ncs-setup
script copies default NSO configuration files and generates necessary configurations.
To start the environment, first, launch netsim
:
ncs-netsim start
Then start NSO itself:
ncs
This process may take a few seconds. Once completed, you'll have a fully functional NSO instance ready for exploration and development.
Exploring NSO
1. Understanding the Environment
# List the contents of the current directory to understand the directory structure
ls
2. Exploring NSO Documentation
# Access NSO documentation (replace <version> with your NSO version)
firefox https://developer.cisco.com/docs/nso/<version>/
3. Experimenting with Configuration
# Access NSO CLI
ncs_cli -u admin
# Configure a device (replace <device-name> with your device name)
config
devices device <device-name>
config
<configuration-commands>
commit
exit
4. Developing Custom Functionality
# Access NSO development environment
ncs_cli -C
# Create a new service package (replace <package-name> with your desired package name)
packages package <package-name> create
# Create new service models, Python scripts, or YANG models
5. Engaging with the NSO Community
# Join NSO Community Forum
firefox https://community.cisco.com/t5/network-services-orchestrator-nso/bd-p/4566-discussions-nso
These commands will help you get started exploring NSO and its various capabilities. Feel free to replace placeholders like <version>
and <device-name>
with appropriate values for your setup.