]> git.proxmox.com Git - mirror_frr.git/blob - doc/developer/building-frr-for-ubuntu1804.rst
doc: fix typo RFC7572 to RFC7752
[mirror_frr.git] / doc / developer / building-frr-for-ubuntu1804.rst
1 Ubuntu 18.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 libcap-dev \
18 libelf-dev libunwind-dev
19
20 .. include:: building-libunwind-note.rst
21
22 .. include:: building-libyang.rst
23
24 Protobuf
25 ^^^^^^^^
26
27 .. code-block:: console
28
29 sudo apt-get install protobuf-c-compiler libprotobuf-c-dev
30
31 ZeroMQ
32 ^^^^^^
33
34 .. code-block:: console
35
36 sudo apt-get install libzmq5 libzmq3-dev
37
38 Building & Installing FRR
39 -------------------------
40
41 Add FRR user and groups
42 ^^^^^^^^^^^^^^^^^^^^^^^
43
44 .. code-block:: console
45
46 sudo groupadd -r -g 92 frr
47 sudo groupadd -r -g 85 frrvty
48 sudo adduser --system --ingroup frr --home /var/run/frr/ \
49 --gecos "FRR suite" --shell /sbin/nologin frr
50 sudo usermod -a -G frrvty frr
51
52 Compile
53 ^^^^^^^
54
55 .. include:: include-compile.rst
56
57 Install FRR configuration files
58 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
59
60 .. code-block:: console
61
62 sudo install -m 775 -o frr -g frr -d /var/log/frr
63 sudo install -m 775 -o frr -g frrvty -d /etc/frr
64 sudo install -m 640 -o frr -g frrvty tools/etc/frr/vtysh.conf /etc/frr/vtysh.conf
65 sudo install -m 640 -o frr -g frr tools/etc/frr/frr.conf /etc/frr/frr.conf
66 sudo install -m 640 -o frr -g frr tools/etc/frr/daemons.conf /etc/frr/daemons.conf
67 sudo install -m 640 -o frr -g frr tools/etc/frr/daemons /etc/frr/daemons
68
69 Tweak sysctls
70 ^^^^^^^^^^^^^
71
72 Some sysctls need to be changed in order to enable IPv4/IPv6 forwarding and
73 MPLS (if supported by your platform). If your platform does not support MPLS,
74 skip the MPLS related configuration in this section.
75
76 Edit :file:`/etc/sysctl.conf` and uncomment the following values (ignore the
77 other settings):
78
79 ::
80
81 # Uncomment the next line to enable packet forwarding for IPv4
82 net.ipv4.ip_forward=1
83
84 # Uncomment the next line to enable packet forwarding for IPv6
85 # Enabling this option disables Stateless Address Autoconfiguration
86 # based on Router Advertisements for this host
87 net.ipv6.conf.all.forwarding=1
88
89 Reboot or use ``sysctl -p`` to apply the same config to the running system.
90
91 Add MPLS kernel modules
92 """""""""""""""""""""""
93
94 Ubuntu 18.04 ships with kernel 4.15. MPLS modules are present by default. To
95 enable, add the following lines to :file:`/etc/modules-load.d/modules.conf`:
96
97 ::
98
99 # Load MPLS Kernel Modules
100 mpls_router
101 mpls_iptunnel
102
103
104 And load the kernel modules on the running system:
105
106 .. code-block:: console
107
108 sudo modprobe mpls-router mpls-iptunnel
109
110 If the above command returns an error, you may need to install the appropriate
111 or latest linux-modules-extra-<kernel-version>-generic package. For example
112 ``apt-get install linux-modules-extra-`uname -r`-generic``
113
114 Enable MPLS Forwarding
115 """"""""""""""""""""""
116
117 Edit :file:`/etc/sysctl.conf` and the following lines. Make sure to add a line
118 equal to :file:`net.mpls.conf.eth0.input` for each interface used with MPLS.
119
120 ::
121
122 # Enable MPLS Label processing on all interfaces
123 net.mpls.conf.eth0.input=1
124 net.mpls.conf.eth1.input=1
125 net.mpls.conf.eth2.input=1
126 net.mpls.platform_labels=100000
127
128 Install service files
129 ^^^^^^^^^^^^^^^^^^^^^
130
131 .. code-block:: console
132
133 sudo install -m 644 tools/frr.service /etc/systemd/system/frr.service
134 sudo systemctl enable frr
135
136 Enable daemons
137 ^^^^^^^^^^^^^^
138
139 Open :file:`/etc/frr/daemons` with your text editor of choice. Look for the
140 section with ``watchfrr_enable=...`` and ``zebra=...`` etc. Enable the daemons
141 as required by changing the value to ``yes``.
142
143 Start FRR
144 ^^^^^^^^^
145
146 .. code-block:: shell
147
148 systemctl start frr