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