Table of Contents

After installing and starting Cisco NSO, we now need to prepare some network devices to be connected and managed through Cisco NSO.
Network devices for connecting to Cisco NSO can be physical, virtual, or NetSim simulator devices which is included in Cisco NSO software.

use netsim to add network devices in the lab

I have already prepared a virtual Cisco IOS-XE CSR1000V that will be used mainly during the course.

I downloaded the CSR1000V “ova” file from this link on the Cisco website and imported it into the VMware ESX server.

But in addition to CSR1000v, just to show, in this section I will add some devices via netsim simulator.

We will use the existing packages to be loaded in netsim simulator.

Here is an example to add a network via netsim simulator.

Do not forget to setup environment variable using “ncsrc” before using netsim simulator if you have rebooted nso machine or using a new bash environment. Otherwise you receive the message that the command does not exist.

source $HOME/nso-6.0/ncsrc

First as an optional step, we delete the existing network in simulator using “ncs-netsim” command and “delete-network” option.

Then we add a new network using “create-network” and “add-to-network” parameter and existing drivers in packages folder.

In our example, we add three ios device, one asa, one device with ios-xr, one with nx-os and finally one juniper device.

Then we will start the new network using “ncs-netsim start” command.

# add devices using "netsim"
cd ~/nso-instance/
ncs-netsim delete-network # if already exist
ncs-netsim create-network packages/cisco-ios-cli-6.88 3 ios
ncs-netsim add-to-network packages/cisco-asa-cli-6.16 1 asa
ncs-netsim add-to-network packages/cisco-iosxr-cli-7.43 1 iosxr
ncs-netsim add-to-network packages/cisco-nx-cli-5.23 1 nxos
ncs-netsim add-to-network packages/juniper-junos-nc-3.0 1 junos
ncs-netsim start

During the course, we can configure netsim network devices through cisco nso software. But if you want to connect to the netsim network devices directly, you can use the command “ncs-netsim cli-i <DEVICE-NAME>”.

The option “cli-i” means “Cisco IOS Style”. The other options are “cli” and “cli-c” which in order means “J-Style” (Juniper Style) and “Cisco XR Style”.

cli : J-Style
cli-c : Cisco XR Style
cli-i : Cisco IOS Style

If you connect to one of ios devices in netsim, and check some commands, you will notice that “show ip interface brief” command does not work. This is the limitation of netsim simulator.

cisco nso netsim commands limitation
cisco nso netsim commands limitation
majid@majid-ubuntu:~/nso-instance$ ncs-netsim cli-i ios1

admin connected from 192.168.2.175 using ssh on majid-ubuntu
ios1> en
ios1# show ip interface brief
-----------^
syntax error: missing display group
ios1#

run nso and netsim after restart

Now we are ready to connect cisco nso to real and also netsim simulated devices which is pre-requisite to automate and orchestrate network services. This is the main topic of the next section.

But before we move on to the next section, let’s look at how to start cisco nso and netsim devices, after we restart nso machine.

Here I have prepared a bash script showing the steps to run NSO and Netsim devices after reboot.

Set up the environment variable, run the “ncs” command to run nso and the “ncs-netsim start” command to start netsim devices. Finally, we connect to the NSO command environment

majid@majid-ubuntu:~/devnet/cisco_nso$ cat run_nso_after_restart
#!/bin/bash

echo "setup nso environment variable"
source $HOME/nso-6.0/ncsrc
echo -e "done \n"

echo "starting nso instance with running ncs command..."
echo "please wait. it takes a few minutes ..."
cd ~/nso-instance/
ncs
echo -e "done \n"

echo "starting netsim devices"
ncs-netsim start
echo -e "done \n"

echo -e "connect to nso CLI environment \n"
ncs_cli -C -u admin
majid@majid-ubuntu:~/devnet/cisco_nso$ ./run_nso_after_restart
setup nso environment variable
done

starting nso instance with running ncs command...
please wait. it takes a few minutes ...
done

starting netsim devices
DEVICE ios0 OK STARTED
DEVICE ios1 OK STARTED
DEVICE ios2 OK STARTED
DEVICE asa0 OK STARTED
DEVICE iosxr0 OK STARTED
DEVICE nxos0 OK STARTED
DEVICE junos0 OK STARTED
done

connect to nso CLI environment


admin connected from 192.168.2.175 using ssh on majid-ubuntu
admin@ncs# 
Back to: Network Automation and Service Orchestration using Cisco NSO > Install cisco NSO version 6.0 and connect to network devices

2 Comments

  1. i have 2 devices in ncs-netsim. how can i create a connection between them? in normal simulators we select a link and connect desired devices using a wire. But how it is possible in ncs-netsim.

Leave a Reply

Your email address will not be published. Required fields are marked *


Post comment