]> git.proxmox.com Git - mirror_frr.git/blame - doc/developer/building-frr-for-centos7.rst
Merge pull request #12797 from jvidalallende/ubi8_minimal_dockerfile
[mirror_frr.git] / doc / developer / building-frr-for-centos7.rst
CommitLineData
d1890d04 1CentOS 7
278fb111
MW
2========================================
3
9251d1f5
QY
4This document describes installation from source. If you want to build an RPM,
5see :ref:`packaging-redhat`.
a63edb35 6
278fb111
MW
7CentOS 7 restrictions:
8----------------------
9
d1890d04
QY
10- MPLS is not supported on ``CentOS 7`` with default kernel. MPLS
11 requires Linux Kernel 4.5 or higher (LDP can be built, but may have
12 limited use without MPLS)
13
278fb111
MW
14Install required packages
15-------------------------
ae32b152 16
278fb111
MW
17Add packages:
18
d1890d04
QY
19::
20
7d9a2e6d 21 sudo yum install git autoconf automake libtool make \
a63edb35
MW
22 readline-devel texinfo net-snmp-devel groff pkgconfig \
23 json-c-devel pam-devel bison flex pytest c-ares-devel \
ab140d61 24 python-devel python-sphinx libcap-devel \
5b08f6f9 25 elfutils-libelf-devel libunwind-devel protobuf-c-devel
afb8fe93
DL
26
27.. include:: building-libunwind-note.rst
278fb111 28
fc5a4adc
RW
29.. include:: building-libyang.rst
30
278fb111
MW
31Get FRR, compile it and install it (from Git)
32---------------------------------------------
33
d1890d04
QY
34**This assumes you want to build and install FRR from source and not
35using any packages**
36
37Add frr groups and user
75ca3b11 38^^^^^^^^^^^^^^^^^^^^^^^
278fb111 39
d1890d04 40::
278fb111 41
eb651bbc 42 sudo groupadd -g 92 frr
2f62815f
DS
43 sudo groupadd -r -g 85 frrvty
44 sudo useradd -u 92 -g 92 -M -r -G frrvty -s /sbin/nologin \
447a8fe9 45 -c "FRR FRRouting suite" -d /var/run/frr frr
278fb111 46
d1890d04 47Download Source, configure and compile it
75ca3b11 48^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
d1890d04
QY
49
50(You may prefer different options on configure statement. These are just
eb651bbc
MW
51an example.)
52
d1890d04
QY
53::
54
d6180888 55 git clone https://github.com/frrouting/frr.git frr
eb651bbc 56 cd frr
eb651bbc
MW
57 ./bootstrap.sh
58 ./configure \
a63edb35
MW
59 --bindir=/usr/bin \
60 --sbindir=/usr/lib/frr \
eb651bbc 61 --sysconfdir=/etc/frr \
a63edb35
MW
62 --libdir=/usr/lib/frr \
63 --libexecdir=/usr/lib/frr \
eb651bbc 64 --localstatedir=/var/run/frr \
a63edb35 65 --with-moduledir=/usr/lib/frr/modules \
eb651bbc
MW
66 --enable-snmp=agentx \
67 --enable-multipath=64 \
eb651bbc
MW
68 --enable-user=frr \
69 --enable-group=frr \
2f62815f 70 --enable-vty-group=frrvty \
a63edb35 71 --disable-ldpd \
eb651bbc
MW
72 --enable-fpm \
73 --with-pkg-git-version \
3c70fb01
LB
74 --with-pkg-extra-version=-MyOwnFRRVersion \
75 SPHINXBUILD=/usr/bin/sphinx-build
eb651bbc
MW
76 make
77 make check
78 sudo make install
278fb111 79
d1890d04 80Create empty FRR configuration files
75ca3b11 81^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
d1890d04
QY
82
83::
84
eb651bbc
MW
85 sudo mkdir /var/log/frr
86 sudo mkdir /etc/frr
87 sudo touch /etc/frr/zebra.conf
88 sudo touch /etc/frr/bgpd.conf
89 sudo touch /etc/frr/ospfd.conf
90 sudo touch /etc/frr/ospf6d.conf
91 sudo touch /etc/frr/isisd.conf
92 sudo touch /etc/frr/ripd.conf
93 sudo touch /etc/frr/ripngd.conf
94 sudo touch /etc/frr/pimd.conf
a63edb35
MW
95 sudo touch /etc/frr/nhrpd.conf
96 sudo touch /etc/frr/eigrpd.conf
97 sudo touch /etc/frr/babeld.conf
eb651bbc
MW
98 sudo chown -R frr:frr /etc/frr/
99 sudo touch /etc/frr/vtysh.conf
2f62815f 100 sudo chown frr:frrvty /etc/frr/vtysh.conf
eb651bbc 101 sudo chmod 640 /etc/frr/*.conf
278fb111 102
d1890d04 103Install daemon config file
75ca3b11 104^^^^^^^^^^^^^^^^^^^^^^^^^^
d1890d04
QY
105
106::
107
6819445c 108 sudo install -p -m 644 tools/etc/frr/daemons /etc/frr/
a63edb35
MW
109 sudo chown frr:frr /etc/frr/daemons
110
d1890d04 111Edit /etc/frr/daemons as needed to select the required daemons
75ca3b11 112^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
a63edb35 113
d1890d04
QY
114Look for the section with ``watchfrr_enable=...`` and ``zebra=...`` etc.
115Enable the daemons as required by changing the value to ``yes``
a63edb35 116
d1890d04 117Enable IP & IPv6 forwarding
75ca3b11 118^^^^^^^^^^^^^^^^^^^^^^^^^^^
278fb111 119
d1890d04 120Create a new file ``/etc/sysctl.d/90-routing-sysctl.conf`` with the
eb651bbc 121following content:
278fb111 122
d1890d04
QY
123::
124
278fb111
MW
125 # Sysctl for routing
126 #
127 # Routing: We need to forward packets
128 net.ipv4.conf.all.forwarding=1
129 net.ipv6.conf.all.forwarding=1
130
56f0bea7 131Load the modified sysctl's on the system:
278fb111 132
d1890d04
QY
133::
134
a63edb35
MW
135 sudo sysctl -p /etc/sysctl.d/90-routing-sysctl.conf
136
6819445c
DA
137Install frr Service
138^^^^^^^^^^^^^^^^^^^
d1890d04
QY
139
140::
141
6819445c 142 sudo install -p -m 644 tools/frr.service /usr/lib/systemd/system/frr.service
278fb111 143
d1890d04 144Register the systemd files
75ca3b11 145^^^^^^^^^^^^^^^^^^^^^^^^^^
d1890d04
QY
146
147::
148
a63edb35 149 sudo systemctl preset frr.service
d1890d04
QY
150
151Enable required frr at startup
75ca3b11 152^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
d1890d04
QY
153
154::
155
a63edb35
MW
156 sudo systemctl enable frr
157
d1890d04 158Reboot or start FRR manually
75ca3b11 159^^^^^^^^^^^^^^^^^^^^^^^^^^^^
d1890d04
QY
160
161::
162
a63edb35 163 sudo systemctl start frr