A package wrapping netsim commands. Available only for NSO local-install. Tested on Ubuntu 16.04.
netsim-tool enables you to easily add new netsim networks, multiple devices to existing networks and most of other commands otherwise available with ncs-netsim command. List of available commands below.
- create-network
- create-device
- delete-network
- add-device
- start
- stop
- is-alive
- list
- load
- update-network
Apart from this README, please refer to the python code and associated YANG file.
- NSO 4.3.6+ Local installation (Probably works on older versions aswell but not tested)
- Python 2.7+ or 3+
- Python Popen module
make -C /packages/netsim-tool/src all
User can configure default ports of running netsim processes and netsim-dir, which represents the folder where netsim network and devices are created.
In this way it's easy to switch between multiple netsim networks. Users should specify absolute path for a directory where they want to create the network.
Default value is /netsim-lab.
admin@ncs(config)# netsim config netsim-dir /ios-netsim-lab
New networks can be created by using create-network or create-device actions. Both will create new network and load devices to NSO cdb.
admin@ncs# netsim create-device device-name R1 ned-id cisco-ios
Users can add one or multiple devices to existing networks. This action also creates devices and loads them to NSO cdb.
netsim add-device device-name [ R2 R3 R4 ] ned-id cisco-ios
Netsim devices can be started or stopped using start action. If user provides list of devices then only those will be started. If he skips the list all of netsim devices will be started.
admin@ncs(config)# netsim start device-name [ R1 R3 ]
Using netsim-tool load users can load existing netsim networks into new NSO running instance. Issuing this command will load devices in netsim network specified in config->netsim-dir.
admin@ncs(config)# netsim load
When changing NSO versions, existing netsim networks might stop working. With update-network action users can change schema files (.fxs)
in the network with the ones from current NSO, which enables netsim devices to work with current version.
netsim update-network ncs-run /home/cisco/ncs-run