]> git.proxmox.com Git - mirror_frr.git/blob - doc/developer/building-frr-for-ubuntu1604.rst
Merge pull request #13122 from rgirada/mgmtd_codecov
[mirror_frr.git] / doc / developer / building-frr-for-ubuntu1604.rst
1 Ubuntu 16.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 apt-get update
13 apt-get install \
14 git autoconf automake libtool make libreadline-dev texinfo \
15 pkg-config libpam0g-dev libjson-c-dev bison flex python3-pytest \
16 libc-ares-dev python3-dev python-ipaddress python3-sphinx \
17 install-info build-essential libsnmp-dev perl libcap-dev \
18 libelf-dev libprotobuf-c-dev protobuf-c-compiler
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 Building & Installing FRR
30 -------------------------
31
32 Add FRR user and groups
33 ^^^^^^^^^^^^^^^^^^^^^^^
34
35 .. code-block:: console
36
37 sudo groupadd -r -g 92 frr
38 sudo groupadd -r -g 85 frrvty
39 sudo adduser --system --ingroup frr --home /var/run/frr/ \
40 --gecos "FRR suite" --shell /sbin/nologin frr
41 sudo usermod -a -G frrvty frr
42
43 Compile
44 ^^^^^^^
45
46 .. include:: include-compile.rst
47
48 Install FRR configuration files
49 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
50
51 .. code-block:: console
52
53 sudo install -m 775 -o frr -g frr -d /var/log/frr
54 sudo install -m 775 -o frr -g frrvty -d /etc/frr
55 sudo install -m 640 -o frr -g frrvty tools/etc/frr/vtysh.conf /etc/frr/vtysh.conf
56 sudo install -m 640 -o frr -g frr tools/etc/frr/frr.conf /etc/frr/frr.conf
57 sudo install -m 640 -o frr -g frr tools/etc/frr/daemons.conf /etc/frr/daemons.conf
58 sudo install -m 640 -o frr -g frr tools/etc/frr/daemons /etc/frr/daemons
59
60 Tweak sysctls
61 ^^^^^^^^^^^^^
62
63 Some sysctls need to be changed in order to enable IPv4/IPv6 forwarding and
64 MPLS (if supported by your platform). If your platform does not support MPLS,
65 skip the MPLS related configuration in this section.
66
67 Edit :file:`/etc/sysctl.conf` and uncomment the following values (ignore the
68 other settings):
69
70 ::
71
72 # Uncomment the next line to enable packet forwarding for IPv4
73 net.ipv4.ip_forward=1
74
75 # Uncomment the next line to enable packet forwarding for IPv6
76 # Enabling this option disables Stateless Address Autoconfiguration
77 # based on Router Advertisements for this host
78 net.ipv6.conf.all.forwarding=1
79
80 Reboot or use ``sysctl -p`` to apply the same config to the running system.
81
82 Add MPLS kernel modules
83 """""""""""""""""""""""
84
85 .. warning::
86
87 MPLS is not supported on Ubuntu 16.04 with the default kernel. MPLS requires
88 kernel 4.5 or higher. LDPD can be built, but may have limited use without
89 MPLS. For an updated Ubuntu Kernel, see
90 http://kernel.ubuntu.com/~kernel-ppa/mainline/
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 Enable MPLS Forwarding
109 """"""""""""""""""""""
110
111 Edit :file:`/etc/sysctl.conf` and the following lines. Make sure to add a line
112 equal to :file:`net.mpls.conf.eth0.input` for each interface used with MPLS.
113
114 ::
115
116 # Enable MPLS Label processing on all interfaces
117 net.mpls.conf.eth0.input=1
118 net.mpls.conf.eth1.input=1
119 net.mpls.conf.eth2.input=1
120 net.mpls.platform_labels=100000
121
122 Install service files
123 ^^^^^^^^^^^^^^^^^^^^^
124
125 .. code-block:: console
126
127 sudo install -m 644 tools/frr.service /etc/systemd/system/frr.service
128 sudo systemctl enable frr
129
130 Enable daemons
131 ^^^^^^^^^^^^^^
132
133 Open :file:`/etc/frr/daemons` with your text editor of choice. Look for the
134 section with ``watchfrr_enable=...`` and ``zebra=...`` etc. Enable the daemons
135 as required by changing the value to ``yes``.
136
137 Start FRR
138 ^^^^^^^^^
139
140 .. code-block:: console
141
142 systemctl start frr