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