CentOS 7
This document describes installation from source. If you want to build an RPM, see Packaging Red Hat.
CentOS 7 restrictions:
MPLS is not supported on
CentOS 7with default kernel. MPLS requires Linux Kernel 4.5 or higher (LDP can be built, but may have limited use without MPLS)
Install required packages
Add packages:
sudo yum install git autoconf automake libtool make \
readline-devel texinfo net-snmp-devel groff pkgconfig \
json-c-devel pam-devel bison flex pytest c-ares-devel \
python-devel python-sphinx libcap-devel \
elfutils-libelf-devel libunwind-devel protobuf-c-devel
Note
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.
FRR depends on the libyang library to provide YANG/NETCONF support. Some
distributions do not offer a libyang package or offer old versions.
Therefore we provide two options below to install this library.
Note
libyang version 2.1.128 or newer is required to build FRR.
libyang version 3 is recommended, with support added in FRR 10.2.
libyang version 4 is not preferred to version 3. V4 has placed
restrictions on the use of the internal binary encoding format (LYD_LYB). As
a result internal FRR messages have to fall back to using either JSON or XML
encoding.
libyang version 5 restores support for using the binary encoding that was
removed in version 4, however, a few minor changes in FRR are required before
it will again be taken advantage of.
Option 1: Binary Install
The FRR project builds some binary libyang packages.
RPM packages are available in our RPM repository.
DEB packages are available in our DEB repository.
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 libpcre2-dev or pcre2-devel.
Option 2: Source Install
Note
Ensure that the libyang build requirements
are met before continuing. Usually this entails installing cmake and
libpcre2-dev or pcre2-devel.
git clone https://github.com/CESNET/libyang.git
cd libyang
git checkout v3.13.6
mkdir build; cd build
cmake --install-prefix /usr \
-D CMAKE_BUILD_TYPE:String="Release" ..
make
sudo make install
Note
The git tag used above is just a suggestion, not a requirement. Feel free to change it to newer or older version 3 release tags if you wish.
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 \
--libdir=/usr/lib/frr \
--libexecdir=/usr/lib/frr \
--with-moduledir=/usr/lib/frr/modules \
--enable-snmp \
--enable-multipath=64 \
--enable-user=frr \
--enable-group=frr \
--enable-vty-group=frrvty \
--disable-ldpd \
--enable-fpm \
--with-pkg-git-version \
--with-pkg-extra-version=-MyOwnFRRVersion \
SPHINXBUILD=/usr/bin/sphinx-build
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/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 tools/etc/frr/daemons /etc/frr/
sudo chown frr:frr /etc/frr/daemons
sudo install -m 640 -o frr -g frr tools/etc/frr/support_bundle_commands.conf /etc/frr/support_bundle_commands.conf
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
Create a new file /etc/sysctl.d/90-routing-sysctl.conf with the
following content:
# Sysctl for routing
#
# Routing: We need to forward packets
net.ipv4.conf.all.forwarding=1
net.ipv6.conf.all.forwarding=1
Load the modified sysctl’s on the system:
sudo sysctl -p /etc/sysctl.d/90-routing-sysctl.conf
Install frr Service
sudo install -p -m 644 tools/frr.service /usr/lib/systemd/system/frr.service
Register the systemd files
sudo systemctl preset frr.service
Enable required frr at startup
sudo systemctl enable frr
Reboot or start FRR manually
sudo systemctl start frr