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