]> git.proxmox.com Git - mirror_frr.git/blame - doc/user/installation.rst
lib: Add PCRE2 support
[mirror_frr.git] / doc / user / installation.rst
CommitLineData
8ed09fbf
QY
1.. index::
2 single: How to install FRR
3 single: Installing FRR
4 single: Building FRR
5
0efdf0fe 6.. _installation:
42fc5d26 7
42fc5d26 8Installation
717b4866 9============
42fc5d26 10
717b4866 11This section covers the basics of building, installing and setting up FRR.
44f2550e 12
8ed09fbf 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
4eddb678
QY
34package listings, permissions, and other gotchas, are in the `developer's
35documentation
36<http://docs.frrouting.org/projects/dev-guide/en/latest/building.html>`_. This
37section provides a brief overview on the process.
38
42fc5d26 39
717b4866
QY
40Getting the Source
41^^^^^^^^^^^^^^^^^^
42fc5d26 42
717b4866
QY
43FRR's source is available on the project
44`GitHub page <https://github.com/FRRouting/frr>`_.
42fc5d26 45
717b4866 46.. code-block:: shell
42fc5d26 47
717b4866 48 git clone https://github.com/FRRouting/frr.git
42fc5d26 49
717b4866
QY
50When building from Git there are several branches to choose from. The
51``master`` branch is the primary development branch. It should be considered
52unstable. Each release has its own branch named ``stable/X.X``, where ``X.X``
53is the release version.
42fc5d26 54
717b4866
QY
55In addition, release tarballs are published on the GitHub releases page
56`here <https://github.com/FRRouting/frr/releases>`_.
42fc5d26 57
42fc5d26 58
8ed09fbf
QY
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
68Build Configuration
69^^^^^^^^^^^^^^^^^^^
42fc5d26 70
717b4866
QY
71FRR has an excellent configure script which automatically detects most host
72configurations. There are several additional configure options to customize the
73build to include or exclude specific features and dependencies.
74
75First, update the build system. Change into your FRR source directory and issue:
76
77.. code-block:: shell
78
79 ./bootstrap.sh
80
81This will install any missing build scripts and update the Autotools
82configuration. Once this is done you can move on to choosing your configuration
83options from the list below.
84
85.. _frr-configuration:
42fc5d26 86
dc5564c7 87.. program:: configure
42fc5d26 88
7b5301f5
DS
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
dc5564c7 102.. option:: --disable-zebra
42fc5d26 103
7b5301f5
DS
104 Do not build zebra daemon. This generally only be useful in a scenario where
105 you are building bgp as a standalone server.
42fc5d26 106
dc5564c7 107.. option:: --disable-ripd
42fc5d26 108
dc5564c7 109 Do not build ripd.
42fc5d26 110
dc5564c7 111.. option:: --disable-ripngd
42fc5d26 112
dc5564c7 113 Do not build ripngd.
42fc5d26 114
dc5564c7 115.. option:: --disable-ospfd
42fc5d26 116
dc5564c7 117 Do not build ospfd.
42fc5d26 118
dc5564c7 119.. option:: --disable-ospf6d
42fc5d26 120
dc5564c7 121 Do not build ospf6d.
42fc5d26 122
dc5564c7 123.. option:: --disable-bgpd
42fc5d26 124
dc5564c7 125 Do not build bgpd.
42fc5d26 126
7b5301f5
DS
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
c295c6ce
DS
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
7b5301f5
DS
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
85400b29
MS
159.. option:: --disable-vrrpd
160
161 Turn off building of vrrpd. Linux is required for vrrpd support;
162 other platforms are not supported.
163
7b5301f5
DS
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
c44032c1
RZ
178.. option:: --disable-bfdd
179
180 Do not build bfdd.
181
dc5564c7 182.. option:: --disable-bgp-announce
42fc5d26 183
dc5564c7
QY
184 Make *bgpd* which does not make bgp announcements at all. This
185 feature is good for using *bgpd* as a BGP announcement listener.
42fc5d26 186
7b5301f5
DS
187.. option:: --disable-bgp-vnc
188
189 Turn off bgpd's ability to use VNC.
190
c295c6ce
DS
191.. option:: --disable-bgp-bmp
192
193 Turn off BGP BMP support
194
dc5564c7 195.. option:: --enable-datacenter
42fc5d26 196
5c076fe7
DL
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
dc5564c7
QY
201 Enable system defaults to work as if in a Data Center. See defaults.h
202 for what is changed by this configure option.
42fc5d26 203
dc5564c7 204.. option:: --enable-snmp
42fc5d26 205
dc5564c7 206 Enable SNMP support. By default, SNMP support is disabled.
42fc5d26 207
dc5564c7 208.. option:: --disable-ospfapi
42fc5d26 209
dc5564c7
QY
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
9191ac86
CH
215 Disable installation of the python ospfclient and building of the example
216 OSPF-API client.
dc5564c7 217
dc5564c7
QY
218.. option:: --disable-isisd
219
220 Do not build isisd.
221
f3c7b99d
CF
222.. option:: --disable-fabricd
223
224 Do not build fabricd.
225
dc5564c7
QY
226.. option:: --enable-isis-topology
227
228 Enable IS-IS topology generator.
229
a5a48dbf
QY
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
f2b8c0b5
DS
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.
a5a48dbf 236
c295c6ce
DS
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
dc5564c7
QY
242.. option:: --disable-rtadv
243
244 Disable support IPV6 router advertisement in zebra.
245
246.. option:: --enable-gcc-rdynamic
247
d1a242fd 248 Pass the ``-rdynamic`` option to the linker driver. This is in most cases
d1e7591e 249 necessary for getting usable backtraces. This option defaults to on if the
d1a242fd 250 compiler is detected as gcc, but giving an explicit enable/disable is
dc5564c7
QY
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
dc5564c7
QY
266.. option:: --disable-snmp
267
268 Build without SNMP support.
42fc5d26 269
c1a54c05
QY
270.. option:: --disable-vtysh
271
272 Build without VTYSH.
42fc5d26 273
013f9762
QY
274.. option:: --enable-fpm
275
276 Build with FPM module support.
277
fc539216 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
1f35b46a
QY
285.. option:: --enable-numeric-version
286
287 Alpine Linux does not allow non-numeric characters in the version string.
d1e7591e 288 With this option, we provide a way to strip out these characters for APK dev
1f35b46a
QY
289 package builds.
290
7134d0e9 291.. option:: --disable-version-build-config
e063f271
JAG
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
7134d0e9 296.. option:: --with-pkg-extra-version=VER
fa60c388 297
e063f271
JAG
298 Add extra version field, for packagers/distributions
299
7134d0e9 300.. option:: --with-pkg-git-version
e063f271
JAG
301
302 Add git information to MOTD and build version string
303
0d8df934
DS
304.. option:: --enable-multipath=X
305
306 Compile FRR with up to X way ECMP supported. This number can be from 0-999.
56f0bea7 307 For backwards compatibility with older configure options when setting X = 0,
0d8df934
DS
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
b16b7e07
DS
310 make these arrays at build time. Additionally if this parameter is
311 not passed in FRR will default to 16 ECMP.
0d8df934 312
7b5301f5
DS
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.
318
83284209
AJ
319.. option:: --enable-gcov
320
321 Code coverage reports from gcov require adjustments to the C and LD flags.
322 With this option, gcov instrumentation is added to the build and coverage
323 reports are created during execution. The check-coverage make target is
324 also created to ease report uploading to codecov.io. The upload requires
325 the COMMIT (git hash) and TOKEN (codecov upload token) environment variables
326 be set.
327
1c2facd1
RW
328.. option:: --enable-config-rollbacks
329
330 Build with configuration rollback support. Requires SQLite3.
331
5bce33b3
RW
332.. option:: --enable-confd=<dir>
333
334 Build the ConfD northbound plugin. Look for the libconfd libs and headers
335 in `dir`.
336
a7ca2199
RW
337.. option:: --enable-sysrepo
338
339 Build the Sysrepo northbound plugin.
340
c295c6ce
DS
341.. option:: --enable-grpc
342
343 Enable the gRPC northbound plugin.
344
345.. option:: --enable-zeromq
346
347 Enable the ZeroMQ handler.
348
349.. option:: --with-libpam
350
351 Use libpam for PAM support in vtysh.
352
f75e802d
DS
353.. option:: --enable-time-check XXX
354
5c076fe7
DL
355 This option is deprecated as it was replaced by the
356 :clicmd:`service cputime-stats` CLI command, which may be adjusted at
357 runtime rather than being a compile-time setting. See there for further
358 detail.
f75e802d
DS
359
360.. option:: --disable-cpu-time
361
5c076fe7
DL
362 This option is deprecated as it was replaced by the
363 :clicmd:`service cputime-warning NNN` CLI command, which may be adjusted at
364 runtime rather than being a compile-time setting. See there for further
365 detail.
f75e802d 366
c295c6ce
DS
367.. option:: --enable-pcreposix
368
369 Turn on the usage of PCRE Posix libs for regex functionality.
370
061f5d1c
DA
371.. option:: --enable-pcre2posix
372
373 Turn on the usage of PCRE2 Posix libs for regex functionality.
374
375 PCRE2 versions <= 10.31 work a bit differently. We suggest using at least
376 >= 10.36.
377
7134d0e9
EB
378.. option:: --enable-rpath
379
380 Set hardcoded rpaths in the executable [default=yes].
381
0833300a
QY
382.. option:: --enable-scripting
383
384 Enable Lua scripting [default=no].
385
42fc5d26 386You may specify any combination of the above options to the configure
dc5564c7 387script. By default, the executables are placed in :file:`/usr/local/sbin`
42fc5d26 388and the configuration files in :file:`/usr/local/etc`. The :file:`/usr/local/`
44f2550e 389installation prefix and other directories may be changed using the following
42fc5d26
QY
390options to the configuration script.
391
d1a242fd 392.. option:: --prefix <prefix>
42fc5d26 393
dc5564c7 394 Install architecture-independent files in `prefix` [/usr/local].
42fc5d26 395
d1a242fd 396.. option:: --sysconfdir <dir>
42fc5d26 397
dc5564c7
QY
398 Look for configuration files in `dir` [`prefix`/etc]. Note that sample
399 configuration files will be installed here.
44f2550e 400
d1a242fd 401.. option:: --localstatedir <dir>
42fc5d26 402
d1a242fd
QY
403 Configure zebra to use `dir` for local state files, such as pid files and
404 unix sockets.
42fc5d26 405
0833300a
QY
406.. option:: --with-scriptdir <dir>
407
408 Look for Lua scripts in ``dir`` [``prefix``/etc/frr/scripts].
409
f805c84e
RW
410.. option:: --with-yangmodelsdir <dir>
411
412 Look for YANG modules in `dir` [`prefix`/share/yang]. Note that the FRR
413 YANG modules will be installed here.
414
354196c0
ZP
415.. option:: --with-vici-socket <path>
416
417 Set StrongSWAN vici interface socket path [/var/run/charon.vici].
418
ab140d61
DL
419.. note::
420
421 The former ``--enable-systemd`` option does not exist anymore. Support for
422 systemd is now always available through built-in functions, without
423 depending on libsystemd.
424
45da32d7
DL
425Python dependency, documentation and tests
426^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
427
428FRR's documentation and basic unit tests heavily use code written in Python.
429Additionally, FRR ships Python extensions written in C which are used during
430its build process.
431
432To this extent, FRR needs the following:
433
434* an installation of CPython, preferably version 3.2 or newer (2.7 works but
435 is end of life and will stop working at some point.)
436* development files (mostly headers) for that version of CPython
437* an installation of `sphinx` for that version of CPython, to build the
438 documentation
439* an installation of `pytest` for that version of CPython, to run the unit
440 tests
441
442The `sphinx` and `pytest` dependencies can be avoided by not building
443documentation / not running ``make check``, but the CPython dependency is a
444hard dependency of the FRR build process (for the `clippy` tool.)
445
8ed09fbf
QY
446.. index::
447 single: FRR Least-Privileges
448 single: FRR Privileges
449
11ab5329 450.. _least-privilege-support:
42fc5d26 451
d1a242fd 452Least-Privilege Support
717b4866 453"""""""""""""""""""""""
42fc5d26 454
42fc5d26
QY
455Additionally, you may configure zebra to drop its elevated privileges
456shortly after startup and switch to another user. The configure script will
457automatically try to configure this support. There are three configure
458options to control the behaviour of FRR daemons.
459
d1a242fd 460.. option:: --enable-user <user>
42fc5d26 461
d1a242fd
QY
462 Switch to user `user shortly after startup, and run as user `user` in normal
463 operation.
42fc5d26 464
d1a242fd 465.. option:: --enable-group <user>
42fc5d26 466
d1a242fd 467 Switch real and effective group to `group` shortly after startup.
42fc5d26 468
d1a242fd 469.. option:: --enable-vty-group <group>
dc5564c7 470
d1e7591e
QY
471 Create Unix Vty sockets (for use with vtysh) with group ownership set to
472 `group`. This allows one to create a separate group which is restricted to
d1a242fd
QY
473 accessing only the vty sockets, hence allowing one to delegate this group to
474 individual users, or to run vtysh setgid to this group.
42fc5d26 475
07a17e6d
QY
476The default user and group which will be configured is 'frr' if no user or
477group is specified. Note that this user or group requires write access to the
478local state directory (see :option:`--localstatedir`) and requires at least
479read access, and write access if you wish to allow daemons to write out their
480configuration, to the configuration directory (see :option:`--sysconfdir`).
42fc5d26 481
dc5564c7
QY
482On systems which have the 'libcap' capabilities manipulation library (currently
483only Linux), FRR will retain only minimal capabilities required and will only
484raise these capabilities for brief periods. On systems without libcap, FRR will
485run as the user specified and only raise its UID to 0 for brief periods.
42fc5d26 486
8ed09fbf
QY
487
488.. index::
489 pair: building; Linux
490 pair: configuration; Linux
491
42fc5d26 492Linux Notes
717b4866 493"""""""""""
42fc5d26 494
717b4866
QY
495There are several options available only to GNU/Linux systems. If you use
496GNU/Linux, make sure that the current kernel configuration is what you want.
497FRR will run with any kernel configuration but some recommendations do exist.
42fc5d26 498
717b4866 499:makevar:`CONFIG_NETLINK`
fe93e2e3 500 Kernel/User Netlink socket. This enables an advanced interface between
717b4866 501 the Linux kernel and *zebra* (:ref:`kernel-interface`).
42fc5d26 502
717b4866
QY
503:makevar:`CONFIG_RTNETLINK`
504 This makes it possible to receive Netlink routing messages. If you specify
505 this option, *zebra* can detect routing information updates directly from
506 the kernel (:ref:`kernel-interface`).
44f2550e 507
717b4866
QY
508:makevar:`CONFIG_IP_MULTICAST`
509 This option enables IP multicast and should be specified when you use *ripd*
510 (:ref:`rip`) or *ospfd* (:ref:`ospfv2`) because these protocols use
511 multicast.
42fc5d26 512
3c29c38d
LB
513Linux sysctl settings and kernel modules
514````````````````````````````````````````
515
516There are several kernel parameters that impact overall operation of FRR when
517using Linux as a router. Generally these parameters should be set in a
518sysctl related configuration file, e.g., :file:`/etc/sysctl.conf` on
519Ubuntu based systems and a new file
520:file:`/etc/sysctl.d/90-routing-sysctl.conf` on Centos based systems.
521Additional kernel modules are also needed to support MPLS forwarding.
522
523:makevar:`IPv4 and IPv6 forwarding`
524 The following are set to enable IP forwarding in the kernel:
525
526 .. code-block:: shell
527
528 net.ipv4.conf.all.forwarding=1
529 net.ipv6.conf.all.forwarding=1
530
531:makevar:`MPLS forwarding`
fe93e2e3
A
532 Basic MPLS support was introduced in the kernel in version 4.1 and
533 additional capability was introduced in 4.3 and 4.5.
534 For some general information on Linux MPLS support, see
3c29c38d
LB
535 https://www.netdevconf.org/1.1/proceedings/slides/prabhu-mpls-tutorial.pdf.
536 The following modules should be loaded to support MPLS forwarding,
537 and are generally added to a configuration file such as
538 :file:`/etc/modules-load.d/modules.conf`:
539
540 .. code-block:: shell
541
542 # Load MPLS Kernel Modules
543 mpls_router
544 mpls_iptunnel
545
e25aa976
MS
546 The following is an example to enable MPLS forwarding in the
547 kernel, typically by editing :file:`/etc/sysctl.conf`:
3c29c38d
LB
548
549 .. code-block:: shell
550
551 # Enable MPLS Label processing on all interfaces
552 net.mpls.conf.eth0.input=1
553 net.mpls.conf.eth1.input=1
554 net.mpls.conf.eth2.input=1
555 net.mpls.platform_labels=100000
556
557 Make sure to add a line equal to :file:`net.mpls.conf.<if>.input` for
558 each interface *'<if>'* used with MPLS and to set labels to an
559 appropriate value.
560
561:makevar:`VRF forwarding`
4c97fd1a 562 General information on Linux VRF support can be found in
75b8d482
IR
563 https://www.kernel.org/doc/Documentation/networking/vrf.txt.
564
565 Kernel support for VRFs was introduced in 4.3, but there are known issues
566 in versions up to 4.15 (for IPv4) and 5.0 (for IPv6). The FRR CI system
567 doesn't perform VRF tests on older kernel versions, and VRFs may not work
568 on them. If you experience issues with VRF support, you should upgrade your
569 kernel version.
570
571 .. seealso:: :ref:`zebra-vrf`
4c97fd1a 572
717b4866
QY
573Building
574^^^^^^^^
42fc5d26 575
717b4866
QY
576Once you have chosen your configure options, run the configure script and pass
577the options you chose:
42fc5d26 578
717b4866 579.. code-block:: shell
42fc5d26 580
717b4866
QY
581 ./configure \
582 --prefix=/usr \
717b4866
QY
583 --localstatedir=/var/run/frr \
584 --sbindir=/usr/lib/frr \
585 --sysconfdir=/etc/frr \
586 --enable-pimd \
587 --enable-watchfrr \
588 ...
44f2550e 589
fe93e2e3 590After configuring the software, you are ready to build and install it in your
717b4866 591system.
42fc5d26 592
717b4866 593.. code-block:: shell
42fc5d26 594
717b4866 595 make && sudo make install
42fc5d26 596
717b4866
QY
597If everything finishes successfully, FRR should be installed. You should now
598skip to the section on :ref:`basic-setup`.