Fedora 24

This document describes installation from source. If you want to build an RPM, see Packaging Red Hat.

Install required packages

Add packages:

sudo dnf install git autoconf automake libtool make gawk \
  readline-devel texinfo net-snmp-devel groff pkgconfig \
  json-c-devel pam-devel pytest bison flex c-ares-devel \
  python3-devel python3-sphinx

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 binary libyang packages, which we offer for download here.

Warning

libyang version 0.16.74 or newer is required to build FRR.

Note

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 libpcre-dev or pcre-devel.

Note

For Debian-based systems, the official libyang package requires recent versions of swig (3.0.12) and debhelper (11) which are only available in Debian buster (10). However, libyang packages built on Debian buster can be installed on both Debian jessie (8) and Debian stretch (9), as well as various Ubuntu systems. The python3-yang package will not work, but the other packages (libyang-dev is the one needed for FRR) will.

Option 2: Source Install

Note

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

git clone https://github.com/CESNET/libyang.git
cd libyang
mkdir build; cd build
cmake -DENABLE_LYD_PRIV=ON -DCMAKE_INSTALL_PREFIX:PATH=/usr ..
make
sudo make install

When building libyang on CentOS 6, it’s also necessary to pass the -DENABLE_CACHE=OFF parameter to cmake.

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 groups and user

sudo groupadd -g 92 frr
sudo groupadd -r -g 85 frrvty
sudo useradd -u 92 -g 92 -M -r -G frrvty -s /sbin/nologin \
  -c "FRR FRRouting suite" -d /var/run/frr frr

Download Source, configure and compile it

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

git clone https://github.com/frrouting/frr.git frr
cd frr
./bootstrap.sh
./configure \
    --bindir=/usr/bin \
    --sbindir=/usr/lib/frr \
    --sysconfdir=/etc/frr \
    --libdir=/usr/lib/frr \
    --libexecdir=/usr/lib/frr \
    --localstatedir=/var/run/frr \
    --with-moduledir=/usr/lib/frr/modules \
    --enable-snmp=agentx \
    --enable-multipath=64 \
    --enable-user=frr \
    --enable-group=frr \
    --enable-vty-group=frrvty \
    --disable-exampledir \
    --enable-fpm \
    --with-pkg-git-version \
    --with-pkg-extra-version=-MyOwnFRRVersion
make
make check
sudo make install

Create empty FRR configuration files

sudo mkdir /var/log/frr
sudo mkdir /etc/frr
sudo touch /etc/frr/zebra.conf
sudo touch /etc/frr/bgpd.conf
sudo touch /etc/frr/ospfd.conf
sudo touch /etc/frr/ospf6d.conf
sudo touch /etc/frr/isisd.conf
sudo touch /etc/frr/ripd.conf
sudo touch /etc/frr/ripngd.conf
sudo touch /etc/frr/pimd.conf
sudo touch /etc/frr/ldpd.conf
sudo touch /etc/frr/nhrpd.conf
sudo touch /etc/frr/eigrpd.conf
sudo touch /etc/frr/babeld.conf
sudo chown -R frr:frr /etc/frr/
sudo touch /etc/frr/vtysh.conf
sudo chown frr:frrvty /etc/frr/vtysh.conf
sudo chmod 640 /etc/frr/*.conf

Install daemon config file

sudo install -p -m 644 redhat/daemons /etc/frr/
sudo chown frr:frr /etc/frr/daemons

Edit /etc/frr/daemons as needed to select the required daemons

Look for the section with watchfrr_enable=... and zebra=... etc. Enable the daemons as required by changing the value to yes

Enable IP & IPv6 forwarding (and MPLS)

Create a new file /etc/sysctl.d/90-routing-sysctl.conf with the following content: (Please make sure to list all interfaces with required MPLS similar to net.mpls.conf.eth0.input=1)

# Sysctl for routing
#
# Routing: We need to forward packets
net.ipv4.conf.all.forwarding=1
net.ipv6.conf.all.forwarding=1
#
# Enable MPLS Label processing on all interfaces
net.mpls.conf.eth0.input=1
net.mpls.conf.eth1.input=1
net.mpls.conf.eth2.input=1
net.mpls.platform_labels=100000

Load the modified sysctl’s on the system:

sudo sysctl -p /etc/sysctl.d/90-routing-sysctl.conf

Create a new file /etc/modules-load.d/mpls.conf with the following content:

# Load MPLS Kernel Modules
mpls-router
mpls-iptunnel

And load the kernel modules on the running system:

sudo modprobe mpls-router mpls-iptunnel

Install frr Service and redhat init files

sudo install -p -m 644 redhat/frr.service /usr/lib/systemd/system/frr.service
sudo install -p -m 755 redhat/frr.init /usr/lib/frr/frr

Enable required frr at startup

sudo systemctl enable frr

Reboot or start FRR manually

sudo systemctl start frr