1.. _building-centos6:
2
3CentOS 6
4========================================
5
6This document describes installation from source. If you want to build an RPM,
7see :ref:`packaging-redhat`.
8
9Instructions are tested with ``CentOS 6.8`` on ``x86_64`` platform
10
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
21CentOS 6 restrictions:
22----------------------
23
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)
28-  Zebra is unable to detect what bridge/vrf an interface is associated
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.
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
38
39Install required packages
40-------------------------
41
42Add packages:
43
44.. code-block:: shell
45
46   sudo yum install git autoconf automake libtool make \
47      readline-devel texinfo net-snmp-devel groff pkgconfig \
48      json-c-devel pam-devel flex epel-release c-ares-devel libcap-devel
49
50Install newer version of bison (CentOS 6 package source is too old) from CentOS
517:
52
53.. code-block:: shell
54
55   sudo yum install rpm-build
56   curl -O http://vault.centos.org/7.0.1406/os/Source/SPackages/bison-2.7-4.el7.src.rpm
57   rpmbuild --rebuild ./bison-2.7-4.el7.src.rpm
58   sudo yum install ./rpmbuild/RPMS/x86_64/bison-2.7-4.el6.x86_64.rpm
59   rm -rf rpmbuild
60
61Install newer version of autoconf and automake (Package versions are too old):
62
63.. code-block:: shell
64
65   curl -O http://ftp.gnu.org/gnu/autoconf/autoconf-2.69.tar.gz
66   tar xvf autoconf-2.69.tar.gz
67   cd autoconf-2.69
68   ./configure --prefix=/usr
69   make
70   sudo make install
71   cd ..
72
73   curl -O http://ftp.gnu.org/gnu/automake/automake-1.15.tar.gz
74   tar xvf automake-1.15.tar.gz
75   cd automake-1.15
76   ./configure --prefix=/usr
77   make
78   sudo make install
79   cd ..
80
81Install ``Python 2.7`` in parallel to default 2.6. Make sure you've install
82EPEL (``epel-release`` as above). Then install current ``python27``:
83``python27-devel`` and ``pytest``
84
85.. code-block:: shell
86
87   sudo rpm -ivh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
88   sudo rpm -ivh https://centos6.iuscommunity.org/ius-release.rpm
89   sudo yum install python27 python27-pip python27-devel
90   sudo pip2.7 install pytest
91
92Please note that ``CentOS 6`` needs to keep python pointing to version 2.6 for
93``yum`` to keep working, so don't create a symlink for python2.7 to python.
94
95Install newer ``Sphinx-Build`` based on ``Python 2.7``.
96
97Create a new repo ``/etc/yum.repos.d/puias6.repo`` with the following contents:
98
99::
100
101   ### Name: RPM Repository for RHEL 6 - PUIAS (used for Sphinx-Build)
102   ### URL: http://springdale.math.ias.edu/data/puias/computational
103   [puias-computational]
104   name = RPM Repository for RHEL 6 - Sphinx-Build
105   baseurl = http://springdale.math.ias.edu/data/puias/computational/$releasever/$basearch
106   #mirrorlist =
107   enabled = 1
108   protect = 0
109   gpgkey =
110   gpgcheck = 0
111
112Update rpm database & Install newer sphinx
113
114.. code-block:: shell
115
116   sudo yum update
117   sudo yum install python27-sphinx
118
119Install libyang and its dependencies:
120
121.. code-block:: shell
122
123   sudo yum install pcre-devel doxygen cmake
124   git clone https://github.com/CESNET/libyang.git
125   cd libyang
126   git checkout 090926a89d59a3c4000719505d563aaf6ac60f2
127   mkdir build ; cd build
128   cmake -DENABLE_LYD_PRIV=ON -DCMAKE_INSTALL_PREFIX:PATH=/usr -D CMAKE_BUILD_TYPE:String="Release" ..
129   make build-rpm
130   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
131   cd ../..
132
133Get FRR, compile it and install it (from Git)
134---------------------------------------------
135
136**This assumes you want to build and install FRR from source and not using any
137packages**
138
139Add frr groups and user
140^^^^^^^^^^^^^^^^^^^^^^^
141
142.. code-block:: shell
143
144   sudo groupadd -g 92 frr
145   sudo groupadd -r -g 85 frrvty
146   sudo useradd -u 92 -g 92 -M -r -G frrvty -s /sbin/nologin \
147      -c "FRR FRRouting suite" -d /var/run/frr frr
148
149Download Source, configure and compile it
150^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
151
152(You may prefer different options on configure statement. These are just
153an example.)
154
155.. code-block:: shell
156
157    git clone https://github.com/frrouting/frr.git frr
158    cd frr
159    ./bootstrap.sh
160    ./configure \
161        --bindir=/usr/bin \
162        --sbindir=/usr/lib/frr \
163        --sysconfdir=/etc/frr \
164        --libdir=/usr/lib/frr \
165        --libexecdir=/usr/lib/frr \
166        --localstatedir=/var/run/frr \
167        --with-moduledir=/usr/lib/frr/modules \
168        --disable-pimd \
169        --enable-snmp=agentx \
170        --enable-multipath=64 \
171        --enable-user=frr \
172        --enable-group=frr \
173        --enable-vty-group=frrvty \
174        --disable-exampledir \
175        --disable-ldpd \
176        --enable-fpm \
177        --with-pkg-git-version \
178        --with-pkg-extra-version=-MyOwnFRRVersion
179    make
180    make check
181    sudo make install
182
183Create empty FRR configuration files
184^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
185
186.. code-block:: shell
187
188   sudo mkdir /var/log/frr
189   sudo mkdir /etc/frr
190
191For integrated config file:
192
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
222
223Install daemon config file
224^^^^^^^^^^^^^^^^^^^^^^^^^^
225
226.. code-block:: shell
227
228   sudo install -p -m 644 tools/etc/frr/daemons /etc/frr/
229   sudo chown frr:frr /etc/frr/daemons
230
231Edit /etc/frr/daemons as needed to select the required daemons
232^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
233
234Look for the section with ``watchfrr_enable=...`` and ``zebra=...`` etc.
235Enable the daemons as required by changing the value to ``yes``
236
237Enable IP & IPv6 forwarding
238^^^^^^^^^^^^^^^^^^^^^^^^^^^
239
240Edit :file:`/etc/sysctl.conf` and set the following values (ignore the other
241settings)::
242
243   # Controls IP packet forwarding
244   net.ipv4.ip_forward = 1
245   net.ipv6.conf.all.forwarding=1
246
247   # Controls source route verification
248   net.ipv4.conf.default.rp_filter = 0
249
250Load the modified sysctl's on the system:
251
252.. code-block:: shell
253
254   sudo sysctl -p /etc/sysctl.d/90-routing-sysctl.conf
255
256Add init.d startup file
257^^^^^^^^^^^^^^^^^^^^^^^
258
259.. code-block:: shell
260
261   sudo install -p -m 755 tools/frr /etc/init.d/frr
262   sudo chkconfig --add frr
263
264Enable FRR daemon at startup
265^^^^^^^^^^^^^^^^^^^^^^^^^^^^
266
267.. code-block:: shell
268
269   sudo chkconfig frr on
270
271Start FRR manually (or reboot)
272^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
273
274.. code-block:: shell
275
276   sudo /etc/init.d/frr start
277