Skip to main content

Quick Start

When IPRoute2-Sysrepo is initiated, it automatically undertakes the following tasks:

  1. Loads the existing Linux networking configuration into the running datastore.
  2. Subscribes to any configuration changes within the Sysrepo system.

Testing

Below will be demonstrating creating the following interfaces in one transaction using sysrepocfg tool:

  • veth interface with ipv4 and ipv6 addresses.
  • vlan interface with id 10.
  • veth interface mapped to vlan 10.
  • bridge interface.

1- Start IPRoute2-Sysrepo and keep it running:

$ sudo iproute2-sysrepo

2- Edit sysrepo running ds using NETCONF or ONM-CLI:

$./onm-cli
pc> enable
pc# sysrepo load-modules
pc# configure terminal
pc(config)# links-iproute2
pc(config-links-iproute2)# bridge br1
pc(config-bridge[name='br1'])# br-info ageing_time 1000
pc(config-bridge[name='br1'])# exit
pc(config-links-iproute2)# link dummy0
pc(config-[name='dummy0'])# type iproute2-ip-link:dummy
pc(config-[name='dummy0'])# admin-status up
pc(config-[name='dummy0'])# ip 192.1.2.1/32
pc(config-[name='dummy0'])# ip 2001:bd8::11/64
pc(config-[name='dummy0'])# master br1
pc(config-[name='dummy0'])# exit
pc(config-links-iproute2)# vlan vlan10
pc(config-[name='vlan10'])# device dummy0
pc(config-[name='vlan10'])# vlan-info protocol 802.1q
pc(config-[name='vlan10'])# vlan-info id 10
pc(config-[name='vlan10'])# exit
  • Iproute2-sysrepo will generate and execute the following iproute2 commands:
ip link add name br1 type bridge ageing_time 1000 
ip link add name dummy0 mtu 1500 up master br1 type dummy
ip address add 192.1.2.1/32 dev dummy0
ip address add 2001:bd8::11/64 dev dummy0
ip link add name vlan10 mtu 1500 link dummy0 type vlan protocol 802.1q id 10
info

With iproute2-sysrepo, a wrapper is added on top of the original iproute2's do_cmd() function. This means that do_cmd() is internally invoked to execute commands, resulting in all iproute2 commands being executed within the main thread.