FreeBSD 11

FreeBSD 11 restrictions:

  • MPLS is not supported on FreeBSD. MPLS requires a Linux Kernel (4.5 or higher). LDP can be built, but may have limited use without MPLS

Install required packages

Add packages: (Allow the install of the package management tool if this is first package install and asked)

pkg install git autoconf automake libtool gmake json-c pkgconf \
   bison flex py36-pytest c-ares python3.6 py36-sphinx texinfo libunwind \


The libunwind library is optional but highly recommended, as it improves backtraces printed for crashes and debugging. However, if it is not available for some reason, it can simply be left out without any loss of functionality.

Make sure there is no /usr/bin/flex preinstalled (and use the newly installed in /usr/local/bin): (FreeBSD frequently provides a older flex as part of the base OS which takes preference in path)

FRR depends on the relatively new libyang library to provide YANG/NETCONF support. Unfortunately, most distributions do not yet offer a libyang package from their repositories. Therefore we offer two options to install this library.

Option 1: Binary Install

The FRR project builds some binary libyang packages.

RPM packages are at our RPM repository.

DEB packages are available as CI artifacts here.


libyang version 2.1.128 or newer is required to build FRR.


The libyang development packages need to be installed in addition to the libyang core package in order to build FRR successfully. Make sure to download and install those from the link above alongside the binary packages.

Depending on your platform, you may also need to install the PCRE development package. Typically this is libpcre2-dev or pcre2-devel.

Option 2: Source Install


Ensure that the libyang build requirements are met before continuing. Usually this entails installing cmake and libpcre2-dev or pcre2-devel.

git clone
cd libyang
git checkout v2.1.128
mkdir build; cd build
cmake --install-prefix /usr \
      -D CMAKE_BUILD_TYPE:String="Release" ..
sudo make install
rm -f /usr/bin/flex

Get FRR, compile it and install it (from Git)

This assumes you want to build and install FRR from source and not using any packages

Add frr group and user

pw groupadd frr -g 101
pw groupadd frrvty -g 102
pw adduser frr -g 101 -u 101 -G 102 -c "FRR suite" \
   -d /usr/local/etc/frr -s /usr/sbin/nologin

Download Source, configure and compile it

(You may prefer different options on configure statement. These are just an example)

git clone frr
cd frr
setenv MAKE gmake
setenv LDFLAGS -L/usr/local/lib
setenv CPPFLAGS -I/usr/local/include
ln -s /usr/local/bin/sphinx-build-3.6 /usr/local/bin/sphinx-build
./configure \
    --sysconfdir=/usr/local/etc \
    --localstatedir=/var \
    --enable-pkgsrcrcdir=/usr/pkg/share/examples/rc.d \
    --prefix=/usr/local \
    --enable-multipath=64 \
    --enable-user=frr \
    --enable-group=frr \
    --enable-vty-group=frrvty \
    --enable-configfile-mask=0640 \
    --enable-logfile-mask=0640 \
    --enable-fpm \
    --with-pkg-git-version \
gmake check
sudo gmake install

Create empty FRR configuration files

sudo mkdir /usr/local/etc/frr

For integrated config file:

sudo touch /usr/local/etc/frr/frr.conf

For individual config files:


Integrated config is preferred to individual config.

sudo touch /usr/local/etc/frr/babeld.conf
sudo touch /usr/local/etc/frr/bfdd.conf
sudo touch /usr/local/etc/frr/bgpd.conf
sudo touch /usr/local/etc/frr/eigrpd.conf
sudo touch /usr/local/etc/frr/isisd.conf
sudo touch /usr/local/etc/frr/ldpd.conf
sudo touch /usr/local/etc/frr/nhrpd.conf
sudo touch /usr/local/etc/frr/ospf6d.conf
sudo touch /usr/local/etc/frr/ospfd.conf
sudo touch /usr/local/etc/frr/pbrd.conf
sudo touch /usr/local/etc/frr/pimd.conf
sudo touch /usr/local/etc/frr/ripd.conf
sudo touch /usr/local/etc/frr/ripngd.conf
sudo touch /usr/local/etc/frr/staticd.conf
sudo touch /usr/local/etc/frr/zebra.conf
sudo chown -R frr:frr /usr/local/etc/frr/
sudo touch /usr/local/etc/frr/vtysh.conf
sudo chown frr:frrvty /usr/local/etc/frr/vtysh.conf
sudo chmod 640 /usr/local/etc/frr/*.conf

Enable IP & IPv6 forwarding

Add the following lines to the end of /etc/sysctl.conf:

# Routing: We need to forward packets

Reboot or use sysctl to apply the same config to the running system.