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