]> git.proxmox.com Git - mirror_frr.git/blob - doc/developer/building-frr-on-centos6.rst
zebra/lib: code cleaning
[mirror_frr.git] / doc / developer / building-frr-on-centos6.rst
1 CentOS 6
2 ========================================
3
4 (As an alternative to this installation, you may prefer to create a FRR
5 rpm package yourself and install that package instead. See instructions
6 in redhat/README.rpm\_build.md on how to build a rpm package)
7
8 Instructions are tested with ``CentOS 6.8`` on ``x86_64`` platform
9
10 Warning:
11 --------
12 ``CentOS 6`` is very old and not fully supported by the FRR community
13 anymore. Building FRR takes multiple manual steps to update the build
14 system with newer packages than what's available from the archives.
15 However, the built packages can still be installed afterwards on
16 a standard ``CentOS 6`` without any special packages.
17
18 Support for CentOS 6 is now on a best-effort base by the community.
19
20 CentOS 6 restrictions:
21 ----------------------
22
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.
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
37
38 Install required packages
39 -------------------------
40
41 Add packages:
42
43 ::
44
45 sudo yum install git autoconf automake libtool make gawk \
46 readline-devel texinfo net-snmp-devel groff pkgconfig \
47 json-c-devel pam-devel flex epel-release perl-XML-LibXML \
48 c-ares-devel
49
50 Install newer version of bison (CentOS 6 package source is too old) from
51 CentOS 7
52
53 ::
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
61 Install newer version of autoconf and automake (Package versions are too
62 old)
63
64 ::
65
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 ..
73
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
82 Install ``Python 2.7`` in parallel to default 2.6. Make sure you've
83 install EPEL (``epel-release`` as above). Then install current
84 ``python27``, ``python27-devel`` and ``pytest``
85
86 ::
87
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
92
93 Please note that ``CentOS 6`` needs to keep python pointing to version
94 2.6 for ``yum`` to keep working, so don't create a symlink for python2.7
95 to python
96
97 Install newer ``Sphinx-Build`` based on ``Python 2.7``
98
99 Create a new repo ``/etc/yum.repos.d/puias6.repo`` with the following contents:
100
101 ::
102
103 ### Name: RPM Repository for RHEL 6 - PUIAS (used for Sphinx-Build)
104 ### URL: http://springdale.math.ias.edu/data/puias/computational
105 [puias-computational]
106 name = RPM Repository for RHEL 6 - Sphinx-Build
107 baseurl = http://springdale.math.ias.edu/data/puias/computational/$releasever/$basearch
108 #mirrorlist =
109 enabled = 1
110 protect = 0
111 gpgkey =
112 gpgcheck = 0
113
114 Update rpm database & Install newer sphinx
115
116 ::
117
118 sudo yum update
119 sudo yum install python27-sphinx
120
121 Get FRR, compile it and install it (from Git)
122 ---------------------------------------------
123
124 **This assumes you want to build and install FRR from source and not
125 using any packages**
126
127 Add frr groups and user
128 ^^^^^^^^^^^^^^^^^^^^^^^
129
130 ::
131
132 sudo groupadd -g 92 frr
133 sudo groupadd -r -g 85 frrvt
134 sudo useradd -u 92 -g 92 -M -r -G frrvt -s /sbin/nologin \
135 -c "FRR FRRouting suite" -d /var/run/frr frr
136
137 Download Source, configure and compile it
138 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
139
140 (You may prefer different options on configure statement. These are just
141 an example.)
142
143 ::
144
145 git clone https://github.com/frrouting/frr.git frr
146 cd frr
147 ./bootstrap.sh
148 ./configure \
149 --bindir=/usr/bin \
150 --sbindir=/usr/lib/frr \
151 --sysconfdir=/etc/frr \
152 --libdir=/usr/lib/frr \
153 --libexecdir=/usr/lib/frr \
154 --localstatedir=/var/run/frr \
155 --with-moduledir=/usr/lib/frr/modules \
156 --disable-pimd \
157 --enable-snmp=agentx \
158 --enable-multipath=64 \
159 --enable-ospfclient=yes \
160 --enable-ospfapi=yes \
161 --enable-user=frr \
162 --enable-group=frr \
163 --enable-vty-group=frrvt \
164 --enable-rtadv \
165 --disable-exampledir \
166 --enable-watchfrr \
167 --disable-ldpd \
168 --enable-fpm \
169 --enable-nhrpd \
170 --enable-eigrpd \
171 --enable-babeld \
172 --with-pkg-git-version \
173 --with-pkg-extra-version=-MyOwnFRRVersion
174 make SPHINXBUILD=sphinx-build2.7
175 make check PYTHON=/usr/bin/python2.7 SPHINXBUILD=sphinx-build2.7
176 sudo make SPHINXBUILD=sphinx-build2.7 install
177
178 Create empty FRR configuration files
179 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
180
181 ::
182
183 sudo mkdir /var/log/frr
184 sudo mkdir /etc/frr
185 sudo touch /etc/frr/zebra.conf
186 sudo touch /etc/frr/bgpd.conf
187 sudo touch /etc/frr/ospfd.conf
188 sudo touch /etc/frr/ospf6d.conf
189 sudo touch /etc/frr/isisd.conf
190 sudo touch /etc/frr/ripd.conf
191 sudo touch /etc/frr/ripngd.conf
192 sudo touch /etc/frr/nhrpd.conf
193 sudo touch /etc/frr/eigrpd.conf
194 sudo touch /etc/frr/babeld.conf
195 sudo chown -R frr:frr /etc/frr/
196 sudo touch /etc/frr/vtysh.conf
197 sudo chown frr:frrvt /etc/frr/vtysh.conf
198 sudo chmod 640 /etc/frr/*.conf
199
200 Install daemon config file
201 ^^^^^^^^^^^^^^^^^^^^^^^^^^
202
203 ::
204
205 sudo install -p -m 644 redhat/daemons /etc/frr/
206 sudo chown frr:frr /etc/frr/daemons
207
208 Edit /etc/frr/daemons as needed to select the required daemons
209 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
210
211 Look for the section with ``watchfrr_enable=...`` and ``zebra=...`` etc.
212 Enable the daemons as required by changing the value to ``yes``
213
214 Enable IP & IPv6 forwarding
215 ^^^^^^^^^^^^^^^^^^^^^^^^^^^
216
217 Edit ``/etc/sysctl.conf`` and set the following values (ignore the other
218 settings)
219
220 ::
221
222 # Controls IP packet forwarding
223 net.ipv4.ip_forward = 1
224 net.ipv6.conf.all.forwarding=1
225
226 # Controls source route verification
227 net.ipv4.conf.default.rp_filter = 0
228
229 Load the modifed sysctl's on the system:
230
231 ::
232
233 sudo sysctl -p /etc/sysctl.d/90-routing-sysctl.conf
234
235 Add init.d startup files
236 ^^^^^^^^^^^^^^^^^^^^^^^^
237
238 ::
239
240 sudo install -p -m 755 redhat/frr.init /etc/init.d/frr
241 sudo chkconfig --add frr
242
243 Enable frr daemon at startup
244 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
245
246 ::
247
248 sudo chkconfig frr on
249
250 Start FRR manually (or reboot)
251 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
252
253 ::
254
255 sudo /etc/init.d/frr start