]> git.proxmox.com Git - mirror_frr.git/blob - doc/developer/building-frr-for-ubuntu2004.rst
pimd, doc: remove dead import check references
[mirror_frr.git] / doc / developer / building-frr-for-ubuntu2004.rst
1 Ubuntu 20.04 LTS
2 ================
3
4 This document describes installation from source. If you want to build a
5 ``deb``, see :ref:`packaging-debian`.
6
7 Installing 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 \
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
19
20 .. include:: building-libunwind-note.rst
21
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``.
25
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:
29
30 .. code-block:: shell
31
32 curl https://bootstrap.pypa.io/pip/2.7/get-pip.py --output get-pip.py
33 sudo python2 ./get-pip.py
34
35 # And verify the installation
36 pip2 --version
37
38 .. include:: building-libyang.rst
39
40 Protobuf
41 ^^^^^^^^
42
43 .. code-block:: console
44
45 sudo apt-get install protobuf-c-compiler libprotobuf-c-dev
46
47 ZeroMQ
48 ^^^^^^
49
50 .. code-block:: console
51
52 sudo apt-get install libzmq5 libzmq3-dev
53
54 Building & Installing FRR
55 -------------------------
56
57 Add 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
68 Compile
69 ^^^^^^^
70
71 .. include:: include-compile.rst
72
73 Install 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
85 Tweak sysctls
86 ^^^^^^^^^^^^^
87
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.
91
92 Edit :file:`/etc/sysctl.conf` and uncomment the following values (ignore the
93 other 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
105 Reboot or use ``sysctl -p`` to apply the same config to the running system.
106
107 Add MPLS kernel modules
108 """""""""""""""""""""""
109
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`:
112
113 ::
114
115 # Load MPLS Kernel Modules
116 mpls_router
117 mpls_iptunnel
118
119
120 And load the kernel modules on the running system:
121
122 .. code-block:: console
123
124 sudo modprobe mpls-router mpls-iptunnel
125
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``
129
130 Enable MPLS Forwarding
131 """"""""""""""""""""""
132
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.
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
144 Install 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
152 Enable daemons
153 ^^^^^^^^^^^^^^
154
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``.
158
159 Start FRR
160 ^^^^^^^^^
161
162 .. code-block:: shell
163
164 systemctl start frr