Skip to main content

Getting Started

We are working on creating compiled packages for ONM, until that work is complete you are welcome to test the system by compiling the source files.

installation

System Requirments:

Required packagaes:

sudo apt update
sudo apt install libelf-dev libbpf-dev libbsd-dev libcap-dev libmnl-dev libselinux-dev libjson-c-dev bison flex git cmake build-essential libpcre2-dev

Libyang:

git clone https://github.com/CESNET/libyang.git
cd libyang/
git checkout v2.1.148
mkdir build; cd build
cmake -D CMAKE_BUILD_TYPE:String="Release" ..
make
sudo make install

Sysrepo:

git clone https://github.com/sysrepo/sysrepo.git
cd sysrepo
git checkout v2.2.150
mkdir build; cd build
cmake -DCMAKE_BUILD_TYPE:String="Release" ..
make
sudo make install
ldconfig

JSON-C

git clone https://github.com/json-c/json-c.git
cd json-c
mkdir build; cd build
cmake ..
make
make test
sudo make install
ldconfig

ONM Packages

IPRoute2-Sysrepo

git clone --recursive https://github.com/okda-networks/iproute2-sysrepo.git
cd iproute2-sysrepo
make

After successful installation, you will need to load IPRoute2-Sysrepo yang modules to sysrepo:

cd yang/
sysrepoctl -i ietf-inet-types.yang -s .
sysrepoctl -i ietf-yang-types.yang -s .
sysrepoctl -i iproute2-cmdgen-extensions.yang -s .
sysrepoctl -i iproute2-ip-netns.yang -s .
sysrepoctl -i iproute2-ip-link.yang -s .
sysrepoctl -i iproute2-ip-rule.yang -s .
sysrepoctl -i iproute2-ip-neighbor.yang -s .
sysrepoctl -i iproute2-ip-nexthop.yang -s .
sysrepoctl -i iproute2-net-types.yang -s .
sysrepoctl -i iproute2-ip-route.yang -s .
sysrepoctl -i iproute2-tc-qdisc.yang -s .
sysrepoctl -i iproute2-tc-filter.yang -s .

ONM-CLI

git clone https://github.com/okda-networks/onm-cli.git
cd onm-cli
make

start apply configuration

currently we are working on create ONM as service, which should run all required plugins, but for now you can start them manually.

  • start the required sysrepo plugins, for example iproute2-sysrepo:
cd /path/to/iproute-sysrepo
sudo ./bin/iproute2-sysrepo
load_linux_running_config: Loading module: iproute2-ip-link data.
load_linux_running_config: Loading module: iproute2-ip-nexthop data.
load_linux_running_config: Loading module: iproute2-ip-netns data.
load_linux_running_config: Loading module: iproute2-ip-route data.
load_linux_running_config: Loading module: iproute2-tc-qdisc data.
load_linux_running_config: Loading module: iproute2-tc-filter data.
load_linux_running_config: Done loading iproute2 running configuration successfully
sr_subscribe_config: Successfully subscribed to module (iproute2-ip-link) config changes
sr_subscribe_config: Successfully subscribed to module (iproute2-ip-nexthop) config changes
sr_subscribe_config: Successfully subscribed to module (iproute2-ip-netns) config changes
sr_subscribe_config: Successfully subscribed to module (iproute2-ip-route) config changes
sr_subscribe_config: Successfully subscribed to module (iproute2-tc-qdisc) config changes
sr_subscribe_config: Successfully subscribed to module (iproute2-tc-filter) config changes
  • edit the sysrepo running datastore:
$./onm-cli
pc>enable
pc# sysrepo load-modules
pc# configure terminal
pc(config)# links-iproute2
pc(config-links-iproute2)# link new_link0
pc(config-[name='new_link0'])# ip 192.168.10.10/24
pc(config-[name='new_link0'])# admin-status up
pc(config-[name='new_link0'])# commit
[INF] EV ORIGIN: "iproute2-ip-link" "change" ID 2 priority 0 for 1 subscribers published.
[INF] EV ORIGIN: "iproute2-ip-link" "change" ID 2 priority 0 succeeded.
[INF] EV ORIGIN: "iproute2-ip-link" "done" ID 2 priority 0 for 1 subscribers published.
[INF] EV ORIGIN: "iproute2-ip-link" "done" ID 2 priority 0 succeeded.
changes applied successfully!
pc(config-[name='new_link0'])#
info

for more detail about onm-cli please check the user guide.

from iproute2-sysrepo logs, we can see generated and executed iproute2 commands for that change:

ip_sr_config_change_cb_apply: executing command: ip link add name new_link0 mtu 1500 up group 0 protodown on numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_ipv4_max_size 65536 gso_max_segs 65535 gro_max_size 65536 gro_ipv4_max_size 65536 txqueuelen 1000 arp off multicast off allmulticast off promisc off trailers on type dummy 
ip_sr_config_change_cb_apply: executing command: ip address add 192.168.10.10/24 dev new_link0