]> git.proxmox.com Git - mirror_frr.git/blob - doc/user/installation.rst
Merge pull request #13506 from anlancs/fix/bfdd-vrf-check
[mirror_frr.git] / doc / user / installation.rst
1 .. index::
2 single: How to install FRR
3 single: Installing FRR
4 single: Building FRR
5
6 .. _installation:
7
8 Installation
9 ============
10
11 This section covers the basics of building, installing and setting up FRR.
12
13
14 From Packages
15 -------------
16
17 The project publishes packages for Red Hat, Centos, Debian and Ubuntu on the
18 `GitHub releases <https://github.com/FRRouting/frr/releases>`_. page. External
19 contributors offer packages for many other platforms including \*BSD, Alpine,
20 Gentoo, Docker, and others. There is currently no documentation on how to use
21 those but we hope to add it soon.
22
23 From Snapcraft
24 --------------
25
26 In addition to traditional packages the project also builds and publishes
27 universal Snap images, available at https://snapcraft.io/frr.
28
29 From Source
30 -----------
31
32 Building FRR from source is the best way to ensure you have the latest features
33 and bug fixes. Details for each supported platform, including dependency
34 package listings, permissions, and other gotchas, are in the `developer's
35 documentation
36 <http://docs.frrouting.org/projects/dev-guide/en/latest/building.html>`_. This
37 section provides a brief overview on the process.
38
39
40 Getting the Source
41 ^^^^^^^^^^^^^^^^^^
42
43 FRR's source is available on the project
44 `GitHub page <https://github.com/FRRouting/frr>`_.
45
46 .. code-block:: shell
47
48 git clone https://github.com/FRRouting/frr.git
49
50 When building from Git there are several branches to choose from. The
51 ``master`` branch is the primary development branch. It should be considered
52 unstable. Each release has its own branch named ``stable/X.X``, where ``X.X``
53 is the release version.
54
55 In addition, release tarballs are published on the GitHub releases page
56 `here <https://github.com/FRRouting/frr/releases>`_.
57
58
59 .. index::
60 single: Configuration options
61 single: Options for configuring
62 single: Build options
63 single: Distribution configuration
64 single: Options to `./configure`
65
66 .. _build-configuration:
67
68 Build Configuration
69 ^^^^^^^^^^^^^^^^^^^
70
71 FRR has an excellent configure script which automatically detects most host
72 configurations. There are several additional configure options to customize the
73 build to include or exclude specific features and dependencies.
74
75 First, update the build system. Change into your FRR source directory and issue:
76
77 .. code-block:: shell
78
79 ./bootstrap.sh
80
81 This will install any missing build scripts and update the Autotools
82 configuration. Once this is done you can move on to choosing your configuration
83 options from the list below.
84
85 .. _frr-configuration:
86
87 .. program:: configure
88
89 .. option:: --enable-tcmalloc
90
91 Enable the alternate malloc library. In some cases this is faster and more efficient,
92 in some cases it is not.
93
94 .. option:: --disable-doc
95
96 Do not build any documentation, including this one.
97
98 .. option:: --enable-doc-html
99
100 From the documentation build html docs as well in addition to the normal output.
101
102 .. option:: --disable-zebra
103
104 Do not build zebra daemon. This generally only be useful in a scenario where
105 you are building bgp as a standalone server.
106
107 .. option:: --disable-ripd
108
109 Do not build ripd.
110
111 .. option:: --disable-ripngd
112
113 Do not build ripngd.
114
115 .. option:: --disable-ospfd
116
117 Do not build ospfd.
118
119 .. option:: --disable-ospf6d
120
121 Do not build ospf6d.
122
123 .. option:: --disable-bgpd
124
125 Do not build bgpd.
126
127 .. option:: --disable-ldpd
128
129 Do not build ldpd.
130
131 .. option:: --disable-nhrpd
132
133 Do not build nhrpd.
134
135 .. option:: --disable-eigrpd
136
137 Do not build eigrpd.
138
139 .. option:: --disable-babeld
140
141 Do not build babeld.
142
143 .. option:: --disable-watchfrr
144
145 Do not build watchfrr. Watchfrr is used to integrate daemons into startup/shutdown
146 software available on your machine. This is needed for systemd integration, if you
147 disable watchfrr you cannot have any systemd integration.
148
149 .. option:: --enable-werror
150
151 Build with all warnings converted to errors as a compile option. This
152 is recommended for developers only.
153
154 .. option:: --disable-pimd
155
156 Turn off building of pimd. On some BSD platforms pimd will not build properly due
157 to lack of kernel support.
158
159 .. option:: --disable-vrrpd
160
161 Turn off building of vrrpd. Linux is required for vrrpd support;
162 other platforms are not supported.
163
164 .. option:: --disable-pbrd
165
166 Turn off building of pbrd. This daemon currently requires linux in order to function
167 properly.
168
169 .. option:: --enable-sharpd
170
171 Turn on building of sharpd. This daemon facilitates testing of FRR and can also
172 be used as a quick and easy route generator.
173
174 .. option:: --disable-staticd
175
176 Do not build staticd. This daemon is necessary if you want static routes.
177
178 .. option:: --disable-bfdd
179
180 Do not build bfdd.
181
182 .. option:: --disable-bgp-announce
183
184 Make *bgpd* which does not make bgp announcements at all. This
185 feature is good for using *bgpd* as a BGP announcement listener.
186
187 .. option:: --disable-bgp-vnc
188
189 Turn off bgpd's ability to use VNC.
190
191 .. option:: --disable-bgp-bmp
192
193 Turn off BGP BMP support
194
195 .. option:: --enable-datacenter
196
197 This option is deprecated as it is superseded by the `-F` (profile) command
198 line option which allows adjusting the setting at startup rather than
199 compile time.
200
201 Enable system defaults to work as if in a Data Center. See defaults.h
202 for what is changed by this configure option.
203
204 .. option:: --enable-snmp
205
206 Enable SNMP support. By default, SNMP support is disabled.
207
208 .. option:: --disable-ospfapi
209
210 Disable support for OSPF-API, an API to interface directly with ospfd.
211 OSPF-API is enabled if --enable-opaque-lsa is set.
212
213 .. option:: --disable-ospfclient
214
215 Disable installation of the python ospfclient and building of the example
216 OSPF-API client.
217
218 .. option:: --disable-isisd
219
220 Do not build isisd.
221
222 .. option:: --disable-fabricd
223
224 Do not build fabricd.
225
226 .. option:: --enable-isis-topology
227
228 Enable IS-IS topology generator.
229
230 .. option:: --enable-realms
231
232 Enable the support of Linux Realms. Convert tag values from 1-255 into a
233 realm value when inserting into the Linux kernel. Then routing policy can be
234 assigned to the realm. See the tc man page. This option is currently not
235 compatible with the usage of nexthop groups in the linux kernel itself.
236
237 .. option:: --disable-irdp
238
239 Disable IRDP server support. This is enabled by default if we have
240 both `struct in_pktinfo` and `struct icmphdr` available to us.
241
242 .. option:: --disable-rtadv
243
244 Disable support IPV6 router advertisement in zebra.
245
246 .. option:: --enable-gcc-rdynamic
247
248 Pass the ``-rdynamic`` option to the linker driver. This is in most cases
249 necessary for getting usable backtraces. This option defaults to on if the
250 compiler is detected as gcc, but giving an explicit enable/disable is
251 suggested.
252
253 .. option:: --disable-backtrace
254
255 Controls backtrace support for the crash handlers. This is autodetected by
256 default. Using the switch will enforce the requested behaviour, failing with
257 an error if support is requested but not available. On BSD systems, this
258 needs libexecinfo, while on glibc support for this is part of libc itself.
259
260 .. option:: --enable-dev-build
261
262 Turn on some options for compiling FRR within a development environment in
263 mind. Specifically turn on -g3 -O0 for compiling options and add inclusion
264 of grammar sandbox.
265
266 .. option:: --disable-snmp
267
268 Build without SNMP support.
269
270 .. option:: --disable-vtysh
271
272 Build without VTYSH.
273
274 .. option:: --enable-fpm
275
276 Build with FPM module support.
277
278 .. option:: --with-service-timeout=X
279
280 Set timeout value for FRR service. The time of restarting or reloading FRR
281 service should not exceed this value. This number can be from 0-999.
282 Additionally if this parameter is not passed or setting X = 0, FRR will take
283 default value: 2 minutes.
284
285 .. option:: --enable-numeric-version
286
287 Alpine Linux does not allow non-numeric characters in the version string.
288 With this option, we provide a way to strip out these characters for APK dev
289 package builds.
290
291 .. option:: --disable-version-build-config
292
293 Remove the "configuerd with" field that has all of the build configuration
294 arguments when reporting the version string in `show version` command.
295
296 .. option:: --with-pkg-extra-version=VER
297
298 Add extra version field, for packagers/distributions
299
300 .. option:: --with-pkg-git-version
301
302 Add git information to MOTD and build version string
303
304 .. option:: --enable-multipath=X
305
306 Compile FRR with up to X way ECMP supported. This number can be from 0-999.
307 For backwards compatibility with older configure options when setting X = 0,
308 we will build FRR with 64 way ECMP. This is needed because there are
309 hardcoded arrays that FRR builds towards, so we need to know how big to
310 make these arrays at build time. Additionally if this parameter is
311 not passed in FRR will default to 16 ECMP.
312
313 .. option:: --enable-shell-access
314
315 Turn on the ability of FRR to access some shell options( telnet/ssh/bash/etc. )
316 from vtysh itself. This option is considered extremely unsecure and should only
317 be considered for usage if you really really know what you are doing. This
318 option is deprecated and will be removed on Feb 1, 2024.
319
320 .. option:: --enable-gcov
321
322 Code coverage reports from gcov require adjustments to the C and LD flags.
323 With this option, gcov instrumentation is added to the build and coverage
324 reports are created during execution. The check-coverage make target is
325 also created to ease report uploading to codecov.io. The upload requires
326 the COMMIT (git hash) and TOKEN (codecov upload token) environment variables
327 be set.
328
329 .. option:: --enable-config-rollbacks
330
331 Build with configuration rollback support. Requires SQLite3.
332
333 .. option:: --enable-confd=<dir>
334
335 Build the ConfD northbound plugin. Look for the libconfd libs and headers
336 in `dir`.
337
338 .. option:: --enable-sysrepo
339
340 Build the Sysrepo northbound plugin.
341
342 .. option:: --enable-grpc
343
344 Enable the gRPC northbound plugin.
345
346 .. option:: --enable-zeromq
347
348 Enable the ZeroMQ handler.
349
350 .. option:: --with-libpam
351
352 Use libpam for PAM support in vtysh.
353
354 .. option:: --enable-time-check XXX
355
356 This option is deprecated as it was replaced by the
357 :clicmd:`service cputime-stats` CLI command, which may be adjusted at
358 runtime rather than being a compile-time setting. See there for further
359 detail.
360
361 .. option:: --disable-cpu-time
362
363 This option is deprecated as it was replaced by the
364 :clicmd:`service cputime-warning NNN` CLI command, which may be adjusted at
365 runtime rather than being a compile-time setting. See there for further
366 detail.
367
368 .. option:: --enable-pcreposix
369
370 Turn on the usage of PCRE Posix libs for regex functionality.
371
372 .. option:: --enable-pcre2posix
373
374 Turn on the usage of PCRE2 Posix libs for regex functionality.
375
376 PCRE2 versions <= 10.31 work a bit differently. We suggest using at least
377 >= 10.36.
378
379 .. option:: --enable-rpath
380
381 Set hardcoded rpaths in the executable [default=yes].
382
383 .. option:: --enable-scripting
384
385 Enable Lua scripting [default=no].
386
387 You may specify any combination of the above options to the configure
388 script. By default, the executables are placed in :file:`/usr/local/sbin`
389 and the configuration files in :file:`/usr/local/etc`. The :file:`/usr/local/`
390 installation prefix and other directories may be changed using the following
391 options to the configuration script.
392
393 .. option:: --enable-ccls
394
395 Enable the creation of a :file:`.ccls` file in the top level source
396 directory.
397
398 Some development environments (e.g., LSP server within emacs, et al.) can
399 utilize :clicmd:`ccls` to provide highly sophisticated IDE features (e.g.,
400 semantically accurate jump-to definition/reference, and even code
401 refactoring). The `--enable-ccls` causes :file:`configure` to generate a
402 configuration for the :clicmd:`ccls` command, based on the configured
403 FRR build environment.
404
405 .. option:: --prefix <prefix>
406
407 Install architecture-independent files in `prefix` [/usr/local].
408
409 .. option:: --sysconfdir <dir>
410
411 Look for configuration files in `dir` [`prefix`/etc]. Note that sample
412 configuration files will be installed here.
413
414 .. option:: --localstatedir <dir>
415
416 Configure zebra to use `dir` for local state files, such as pid files and
417 unix sockets.
418
419 .. option:: --with-scriptdir <dir>
420
421 Look for Lua scripts in ``dir`` [``prefix``/etc/frr/scripts].
422
423 .. option:: --with-yangmodelsdir <dir>
424
425 Look for YANG modules in `dir` [`prefix`/share/yang]. Note that the FRR
426 YANG modules will be installed here.
427
428 .. option:: --with-vici-socket <path>
429
430 Set StrongSWAN vici interface socket path [/var/run/charon.vici].
431
432 .. note::
433
434 The former ``--enable-systemd`` option does not exist anymore. Support for
435 systemd is now always available through built-in functions, without
436 depending on libsystemd.
437
438 Python dependency, documentation and tests
439 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
440
441 FRR's documentation and basic unit tests heavily use code written in Python.
442 Additionally, FRR ships Python extensions written in C which are used during
443 its build process.
444
445 To this extent, FRR needs the following:
446
447 * an installation of CPython, preferably version 3.2 or newer (2.7 works but
448 is end of life and will stop working at some point.)
449 * development files (mostly headers) for that version of CPython
450 * an installation of `sphinx` for that version of CPython, to build the
451 documentation
452 * an installation of `pytest` for that version of CPython, to run the unit
453 tests
454
455 The `sphinx` and `pytest` dependencies can be avoided by not building
456 documentation / not running ``make check``, but the CPython dependency is a
457 hard dependency of the FRR build process (for the `clippy` tool.)
458
459 .. index::
460 single: FRR Least-Privileges
461 single: FRR Privileges
462
463 .. _least-privilege-support:
464
465 Least-Privilege Support
466 """""""""""""""""""""""
467
468 Additionally, you may configure zebra to drop its elevated privileges
469 shortly after startup and switch to another user. The configure script will
470 automatically try to configure this support. There are three configure
471 options to control the behaviour of FRR daemons.
472
473 .. option:: --enable-user <user>
474
475 Switch to user `user shortly after startup, and run as user `user` in normal
476 operation.
477
478 .. option:: --enable-group <user>
479
480 Switch real and effective group to `group` shortly after startup.
481
482 .. option:: --enable-vty-group <group>
483
484 Create Unix Vty sockets (for use with vtysh) with group ownership set to
485 `group`. This allows one to create a separate group which is restricted to
486 accessing only the vty sockets, hence allowing one to delegate this group to
487 individual users, or to run vtysh setgid to this group.
488
489 The default user and group which will be configured is 'frr' if no user or
490 group is specified. Note that this user or group requires write access to the
491 local state directory (see :option:`--localstatedir`) and requires at least
492 read access, and write access if you wish to allow daemons to write out their
493 configuration, to the configuration directory (see :option:`--sysconfdir`).
494
495 On systems which have the 'libcap' capabilities manipulation library (currently
496 only Linux), FRR will retain only minimal capabilities required and will only
497 raise these capabilities for brief periods. On systems without libcap, FRR will
498 run as the user specified and only raise its UID to 0 for brief periods.
499
500
501 .. index::
502 pair: building; Linux
503 pair: configuration; Linux
504
505 Linux Notes
506 """""""""""
507
508 There are several options available only to GNU/Linux systems. If you use
509 GNU/Linux, make sure that the current kernel configuration is what you want.
510 FRR will run with any kernel configuration but some recommendations do exist.
511
512 :makevar:`CONFIG_NETLINK`
513 Kernel/User Netlink socket. This enables an advanced interface between
514 the Linux kernel and *zebra* (:ref:`kernel-interface`).
515
516 :makevar:`CONFIG_RTNETLINK`
517 This makes it possible to receive Netlink routing messages. If you specify
518 this option, *zebra* can detect routing information updates directly from
519 the kernel (:ref:`kernel-interface`).
520
521 :makevar:`CONFIG_IP_MULTICAST`
522 This option enables IP multicast and should be specified when you use *ripd*
523 (:ref:`rip`) or *ospfd* (:ref:`ospfv2`) because these protocols use
524 multicast.
525
526 Linux sysctl settings and kernel modules
527 ````````````````````````````````````````
528
529 There are several kernel parameters that impact overall operation of FRR when
530 using Linux as a router. Generally these parameters should be set in a
531 sysctl related configuration file, e.g., :file:`/etc/sysctl.conf` on
532 Ubuntu based systems and a new file
533 :file:`/etc/sysctl.d/90-routing-sysctl.conf` on Centos based systems.
534 Additional kernel modules are also needed to support MPLS forwarding.
535
536 :makevar:`IPv4 and IPv6 forwarding`
537 The following are set to enable IP forwarding in the kernel:
538
539 .. code-block:: shell
540
541 net.ipv4.conf.all.forwarding=1
542 net.ipv6.conf.all.forwarding=1
543
544 :makevar:`MPLS forwarding`
545 Basic MPLS support was introduced in the kernel in version 4.1 and
546 additional capability was introduced in 4.3 and 4.5.
547 For some general information on Linux MPLS support, see
548 https://www.netdevconf.org/1.1/proceedings/slides/prabhu-mpls-tutorial.pdf.
549 The following modules should be loaded to support MPLS forwarding,
550 and are generally added to a configuration file such as
551 :file:`/etc/modules-load.d/modules.conf`:
552
553 .. code-block:: shell
554
555 # Load MPLS Kernel Modules
556 mpls_router
557 mpls_iptunnel
558
559 The following is an example to enable MPLS forwarding in the
560 kernel, typically by editing :file:`/etc/sysctl.conf`:
561
562 .. code-block:: shell
563
564 # Enable MPLS Label processing on all interfaces
565 net.mpls.conf.eth0.input=1
566 net.mpls.conf.eth1.input=1
567 net.mpls.conf.eth2.input=1
568 net.mpls.platform_labels=100000
569
570 Make sure to add a line equal to :file:`net.mpls.conf.<if>.input` for
571 each interface *'<if>'* used with MPLS and to set labels to an
572 appropriate value.
573
574 :makevar:`VRF forwarding`
575 General information on Linux VRF support can be found in
576 https://www.kernel.org/doc/Documentation/networking/vrf.txt.
577
578 Kernel support for VRFs was introduced in 4.3, but there are known issues
579 in versions up to 4.15 (for IPv4) and 5.0 (for IPv6). The FRR CI system
580 doesn't perform VRF tests on older kernel versions, and VRFs may not work
581 on them. If you experience issues with VRF support, you should upgrade your
582 kernel version.
583
584 .. seealso:: :ref:`zebra-vrf`
585
586 Building
587 ^^^^^^^^
588
589 Once you have chosen your configure options, run the configure script and pass
590 the options you chose:
591
592 .. code-block:: shell
593
594 ./configure \
595 --prefix=/usr \
596 --localstatedir=/var/run/frr \
597 --sbindir=/usr/lib/frr \
598 --sysconfdir=/etc/frr \
599 --enable-pimd \
600 --enable-watchfrr \
601 ...
602
603 After configuring the software, you are ready to build and install it in your
604 system.
605
606 .. code-block:: shell
607
608 make && sudo make install
609
610 If everything finishes successfully, FRR should be installed. You should now
611 skip to the section on :ref:`basic-setup`.