Most Linux distributions as well as Apple macOS support RTRlib. The RTRlib software package includes the library and basic ready-to-use command line tools that show some of the RTRlib features.

Apple macOS

For macOS we provide a Homebrew tap to easily install the RTRlib. First, setup Homebrew [1] and then install the RTRlib package:

brew tap rtrlib/pils
brew install rtrlib


[1]Homebrew –


For Archlinux we maintain two PKGBUILDs in the Archlinux User Repository, rtrlib [2] and rtrlib-git [3]. rtrlib includes the latest official RTRlib release, rtrlib-git includes the current git master.

You can either use your favourite aur helper or execute the following commands:

sudo pacman --needed base-devel

# for the latest release
tar xf rtrlib
cd rtrlib

# for the git version
tar xf rtrlib-git
cd rtrlib-git

# for both
makepkg -sci




RTRlib is part of the official Debian package repository since Buster [4] and can be installed using apt. The following packages are available:

librtr0:includes the basis library.
librtr0-dev:includes header files etc. for developers.
rtr-tools:includes basic command line tools based on RTRlib.
librtr0-dbgsym:includes debugging symbols.
librtr-doc:includes offline documentation.

To install the minimal set of packages required for development, execute the following command:

apt install librtr0 librtr-dev

If you just want to use the RTRlib command line tools, run

apt install librtr0 rtr-tools


[4]Buster is currently in testing and scheduled for release Mid 2019.


The FRR routing project maintains a gentoo overlay [5] that contains an ebuild for the RTRlib. First, setup layman [6], then install rtrlib with the following commands:

# If this doe not work try layman -f
layman -a frr-gentoo
emerge rtrlib



From Source

The source code repository of RTRlib includes everything that you need to implement or run applications based on the RTRlib, and to use the RTRlib command line tools.

The RTRlib source code consists of the following subdirectories:

  • cmake/ CMake modules
  • doxygen/ Example code and graphics used in the Doxygen documentation
  • rtrlib/ Header and source code files of the RTRlib
  • tests/ Function tests and unit tests
  • tools/ Contains rtrclient and rpki-rov

Getting Started

To build and install the RTRlib from source, you need the following common software:

cmake version >= 2.6:
 to build the system.
libssh version >= 0.5.0:
 to establish SSH transport connections (optional but highly recommended).

Additional optional requirements are:

cmocka:to run RTRlib unit tests
doxygen:to build the RTRlib API documentation


The easiest way to get the source code is to download either the latest RTRlib release from or the current master from, and then unpack:

cd rtrlib-master
# or alternatively, clone the current git master
git clone
cd rtrlib

Then, build the library and command line tools using cmake. We recommend an out-of-source build:

# inside the main RTRlib source code directory
mkdir build && cd build
cmake -D CMAKE_BUILD_TYPE=Release ../
sudo make install

To enable debug symbols and messages, change the cmake command to:

cmake -D CMAKE_BUILD_TYPE=Debug ../

If the build command fails with any error, please consult the RTRlib README [7] and Wiki [8], you may also join our mailing list [9] or open an issue on Github [10].

Additional cmake Options and Targets

If you did not install libssh in the default directories, you can run cmake with the following parameters:

-D LIBSSH_INCLUDE=<include-directory>

To configure explicitly a directory where to place the RTRlib during installation, you can pass the following argument to cmake:


For developers, we provide a pre-build API documentation online [11] which documents the API of the latest release. Alternatively, and if Doxygen is available on your system, you can build the documentation locally as follows:

make doc

To execute the build-in tests provided by the RTRlib package, run:

make test


[8]Wiki –
[9]Mailing list –!forum/rtrlib
[10]Issue tracker –
[11]API reference –