]> git.proxmox.com Git - mirror_frr.git/blob - doc/Building_FRR_on_CentOS6.md
Merge pull request #1329 from opensourcerouting/debian9-pkg
[mirror_frr.git] / doc / Building_FRR_on_CentOS6.md
1 Building FRR on CentOS 6 from Git Source
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 CentOS 6 restrictions:
11 ----------------------
12
13 - PIMd is not supported on `CentOS 6`. Upgrade to `CentOS 7` if PIMd is
14 needed
15 - MPLS is not supported on `CentOS 6`. MPLS requires Linux Kernel 4.5 or
16 higher (LDP can be built, but may have limited use without MPLS)
17
18 Install required packages
19 -------------------------
20
21 Add packages:
22
23 sudo yum install git autoconf automake libtool make gawk \
24 readline-devel texinfo net-snmp-devel groff pkgconfig \
25 json-c-devel pam-devel flex epel-release perl-XML-LibXML \
26 c-ares-devel
27
28 Install newer version of bison (CentOS 6 package source is too old) from
29 CentOS 7
30
31 sudo yum install rpm-build
32 curl -O http://vault.centos.org/7.0.1406/os/Source/SPackages/bison-2.7-4.el7.src.rpm
33 rpmbuild --rebuild ./bison-2.7-4.el7.src.rpm
34 sudo yum install ./rpmbuild/RPMS/x86_64/bison-2.7-4.el6.x86_64.rpm
35 rm -rf rpmbuild
36
37 Install newer version of autoconf and automake (Package versions are too old)
38
39 curl -O http://ftp.gnu.org/gnu/autoconf/autoconf-2.69.tar.gz
40 tar xvf autoconf-2.69.tar.gz
41 cd autoconf-2.69
42 ./configure --prefix=/usr
43 make
44 sudo make install
45 cd ..
46
47 curl -O http://ftp.gnu.org/gnu/automake/automake-1.15.tar.gz
48 tar xvf automake-1.15.tar.gz
49 cd automake-1.15
50 ./configure --prefix=/usr
51 make
52 sudo make install
53 cd ..
54
55 Install `Python 2.7` in parallel to default 2.6 (needed for `make check` to
56 run unittests).
57 Pick correct EPEL based on CentOS version used. Then install current `pytest`
58
59 sudo rpm -ivh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
60 sudo rpm -ivh https://centos6.iuscommunity.org/ius-release.rpm
61 sudo yum install python27 python27-pip
62 sudo pip2.7 install pytest
63
64 Please note that `CentOS 6` needs to keep python pointing to version 2.6
65 for `yum` to keep working, so don't create a symlink for python2.7 to python
66
67 Get FRR, compile it and install it (from Git)
68 ---------------------------------------------
69
70 **This assumes you want to build and install FRR from source and not using
71 any packages**
72
73 ### Add frr groups and user
74
75 sudo groupadd -g 92 frr
76 sudo groupadd -r -g 85 frrvt
77 sudo useradd -u 92 -g 92 -M -r -G frrvt -s /sbin/nologin \
78 -c "FRR FRRouting suite" -d /var/run/frr frr
79
80 ### Download Source, configure and compile it
81 (You may prefer different options on configure statement. These are just
82 an example.)
83
84 git clone https://github.com/frrouting/frr.git frr
85 cd frr
86 git checkout stable/3.0
87 ./bootstrap.sh
88 ./configure \
89 --bindir=/usr/bin \
90 --sbindir=/usr/lib/frr \
91 --sysconfdir=/etc/frr \
92 --libdir=/usr/lib/frr \
93 --libexecdir=/usr/lib/frr \
94 --localstatedir=/var/run/frr \
95 --with-moduledir=/usr/lib/frr/modules \
96 --disable-pimd \
97 --enable-snmp=agentx \
98 --enable-multipath=64 \
99 --enable-ospfclient=yes \
100 --enable-ospfapi=yes \
101 --enable-user=frr \
102 --enable-group=frr \
103 --enable-vty-group=frrvt \
104 --enable-rtadv \
105 --disable-exampledir \
106 --enable-watchfrr \
107 --disable-ldpd \
108 --enable-fpm \
109 --enable-nhrpd \
110 --with-pkg-git-version \
111 --with-pkg-extra-version=-MyOwnFRRVersion
112 make
113 make check PYTHON=/usr/bin/python2.7
114 sudo make install
115
116 ### Create empty FRR configuration files
117 sudo mkdir /var/log/frr
118 sudo mkdir /etc/frr
119 sudo touch /etc/frr/zebra.conf
120 sudo touch /etc/frr/bgpd.conf
121 sudo touch /etc/frr/ospfd.conf
122 sudo touch /etc/frr/ospf6d.conf
123 sudo touch /etc/frr/isisd.conf
124 sudo touch /etc/frr/ripd.conf
125 sudo touch /etc/frr/ripngd.conf
126 sudo touch /etc/frr/nhrpd.conf
127 sudo chown -R frr:frr /etc/frr/
128 sudo touch /etc/frr/vtysh.conf
129 sudo chown frr:frrvt /etc/frr/vtysh.conf
130 sudo chmod 640 /etc/frr/*.conf
131
132 ### Install daemon config file
133 sudo install -p -m 644 redhat/daemons /etc/frr/
134 sudo chown frr:frr /etc/frr/daemons
135
136 ### Edit /etc/frr/daemons as needed to select the required daemons
137
138 Look for the section with `watchfrr_enable=...` and `zebra=...` etc.
139 Enable the daemons as required by changing the value to `yes`
140
141 ### Enable IP & IPv6 forwarding
142
143 Edit `/etc/sysctl.conf` and set the following values (ignore the other
144 settings)
145
146 # Controls IP packet forwarding
147 net.ipv4.ip_forward = 1
148 net.ipv6.conf.all.forwarding=1
149
150 # Controls source route verification
151 net.ipv4.conf.default.rp_filter = 0
152
153 Load the modifed sysctl's on the system:
154
155 sudo sysctl -p /etc/sysctl.d/90-routing-sysctl.conf
156
157 ### Add init.d startup files
158 sudo install -p -m 755 redhat/frr.init /etc/init.d/frr
159 sudo chkconfig --add frr
160
161 ### Enable frr daemon at startup
162 sudo chkconfig frr on
163
164 ### Start FRR manually (or reboot)
165 sudo /etc/init.d/frr start