]> git.proxmox.com Git - mirror_frr.git/blame - doc/developer/building-frr-for-centos6.rst
Merge pull request #13430 from opensourcerouting/feature/rip_allow-ecmp_limit
[mirror_frr.git] / doc / developer / building-frr-for-centos6.rst
CommitLineData
9251d1f5
QY
1.. _building-centos6:
2
d1890d04 3CentOS 6
278fb111
MW
4========================================
5
9251d1f5
QY
6This document describes installation from source. If you want to build an RPM,
7see :ref:`packaging-redhat`.
a63edb35 8
d1890d04 9Instructions are tested with ``CentOS 6.8`` on ``x86_64`` platform
278fb111 10
24a532dc
MW
11Warning:
12--------
13``CentOS 6`` is very old and not fully supported by the FRR community
14anymore. Building FRR takes multiple manual steps to update the build
15system with newer packages than what's available from the archives.
16However, the built packages can still be installed afterwards on
17a standard ``CentOS 6`` without any special packages.
18
19Support for CentOS 6 is now on a best-effort base by the community.
20
278fb111
MW
21CentOS 6 restrictions:
22----------------------
23
d1890d04
QY
24- PIMd is not supported on ``CentOS 6``. Upgrade to ``CentOS 7`` if
25 PIMd is needed
26- MPLS is not supported on ``CentOS 6``. MPLS requires Linux Kernel 4.5
27 or higher (LDP can be built, but may have limited use without MPLS)
56f0bea7 28- Zebra is unable to detect what bridge/vrf an interface is associated
d1890d04
QY
29 with (IFLA\_INFO\_SLAVE\_KIND does not exist in the kernel headers,
30 you can use a newer kernel + headers to get this functionality)
31- frr\_reload.py will not work, as this requires Python 2.7, and CentOS
32 6 only has 2.6. You can install Python 2.7 via IUS, but it won't work
33 properly unless you compile and install the ipaddr package for it.
24a532dc
MW
34- Building the package requires Sphinx >= 1.1. Only a non-standard
35 package provides a newer sphinx and requires manual installation
36 (see below)
37
278fb111
MW
38
39Install required packages
40-------------------------
eb651bbc 41
278fb111
MW
42Add packages:
43
09b67c09 44.. code-block:: shell
d1890d04 45
7d9a2e6d 46 sudo yum install git autoconf automake libtool make \
a63edb35 47 readline-devel texinfo net-snmp-devel groff pkgconfig \
3cb0eab3 48 json-c-devel pam-devel flex epel-release c-ares-devel libcap-devel \
5b08f6f9 49 elfutils-libelf-devel protobuf-c-devel
278fb111 50
09b67c09
QY
51Install newer version of bison (CentOS 6 package source is too old) from CentOS
527:
278fb111 53
09b67c09 54.. code-block:: shell
d1890d04 55
09b67c09
QY
56 sudo yum install rpm-build
57 curl -O http://vault.centos.org/7.0.1406/os/Source/SPackages/bison-2.7-4.el7.src.rpm
58 rpmbuild --rebuild ./bison-2.7-4.el7.src.rpm
59 sudo yum install ./rpmbuild/RPMS/x86_64/bison-2.7-4.el6.x86_64.rpm
60 rm -rf rpmbuild
278fb111 61
09b67c09 62Install newer version of autoconf and automake (Package versions are too old):
d1890d04 63
09b67c09 64.. code-block:: shell
278fb111 65
09b67c09
QY
66 curl -O http://ftp.gnu.org/gnu/autoconf/autoconf-2.69.tar.gz
67 tar xvf autoconf-2.69.tar.gz
68 cd autoconf-2.69
69 ./configure --prefix=/usr
70 make
71 sudo make install
72 cd ..
d1890d04 73
09b67c09
QY
74 curl -O http://ftp.gnu.org/gnu/automake/automake-1.15.tar.gz
75 tar xvf automake-1.15.tar.gz
76 cd automake-1.15
77 ./configure --prefix=/usr
78 make
79 sudo make install
80 cd ..
81
82Install ``Python 2.7`` in parallel to default 2.6. Make sure you've install
83EPEL (``epel-release`` as above). Then install current ``python27``:
84``python27-devel`` and ``pytest``
85
86.. code-block:: shell
278fb111 87
09b67c09
QY
88 sudo rpm -ivh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
89 sudo rpm -ivh https://centos6.iuscommunity.org/ius-release.rpm
90 sudo yum install python27 python27-pip python27-devel
91 sudo pip2.7 install pytest
278fb111 92
09b67c09
QY
93Please note that ``CentOS 6`` needs to keep python pointing to version 2.6 for
94``yum`` to keep working, so don't create a symlink for python2.7 to python.
ae32b152 95
09b67c09 96Install newer ``Sphinx-Build`` based on ``Python 2.7``.
24a532dc 97
78b4c546
MW
98Create a new repo ``/etc/yum.repos.d/puias6.repo`` with the following contents:
99
100::
101
09b67c09
QY
102 ### Name: RPM Repository for RHEL 6 - PUIAS (used for Sphinx-Build)
103 ### URL: http://springdale.math.ias.edu/data/puias/computational
104 [puias-computational]
105 name = RPM Repository for RHEL 6 - Sphinx-Build
106 baseurl = http://springdale.math.ias.edu/data/puias/computational/$releasever/$basearch
107 #mirrorlist =
108 enabled = 1
109 protect = 0
110 gpgkey =
111 gpgcheck = 0
78b4c546
MW
112
113Update rpm database & Install newer sphinx
114
09b67c09 115.. code-block:: shell
78b4c546 116
09b67c09
QY
117 sudo yum update
118 sudo yum install python27-sphinx
24a532dc 119
56ddff04
LB
120Install libyang and its dependencies:
121
122.. code-block:: shell
123
124 sudo yum install pcre-devel doxygen cmake
125 git clone https://github.com/CESNET/libyang.git
126 cd libyang
127 git checkout 090926a89d59a3c4000719505d563aaf6ac60f2
128 mkdir build ; cd build
129 cmake -DENABLE_LYD_PRIV=ON -DCMAKE_INSTALL_PREFIX:PATH=/usr -D CMAKE_BUILD_TYPE:String="Release" ..
130 make build-rpm
131 sudo yum install ./rpms/RPMS/x86_64/libyang-0.16.111-0.x86_64.rpm ./rpms/RPMS/x86_64/libyang-devel-0.16.111-0.x86_64.rpm
132 cd ../..
fc5a4adc 133
278fb111
MW
134Get FRR, compile it and install it (from Git)
135---------------------------------------------
136
09b67c09
QY
137**This assumes you want to build and install FRR from source and not using any
138packages**
278fb111 139
d1890d04 140Add frr groups and user
75ca3b11 141^^^^^^^^^^^^^^^^^^^^^^^
d1890d04 142
09b67c09 143.. code-block:: shell
278fb111 144
09b67c09 145 sudo groupadd -g 92 frr
2f62815f
DS
146 sudo groupadd -r -g 85 frrvty
147 sudo useradd -u 92 -g 92 -M -r -G frrvty -s /sbin/nologin \
447a8fe9 148 -c "FRR FRRouting suite" -d /var/run/frr frr
278fb111 149
d1890d04 150Download Source, configure and compile it
75ca3b11 151^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
d1890d04
QY
152
153(You may prefer different options on configure statement. These are just
eb651bbc
MW
154an example.)
155
09b67c09 156.. code-block:: shell
d1890d04 157
d6180888 158 git clone https://github.com/frrouting/frr.git frr
eb651bbc 159 cd frr
eb651bbc
MW
160 ./bootstrap.sh
161 ./configure \
a63edb35
MW
162 --bindir=/usr/bin \
163 --sbindir=/usr/lib/frr \
eb651bbc 164 --sysconfdir=/etc/frr \
a63edb35
MW
165 --libdir=/usr/lib/frr \
166 --libexecdir=/usr/lib/frr \
eb651bbc 167 --localstatedir=/var/run/frr \
a63edb35 168 --with-moduledir=/usr/lib/frr/modules \
eb651bbc
MW
169 --disable-pimd \
170 --enable-snmp=agentx \
171 --enable-multipath=64 \
eb651bbc
MW
172 --enable-user=frr \
173 --enable-group=frr \
2f62815f 174 --enable-vty-group=frrvty \
a63edb35 175 --disable-ldpd \
eb651bbc
MW
176 --enable-fpm \
177 --with-pkg-git-version \
45da32d7 178 --with-pkg-extra-version=-MyOwnFRRVersion
a214288c 179 make
45da32d7 180 make check
a214288c 181 sudo make install
278fb111 182
d1890d04 183Create empty FRR configuration files
75ca3b11 184^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
d1890d04 185
09b67c09
QY
186.. code-block:: shell
187
188 sudo mkdir /var/log/frr
189 sudo mkdir /etc/frr
190
191For integrated config file:
d1890d04 192
09b67c09
QY
193.. code-block:: shell
194
195 sudo touch /etc/frr/frr.conf
196
197For individual config files:
198
199.. note:: Integrated config is preferred to individual config.
200
201.. code-block:: shell
202
203 sudo touch /etc/frr/babeld.conf
204 sudo touch /etc/frr/bfdd.conf
205 sudo touch /etc/frr/bgpd.conf
206 sudo touch /etc/frr/eigrpd.conf
207 sudo touch /etc/frr/isisd.conf
208 sudo touch /etc/frr/ldpd.conf
209 sudo touch /etc/frr/nhrpd.conf
210 sudo touch /etc/frr/ospf6d.conf
211 sudo touch /etc/frr/ospfd.conf
212 sudo touch /etc/frr/pbrd.conf
213 sudo touch /etc/frr/pimd.conf
214 sudo touch /etc/frr/ripd.conf
215 sudo touch /etc/frr/ripngd.conf
216 sudo touch /etc/frr/staticd.conf
217 sudo touch /etc/frr/zebra.conf
218 sudo chown -R frr:frr /etc/frr/
219 sudo touch /etc/frr/vtysh.conf
220 sudo chown frr:frrvty /etc/frr/vtysh.conf
221 sudo chmod 640 /etc/frr/*.conf
278fb111 222
d1890d04 223Install daemon config file
75ca3b11 224^^^^^^^^^^^^^^^^^^^^^^^^^^
d1890d04 225
09b67c09 226.. code-block:: shell
d1890d04 227
6819445c 228 sudo install -p -m 644 tools/etc/frr/daemons /etc/frr/
09b67c09 229 sudo chown frr:frr /etc/frr/daemons
a63edb35 230
d1890d04 231Edit /etc/frr/daemons as needed to select the required daemons
75ca3b11 232^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
a63edb35 233
d1890d04
QY
234Look for the section with ``watchfrr_enable=...`` and ``zebra=...`` etc.
235Enable the daemons as required by changing the value to ``yes``
a63edb35 236
d1890d04 237Enable IP & IPv6 forwarding
75ca3b11 238^^^^^^^^^^^^^^^^^^^^^^^^^^^
278fb111 239
09b67c09
QY
240Edit :file:`/etc/sysctl.conf` and set the following values (ignore the other
241settings)::
278fb111 242
09b67c09
QY
243 # Controls IP packet forwarding
244 net.ipv4.ip_forward = 1
245 net.ipv6.conf.all.forwarding=1
278fb111 246
09b67c09
QY
247 # Controls source route verification
248 net.ipv4.conf.default.rp_filter = 0
278fb111 249
56f0bea7 250Load the modified sysctl's on the system:
a63edb35 251
09b67c09 252.. code-block:: shell
d1890d04 253
09b67c09 254 sudo sysctl -p /etc/sysctl.d/90-routing-sysctl.conf
278fb111 255
6819445c
DA
256Add init.d startup file
257^^^^^^^^^^^^^^^^^^^^^^^
d1890d04 258
009ca8cd 259.. code-block:: shell
d1890d04 260
6819445c 261 sudo install -p -m 755 tools/frr /etc/init.d/frr
09b67c09 262 sudo chkconfig --add frr
a63edb35 263
09b67c09 264Enable FRR daemon at startup
75ca3b11 265^^^^^^^^^^^^^^^^^^^^^^^^^^^^
d1890d04 266
009ca8cd 267.. code-block:: shell
d1890d04 268
09b67c09 269 sudo chkconfig frr on
a63edb35 270
d1890d04 271Start FRR manually (or reboot)
75ca3b11 272^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
d1890d04 273
009ca8cd 274.. code-block:: shell
d1890d04 275
09b67c09 276 sudo /etc/init.d/frr start