]> git.proxmox.com Git - mirror_frr.git/blame - doc/developer/building-frr-for-ubuntu2004.rst
Merge pull request #13430 from opensourcerouting/feature/rip_allow-ecmp_limit
[mirror_frr.git] / doc / developer / building-frr-for-ubuntu2004.rst
CommitLineData
252ca75b
MS
1Ubuntu 20.04 LTS
2================
3
4This document describes installation from source. If you want to build a
5``deb``, see :ref:`packaging-debian`.
6
7Installing Dependencies
8-----------------------
9
10.. code-block:: console
11
12 sudo apt update
13 sudo apt-get install \
14 git autoconf automake libtool make libreadline-dev texinfo \
77f3acb4
CH
15 pkg-config libpam0g-dev libjson-c-dev bison flex \
16 libc-ares-dev python3-dev python3-sphinx \
ab140d61 17 install-info build-essential libsnmp-dev perl \
afb8fe93
DL
18 libcap-dev python2 libelf-dev libunwind-dev
19
20.. include:: building-libunwind-note.rst
252ca75b
MS
21
22Note that Ubuntu 20 no longer installs python 2.x, so it must be
23installed explicitly. Ensure that your system has a symlink named
24``/usr/bin/python`` pointing at ``/usr/bin/python3``.
25
26In addition, ``pip`` for python2 must be installed if you wish to run
27the FRR topotests. That version of ``pip`` is not available from the
28ubuntu apt repositories; in order to install it:
29
30.. code-block:: shell
31
ef0a84ed 32 curl https://bootstrap.pypa.io/pip/2.7/get-pip.py --output get-pip.py
01ffd5b1 33 sudo python2 ./get-pip.py
252ca75b
MS
34
35 # And verify the installation
36 pip2 --version
37
38.. include:: building-libyang.rst
39
40Protobuf
41^^^^^^^^
42
43.. code-block:: console
44
45 sudo apt-get install protobuf-c-compiler libprotobuf-c-dev
46
47ZeroMQ
48^^^^^^
49
50.. code-block:: console
51
52 sudo apt-get install libzmq5 libzmq3-dev
53
54Building & Installing FRR
55-------------------------
56
57Add FRR user and groups
58^^^^^^^^^^^^^^^^^^^^^^^
59
60.. code-block:: console
61
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
67
68Compile
69^^^^^^^
70
71.. include:: include-compile.rst
72
73Install FRR configuration files
74^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
75
76.. code-block:: console
77
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
84
85Tweak sysctls
86^^^^^^^^^^^^^
87
88Some sysctls need to be changed in order to enable IPv4/IPv6 forwarding and
89MPLS (if supported by your platform). If your platform does not support MPLS,
90skip the MPLS related configuration in this section.
91
92Edit :file:`/etc/sysctl.conf` and uncomment the following values (ignore the
93other settings):
94
95::
96
97 # Uncomment the next line to enable packet forwarding for IPv4
98 net.ipv4.ip_forward=1
99
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
104
105Reboot or use ``sysctl -p`` to apply the same config to the running system.
106
107Add MPLS kernel modules
108"""""""""""""""""""""""
109
110Ubuntu 20.04 ships with kernel 5.4; MPLS modules are present by default. To
111enable, add the following lines to :file:`/etc/modules-load.d/modules.conf`:
112
113::
114
115 # Load MPLS Kernel Modules
116 mpls_router
117 mpls_iptunnel
118
119
120And load the kernel modules on the running system:
121
122.. code-block:: console
123
124 sudo modprobe mpls-router mpls-iptunnel
125
126If the above command returns an error, you may need to install the appropriate
127or latest linux-modules-extra-<kernel-version>-generic package. For example
128``apt-get install linux-modules-extra-`uname -r`-generic``
129
130Enable MPLS Forwarding
131""""""""""""""""""""""
132
133Edit :file:`/etc/sysctl.conf` and the following lines. Make sure to add a line
134equal to :file:`net.mpls.conf.eth0.input` for each interface used with MPLS.
135
136::
137
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
143
144Install service files
145^^^^^^^^^^^^^^^^^^^^^
146
147.. code-block:: console
148
149 sudo install -m 644 tools/frr.service /etc/systemd/system/frr.service
150 sudo systemctl enable frr
151
152Enable daemons
153^^^^^^^^^^^^^^
154
155Open :file:`/etc/frr/daemons` with your text editor of choice. Look for the
156section with ``watchfrr_enable=...`` and ``zebra=...`` etc. Enable the daemons
157as required by changing the value to ``yes``.
158
159Start FRR
160^^^^^^^^^
161
162.. code-block:: shell
163
164 systemctl start frr