Skip to main content

User Guide

This guide provides instructions on using the onm-cli.

Table of Contents

generating the commands

To begin, you'll need to generate commands from Sysrepo's YANG modules:

pc> enable 
pc# sysrepo load-modules
yang commands generated successfully for module=ietf-yang-schema-mount
yang commands generated successfully for module=sysrepo
yang commands generated successfully for module=ietf-netconf-acm
yang commands generated successfully for module=ietf-yang-library
yang commands generated successfully for module=sysrepo-monitoring
yang commands generated successfully for module=sysrepo-plugind
yang commands generated successfully for module=iproute2-ip-link
yang commands generated successfully for module=iproute2-ip-netns
yang commands generated successfully for module=iproute2-ip-nexthop
yang commands generated successfully for module=iproute2-ip-route
yang commands generated successfully for module=iproute2-tc-filter
yang commands generated successfully for module=iproute2-tc-qdisc
pc#

configuring running datastore

  • Once commands are generated, under the config mode, you'll see all generated commands:
pc# configure terminal 
pc(config)#
quit quit cli
exit exit to prev mode
commit commit changes to sysrepo cdb
show print the candidate/running config
discard-changes discard all current changes
no delete configs
nacm-ietf configure nacm-ietf (ietf-netconf-acm) [contain]
links-iproute2 configure links-iproute2 (iproute2-ip-link) [contain]
netnses-iproute2 configure netnses-iproute2 (iproute2-ip-netns) [contain]
routes-iproute2 configure routes-iproute2 (iproute2-ip-route) [contain]
qdiscs-iproute2 configure qdiscs-iproute2 (iproute2-tc-qdisc) [contain]
classes-iproute2 configure classes-iproute2 (iproute2-tc-qdisc) [contain]
pc(config)#
  • For each YANG module, a new sub-config mode is generated. Under that mode, you can configure the running DS for that module:
pc(config)# links-iproute2 
pc(config-links-iproute2)# link eth1
pc(config-link[name='eth1'])# type iproute2-ip-link:dummy
pc(config-link[name='eth1'])# ip 192.168.10.24/24
pc(config-link[name='eth1'])# mtu 1405
pc(config-link[name='eth1'])# show config-candidate links-iproute2 link eth1
link eth1
mtu 1405
ip 192.168.10.24/24
type iproute2-ip-link:dummy
  • To commit changes:
pc(config-link[name='eth1'])# commit
changes applied successfully!
pc(config-link[name='eth1'])# show config-running links-iproute2 link eth1
link eth1
mtu 1405
admin-status down
group 0
advance protodown on
advance numtxqueues 1
advance numrxqueues 1
advance gso_max_size 65536
advance gso_ipv4_max_size 65536
advance gso_max_segs 65535
advance gro_max_size 65536
advance gro_ipv4_max_size 65536
advance txqueuelen 1000
modes arp off
modes multicast off
modes allmulticast off
modes promisc off
modes trailers on
ip 192.168.10.24/24
type iproute2-ip-link:dummy
note

The default commands will automatically be added to the running configuration.

  • To discard configuration changes in the candidate datastore:
pc(config)# discard-changes
  • To delete config:
pc(config-links-iproute2)# no link eth1
pc(config-links-iproute2)# commit
changes applied successfully!
pc(config-links-iproute2)#

Viewing Configuration

  • To view configuration:
pc(config)# show config-running <module-name> 
pc(config)# show config-candidate <module-name>
pc(config)# show config-running <module-name>
  • To check the diff between candidate and running:
pc(config)# show config-candidate links-iproute2 diff
no config diff between candidate and running!

Installing/Uninstalling YANG Modules in Sysrepo

  • To list all installed YANG modules:
pc# sysrepo list-modules 
[+] ietf-yang-metadata
[+] yang
[+] ietf-inet-types
[+] ietf-yang-types
[+] ietf-yang-schema-mount
[+] ietf-yang-structure-ext
[+] ietf-datastores
[+] sysrepo
[+] ietf-netconf-acm
[+] ietf-factory-default
  • To install a module:
pc# sysrepo install-module 
<module-file> module yang file .yang
  • To uninstall:
pc# sysrepo remove-module 
<module-name> module name ex:ietf-vrrp