4 This document describes installation from source. If you want to build a
5 ``deb``, see :ref:`packaging-debian`.
7 Installing Dependencies
8 -----------------------
10 .. code-block:: console
13 sudo apt-get install \
14 git autoconf automake libtool make libreadline-dev texinfo \
15 pkg-config libpam0g-dev libjson-c-dev bison flex \
16 libc-ares-dev python3-dev python3-sphinx \
17 install-info build-essential libsnmp-dev perl \
18 libcap-dev python2 libelf-dev libunwind-dev
20 .. include:: building-libunwind-note.rst
22 Note that Ubuntu 20 no longer installs python 2.x, so it must be
23 installed explicitly. Ensure that your system has a symlink named
24 ``/usr/bin/python`` pointing at ``/usr/bin/python3``.
26 In addition, ``pip`` for python2 must be installed if you wish to run
27 the FRR topotests. That version of ``pip`` is not available from the
28 ubuntu apt repositories; in order to install it:
32 curl https://bootstrap.pypa.io/pip/2.7/get-pip.py --output get-pip.py
33 sudo python2 ./get-pip.py
35 # And verify the installation
38 .. include:: building-libyang.rst
43 .. code-block:: console
45 sudo apt-get install protobuf-c-compiler libprotobuf-c-dev
50 .. code-block:: console
52 sudo apt-get install libzmq5 libzmq3-dev
54 Building & Installing FRR
55 -------------------------
57 Add FRR user and groups
58 ^^^^^^^^^^^^^^^^^^^^^^^
60 .. code-block:: console
62 sudo groupadd -r -g 92 frr
63 sudo groupadd -r -g 85 frrvty
64 sudo adduser --system --ingroup frr --home /var/run/frr/ \
65 --gecos "FRR suite" --shell /sbin/nologin frr
66 sudo usermod -a -G frrvty frr
71 .. include:: include-compile.rst
73 Install FRR configuration files
74 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
76 .. code-block:: console
78 sudo install -m 775 -o frr -g frr -d /var/log/frr
79 sudo install -m 775 -o frr -g frrvty -d /etc/frr
80 sudo install -m 640 -o frr -g frrvty tools/etc/frr/vtysh.conf /etc/frr/vtysh.conf
81 sudo install -m 640 -o frr -g frr tools/etc/frr/frr.conf /etc/frr/frr.conf
82 sudo install -m 640 -o frr -g frr tools/etc/frr/daemons.conf /etc/frr/daemons.conf
83 sudo install -m 640 -o frr -g frr tools/etc/frr/daemons /etc/frr/daemons
88 Some sysctls need to be changed in order to enable IPv4/IPv6 forwarding and
89 MPLS (if supported by your platform). If your platform does not support MPLS,
90 skip the MPLS related configuration in this section.
92 Edit :file:`/etc/sysctl.conf` and uncomment the following values (ignore the
97 # Uncomment the next line to enable packet forwarding for IPv4
100 # Uncomment the next line to enable packet forwarding for IPv6
101 # Enabling this option disables Stateless Address Autoconfiguration
102 # based on Router Advertisements for this host
103 net.ipv6.conf.all.forwarding=1
105 Reboot or use ``sysctl -p`` to apply the same config to the running system.
107 Add MPLS kernel modules
108 """""""""""""""""""""""
110 Ubuntu 20.04 ships with kernel 5.4; MPLS modules are present by default. To
111 enable, add the following lines to :file:`/etc/modules-load.d/modules.conf`:
115 # Load MPLS Kernel Modules
120 And load the kernel modules on the running system:
122 .. code-block:: console
124 sudo modprobe mpls-router mpls-iptunnel
126 If the above command returns an error, you may need to install the appropriate
127 or latest linux-modules-extra-<kernel-version>-generic package. For example
128 ``apt-get install linux-modules-extra-`uname -r`-generic``
130 Enable MPLS Forwarding
131 """"""""""""""""""""""
133 Edit :file:`/etc/sysctl.conf` and the following lines. Make sure to add a line
134 equal to :file:`net.mpls.conf.eth0.input` for each interface used with MPLS.
138 # Enable MPLS Label processing on all interfaces
139 net.mpls.conf.eth0.input=1
140 net.mpls.conf.eth1.input=1
141 net.mpls.conf.eth2.input=1
142 net.mpls.platform_labels=100000
144 Install service files
145 ^^^^^^^^^^^^^^^^^^^^^
147 .. code-block:: console
149 sudo install -m 644 tools/frr.service /etc/systemd/system/frr.service
150 sudo systemctl enable frr
155 Open :file:`/etc/frr/daemons` with your text editor of choice. Look for the
156 section with ``watchfrr_enable=...`` and ``zebra=...`` etc. Enable the daemons
157 as required by changing the value to ``yes``.
162 .. code-block:: shell