]> git.proxmox.com Git - mirror_frr.git/blame - doc/user/installation.rst
configure: Default to 16 way ecmp on compilation
[mirror_frr.git] / doc / user / installation.rst
CommitLineData
0efdf0fe 1.. _installation:
42fc5d26 2
42fc5d26 3Installation
717b4866 4============
42fc5d26
QY
5
6.. index:: How to install FRR
42fc5d26 7.. index:: Installation
42fc5d26 8.. index:: Installing FRR
42fc5d26 9.. index:: Building the system
42fc5d26
QY
10.. index:: Making FRR
11
717b4866 12This section covers the basics of building, installing and setting up FRR.
44f2550e 13
717b4866
QY
14From Packages
15-------------
44f2550e 16
717b4866
QY
17The project publishes packages for Red Hat, Centos, Debian and Ubuntu on the
18`GitHub releases <https://github.com/FRRouting/frr/releases>`_. page. External
19contributors offer packages for many other platforms including \*BSD, Alpine,
20Gentoo, Docker, and others. There is currently no documentation on how to use
21those but we hope to add it soon.
42fc5d26 22
717b4866
QY
23From Snapcraft
24--------------
42fc5d26 25
717b4866
QY
26In addition to traditional packages the project also builds and publishes
27universal Snap images, available at https://snapcraft.io/frr.
44f2550e 28
717b4866
QY
29From Source
30-----------
42fc5d26 31
717b4866
QY
32Building FRR from source is the best way to ensure you have the latest features
33and bug fixes. Details for each supported platform, including dependency
34package listings, permissions, and other gotchas, are in the developer's
35documentation. This section provides a brief overview on the process.
42fc5d26 36
717b4866
QY
37Getting the Source
38^^^^^^^^^^^^^^^^^^
42fc5d26 39
717b4866
QY
40FRR's source is available on the project
41`GitHub page <https://github.com/FRRouting/frr>`_.
42fc5d26 42
717b4866 43.. code-block:: shell
42fc5d26 44
717b4866 45 git clone https://github.com/FRRouting/frr.git
42fc5d26 46
717b4866
QY
47When building from Git there are several branches to choose from. The
48``master`` branch is the primary development branch. It should be considered
49unstable. Each release has its own branch named ``stable/X.X``, where ``X.X``
50is the release version.
42fc5d26 51
717b4866
QY
52In addition, release tarballs are published on the GitHub releases page
53`here <https://github.com/FRRouting/frr/releases>`_.
42fc5d26 54
717b4866
QY
55Configuration
56^^^^^^^^^^^^^
42fc5d26 57
717b4866
QY
58.. index:: Configuration options
59.. index:: Options for configuring
60.. index:: Build options
42fc5d26 61.. index:: Distribution configuration
42fc5d26
QY
62.. index:: Options to `./configure`
63
717b4866
QY
64FRR has an excellent configure script which automatically detects most host
65configurations. There are several additional configure options to customize the
66build to include or exclude specific features and dependencies.
67
68First, update the build system. Change into your FRR source directory and issue:
69
70.. code-block:: shell
71
72 ./bootstrap.sh
73
74This will install any missing build scripts and update the Autotools
75configuration. Once this is done you can move on to choosing your configuration
76options from the list below.
77
78.. _frr-configuration:
42fc5d26 79
dc5564c7 80.. program:: configure
42fc5d26 81
7b5301f5
DS
82.. option:: --enable-tcmalloc
83
84 Enable the alternate malloc library. In some cases this is faster and more efficient,
85 in some cases it is not.
86
87.. option:: --disable-doc
88
89 Do not build any documentation, including this one.
90
91.. option:: --enable-doc-html
92
93 From the documentation build html docs as well in addition to the normal output.
94
dc5564c7 95.. option:: --disable-zebra
42fc5d26 96
7b5301f5
DS
97 Do not build zebra daemon. This generally only be useful in a scenario where
98 you are building bgp as a standalone server.
42fc5d26 99
dc5564c7 100.. option:: --disable-ripd
42fc5d26 101
dc5564c7 102 Do not build ripd.
42fc5d26 103
dc5564c7 104.. option:: --disable-ripngd
42fc5d26 105
dc5564c7 106 Do not build ripngd.
42fc5d26 107
dc5564c7 108.. option:: --disable-ospfd
42fc5d26 109
dc5564c7 110 Do not build ospfd.
42fc5d26 111
dc5564c7 112.. option:: --disable-ospf6d
42fc5d26 113
dc5564c7 114 Do not build ospf6d.
42fc5d26 115
dc5564c7 116.. option:: --disable-bgpd
42fc5d26 117
dc5564c7 118 Do not build bgpd.
42fc5d26 119
7b5301f5
DS
120.. option:: --disable-ldpd
121
122 Do not build ldpd.
123
124.. option:: --disable-nhrpd
125
126 Do not build nhrpd.
127
128.. option:: --disable-eigrpd
129
130 Do not build eigrpd.
131
132.. option:: --disable-babeld
133
134 Do not build babeld.
135
136.. option:: --disable-watchfrr
137
138 Do not build watchfrr. Watchfrr is used to integrate daemons into startup/shutdown
139 software available on your machine. This is needed for systemd integration, if you
140 disable watchfrr you cannot have any systemd integration.
141
142.. option:: --enable-systemd
143
144 Build watchfrr with systemd integration, this will allow FRR to communicate with
145 systemd to tell systemd if FRR has come up properly.
146
147.. option:: --disable-pimd
148
149 Turn off building of pimd. On some BSD platforms pimd will not build properly due
150 to lack of kernel support.
151
152.. option:: --disable-pbrd
153
154 Turn off building of pbrd. This daemon currently requires linux in order to function
155 properly.
156
157.. option:: --enable-sharpd
158
159 Turn on building of sharpd. This daemon facilitates testing of FRR and can also
160 be used as a quick and easy route generator.
161
162.. option:: --disable-staticd
163
164 Do not build staticd. This daemon is necessary if you want static routes.
165
c44032c1
RZ
166.. option:: --disable-bfdd
167
168 Do not build bfdd.
169
dc5564c7 170.. option:: --disable-bgp-announce
42fc5d26 171
dc5564c7
QY
172 Make *bgpd* which does not make bgp announcements at all. This
173 feature is good for using *bgpd* as a BGP announcement listener.
42fc5d26 174
7b5301f5
DS
175.. option:: --disable-bgp-vnc
176
177 Turn off bgpd's ability to use VNC.
178
dc5564c7 179.. option:: --enable-datacenter
42fc5d26 180
dc5564c7
QY
181 Enable system defaults to work as if in a Data Center. See defaults.h
182 for what is changed by this configure option.
42fc5d26 183
dc5564c7 184.. option:: --enable-snmp
42fc5d26 185
dc5564c7 186 Enable SNMP support. By default, SNMP support is disabled.
42fc5d26 187
dc5564c7 188.. option:: --disable-ospfapi
42fc5d26 189
dc5564c7
QY
190 Disable support for OSPF-API, an API to interface directly with ospfd.
191 OSPF-API is enabled if --enable-opaque-lsa is set.
192
193.. option:: --disable-ospfclient
194
195 Disable building of the example OSPF-API client.
196
197.. option:: --disable-ospf-ri
198
199 Disable support for OSPF Router Information (RFC4970 & RFC5088) this
200 requires support for Opaque LSAs and Traffic Engineering.
201
202.. option:: --disable-isisd
203
204 Do not build isisd.
205
f3c7b99d
CF
206.. option:: --disable-fabricd
207
208 Do not build fabricd.
209
dc5564c7
QY
210.. option:: --enable-isis-topology
211
212 Enable IS-IS topology generator.
213
214.. option:: --enable-isis-te
215
216 Enable Traffic Engineering Extension for ISIS (RFC5305)
217
a5a48dbf
QY
218.. option:: --enable-realms
219
220 Enable the support of Linux Realms. Convert tag values from 1-255 into a
221 realm value when inserting into the Linux kernel. Then routing policy can be
222 assigned to the realm. See the tc man page.
223
dc5564c7
QY
224.. option:: --disable-rtadv
225
226 Disable support IPV6 router advertisement in zebra.
227
228.. option:: --enable-gcc-rdynamic
229
d1a242fd 230 Pass the ``-rdynamic`` option to the linker driver. This is in most cases
d1e7591e 231 necessary for getting usable backtraces. This option defaults to on if the
d1a242fd 232 compiler is detected as gcc, but giving an explicit enable/disable is
dc5564c7
QY
233 suggested.
234
235.. option:: --disable-backtrace
236
237 Controls backtrace support for the crash handlers. This is autodetected by
238 default. Using the switch will enforce the requested behaviour, failing with
239 an error if support is requested but not available. On BSD systems, this
240 needs libexecinfo, while on glibc support for this is part of libc itself.
241
242.. option:: --enable-dev-build
243
244 Turn on some options for compiling FRR within a development environment in
245 mind. Specifically turn on -g3 -O0 for compiling options and add inclusion
246 of grammar sandbox.
247
248.. option:: --enable-fuzzing
249
250 Turn on some compile options to allow you to run fuzzing tools against the
251 system. This flag is intended as a developer only tool and should not be
252 used for normal operations.
253
254.. option:: --disable-snmp
255
256 Build without SNMP support.
42fc5d26 257
c1a54c05
QY
258.. option:: --disable-vtysh
259
260 Build without VTYSH.
42fc5d26 261
013f9762
QY
262.. option:: --enable-fpm
263
264 Build with FPM module support.
265
1f35b46a
QY
266.. option:: --enable-numeric-version
267
268 Alpine Linux does not allow non-numeric characters in the version string.
d1e7591e 269 With this option, we provide a way to strip out these characters for APK dev
1f35b46a
QY
270 package builds.
271
0d8df934
DS
272.. option:: --enable-multipath=X
273
274 Compile FRR with up to X way ECMP supported. This number can be from 0-999.
275 For backwards compatability with older configure options when setting X = 0,
276 we will build FRR with 64 way ECMP. This is needed because there are
277 hardcoded arrays that FRR builds towards, so we need to know how big to
278 make these arrays at build time.
279
7b5301f5
DS
280.. option:: --enable-shell-access
281
282 Turn on the ability of FRR to access some shell options( telnet/ssh/bash/etc. )
283 from vtysh itself. This option is considered extremely unsecure and should only
284 be considered for usage if you really really know what you are doing.
285
83284209
AJ
286.. option:: --enable-gcov
287
288 Code coverage reports from gcov require adjustments to the C and LD flags.
289 With this option, gcov instrumentation is added to the build and coverage
290 reports are created during execution. The check-coverage make target is
291 also created to ease report uploading to codecov.io. The upload requires
292 the COMMIT (git hash) and TOKEN (codecov upload token) environment variables
293 be set.
294
1c2facd1
RW
295.. option:: --enable-config-rollbacks
296
297 Build with configuration rollback support. Requires SQLite3.
298
5bce33b3
RW
299.. option:: --enable-confd=<dir>
300
301 Build the ConfD northbound plugin. Look for the libconfd libs and headers
302 in `dir`.
303
a7ca2199
RW
304.. option:: --enable-sysrepo
305
306 Build the Sysrepo northbound plugin.
307
42fc5d26 308You may specify any combination of the above options to the configure
dc5564c7 309script. By default, the executables are placed in :file:`/usr/local/sbin`
42fc5d26 310and the configuration files in :file:`/usr/local/etc`. The :file:`/usr/local/`
44f2550e 311installation prefix and other directories may be changed using the following
42fc5d26
QY
312options to the configuration script.
313
d1a242fd 314.. option:: --prefix <prefix>
42fc5d26 315
dc5564c7 316 Install architecture-independent files in `prefix` [/usr/local].
42fc5d26 317
d1a242fd 318.. option:: --sysconfdir <dir>
42fc5d26 319
dc5564c7
QY
320 Look for configuration files in `dir` [`prefix`/etc]. Note that sample
321 configuration files will be installed here.
44f2550e 322
d1a242fd 323.. option:: --localstatedir <dir>
42fc5d26 324
d1a242fd
QY
325 Configure zebra to use `dir` for local state files, such as pid files and
326 unix sockets.
42fc5d26 327
f805c84e
RW
328.. option:: --with-yangmodelsdir <dir>
329
330 Look for YANG modules in `dir` [`prefix`/share/yang]. Note that the FRR
331 YANG modules will be installed here.
332
333.. option:: --with-libyang-pluginsdir <dir>
334
335 Look for libyang plugins in `dir` [`prefix`/lib/frr/libyang_plugins].
336 Note that the FRR libyang plugins will be installed here.
337
02a0df1f
DL
338 This option is meaningless with libyang 0.16.74 or newer and will be
339 removed once support for older libyang versions is dropped.
340
f805c84e
RW
341When it's desired to run FRR without installing it in the system, it's possible
342to configure it as follows to look for YANG modules and libyang plugins in the
343compile directory:
344.. code-block:: shell
345
346 ./configure --with-libyang-pluginsdir="`pwd`/yang/libyang_plugins/.libs" \
347 --with-yangmodelsdir="`pwd`/yang"
348
11ab5329 349.. _least-privilege-support:
42fc5d26 350
d1a242fd 351Least-Privilege Support
717b4866 352"""""""""""""""""""""""
42fc5d26
QY
353
354.. index:: FRR Least-Privileges
42fc5d26
QY
355.. index:: FRR Privileges
356
357Additionally, you may configure zebra to drop its elevated privileges
358shortly after startup and switch to another user. The configure script will
359automatically try to configure this support. There are three configure
360options to control the behaviour of FRR daemons.
361
d1a242fd 362.. option:: --enable-user <user>
42fc5d26 363
d1a242fd
QY
364 Switch to user `user shortly after startup, and run as user `user` in normal
365 operation.
42fc5d26 366
d1a242fd 367.. option:: --enable-group <user>
42fc5d26 368
d1a242fd 369 Switch real and effective group to `group` shortly after startup.
42fc5d26 370
d1a242fd 371.. option:: --enable-vty-group <group>
dc5564c7 372
d1e7591e
QY
373 Create Unix Vty sockets (for use with vtysh) with group ownership set to
374 `group`. This allows one to create a separate group which is restricted to
d1a242fd
QY
375 accessing only the vty sockets, hence allowing one to delegate this group to
376 individual users, or to run vtysh setgid to this group.
42fc5d26 377
07a17e6d
QY
378The default user and group which will be configured is 'frr' if no user or
379group is specified. Note that this user or group requires write access to the
380local state directory (see :option:`--localstatedir`) and requires at least
381read access, and write access if you wish to allow daemons to write out their
382configuration, to the configuration directory (see :option:`--sysconfdir`).
42fc5d26 383
dc5564c7
QY
384On systems which have the 'libcap' capabilities manipulation library (currently
385only Linux), FRR will retain only minimal capabilities required and will only
386raise these capabilities for brief periods. On systems without libcap, FRR will
387run as the user specified and only raise its UID to 0 for brief periods.
42fc5d26 388
42fc5d26 389Linux Notes
717b4866 390"""""""""""
42fc5d26
QY
391
392.. index:: Building on Linux boxes
42fc5d26
QY
393.. index:: Linux configurations
394
717b4866
QY
395There are several options available only to GNU/Linux systems. If you use
396GNU/Linux, make sure that the current kernel configuration is what you want.
397FRR will run with any kernel configuration but some recommendations do exist.
42fc5d26 398
717b4866 399:makevar:`CONFIG_NETLINK`
fe93e2e3 400 Kernel/User Netlink socket. This enables an advanced interface between
717b4866 401 the Linux kernel and *zebra* (:ref:`kernel-interface`).
42fc5d26 402
717b4866
QY
403:makevar:`CONFIG_RTNETLINK`
404 This makes it possible to receive Netlink routing messages. If you specify
405 this option, *zebra* can detect routing information updates directly from
406 the kernel (:ref:`kernel-interface`).
44f2550e 407
717b4866
QY
408:makevar:`CONFIG_IP_MULTICAST`
409 This option enables IP multicast and should be specified when you use *ripd*
410 (:ref:`rip`) or *ospfd* (:ref:`ospfv2`) because these protocols use
411 multicast.
42fc5d26 412
3c29c38d
LB
413Linux sysctl settings and kernel modules
414````````````````````````````````````````
415
416There are several kernel parameters that impact overall operation of FRR when
417using Linux as a router. Generally these parameters should be set in a
418sysctl related configuration file, e.g., :file:`/etc/sysctl.conf` on
419Ubuntu based systems and a new file
420:file:`/etc/sysctl.d/90-routing-sysctl.conf` on Centos based systems.
421Additional kernel modules are also needed to support MPLS forwarding.
422
423:makevar:`IPv4 and IPv6 forwarding`
424 The following are set to enable IP forwarding in the kernel:
425
426 .. code-block:: shell
427
428 net.ipv4.conf.all.forwarding=1
429 net.ipv6.conf.all.forwarding=1
430
431:makevar:`MPLS forwarding`
fe93e2e3
A
432 Basic MPLS support was introduced in the kernel in version 4.1 and
433 additional capability was introduced in 4.3 and 4.5.
434 For some general information on Linux MPLS support, see
3c29c38d
LB
435 https://www.netdevconf.org/1.1/proceedings/slides/prabhu-mpls-tutorial.pdf.
436 The following modules should be loaded to support MPLS forwarding,
437 and are generally added to a configuration file such as
438 :file:`/etc/modules-load.d/modules.conf`:
439
440 .. code-block:: shell
441
442 # Load MPLS Kernel Modules
443 mpls_router
444 mpls_iptunnel
445
446 The following is an example to enable MPLS forwarding in the kernel:
447
448 .. code-block:: shell
449
450 # Enable MPLS Label processing on all interfaces
451 net.mpls.conf.eth0.input=1
452 net.mpls.conf.eth1.input=1
453 net.mpls.conf.eth2.input=1
454 net.mpls.platform_labels=100000
455
456 Make sure to add a line equal to :file:`net.mpls.conf.<if>.input` for
457 each interface *'<if>'* used with MPLS and to set labels to an
458 appropriate value.
459
460:makevar:`VRF forwarding`
4c97fd1a 461 General information on Linux VRF support can be found in
3c29c38d
LB
462 https://www.kernel.org/doc/Documentation/networking/vrf.txt. Kernel
463 support for VRFs was introduced in 4.3 and improved upon through
464 4.13, which is the version most used in FRR testing (as of June
465 2018). Additional background on using Linux VRFs and kernel specific
466 features can be found in
467 http://schd.ws/hosted_files/ossna2017/fe/vrf-tutorial-oss.pdf.
468
469 The following impacts how BGP TCP sockets are managed across VRFs:
470
471 .. code-block:: shell
472
473 net.ipv4.tcp_l3mdev_accept=0
474
475 With this setting a BGP TCP socket is opened per VRF. This setting
476 ensures that other TCP services, such as SSH, provided for non-VRF
477 purposes are blocked from VRF associated Linux interfaces.
478
479 .. code-block:: shell
480
481 net.ipv4.tcp_l3mdev_accept=1
482
483 With this setting a single BGP TCP socket is shared across the
484 system. This setting exposes any TCP service running on the system,
485 e.g., SSH, to all VRFs. Generally this setting is not used in
486 environments where VRFs are used to support multiple administrative
487 groups.
488
489 **Important note** as of June 2018, Kernel versions 4.14-4.18 have a
490 known bug where VRF-specific TCP sockets are not properly handled. When
491 running these kernel versions, if unable to establish any VRF BGP
492 adjacencies, either downgrade to 4.13 or set
493 'net.ipv4.tcp_l3mdev_accept=1'. The fix for this issue is planned to be
fe93e2e3 494 included in future kernel versions. So upgrading your kernel may also
3c29c38d
LB
495 address this issue.
496
4c97fd1a 497
717b4866
QY
498Building
499^^^^^^^^
42fc5d26 500
717b4866
QY
501Once you have chosen your configure options, run the configure script and pass
502the options you chose:
42fc5d26 503
717b4866 504.. code-block:: shell
42fc5d26 505
717b4866
QY
506 ./configure \
507 --prefix=/usr \
508 --enable-exampledir=/usr/share/doc/frr/examples/ \
509 --localstatedir=/var/run/frr \
510 --sbindir=/usr/lib/frr \
511 --sysconfdir=/etc/frr \
512 --enable-pimd \
513 --enable-watchfrr \
514 ...
44f2550e 515
fe93e2e3 516After configuring the software, you are ready to build and install it in your
717b4866 517system.
42fc5d26 518
717b4866 519.. code-block:: shell
42fc5d26 520
717b4866 521 make && sudo make install
42fc5d26 522
717b4866
QY
523If everything finishes successfully, FRR should be installed. You should now
524skip to the section on :ref:`basic-setup`.